summaryrefslogtreecommitdiff
path: root/sql/field.h
diff options
context:
space:
mode:
authordlenev@brandersnatch.localdomain <>2004-06-18 10:11:31 +0400
committerdlenev@brandersnatch.localdomain <>2004-06-18 10:11:31 +0400
commit09ba29e53977d7469c39bf181a6e5853869125ed (patch)
treeff56e2c9414f6b3b146acbeb3081ea40aced7f99 /sql/field.h
parent48a47a0ea691b19216b055473212f8ecbdd10bb1 (diff)
downloadmariadb-git-09ba29e53977d7469c39bf181a6e5853869125ed.tar.gz
WL#1264 "Per-thread time zone support infrastructure".
Added basic per-thread time zone functionality (based on public domain elsie-code). Now user can select current time zone (from the list of time zones described in system tables). All NOW-like functions honor this time zone, values of TIMESTAMP type are interpreted as values in this time zone, so now our TIMESTAMP type behaves similar to Oracle's TIMESTAMP WITH LOCAL TIME ZONE (or proper PostgresSQL type). WL#1266 "CONVERT_TZ() - basic time with time zone conversion function". Fixed problems described in Bug #2336 (Different number of warnings when inserting bad datetime as string or as number). This required reworking of datetime realted warning hadling (they now generated at Field object level not in conversion functions). Optimization: Now Field class descendants use table->in_use member instead of current_thd macro.
Diffstat (limited to 'sql/field.h')
-rw-r--r--sql/field.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/sql/field.h b/sql/field.h
index 2b6ef28c184..f2a166d29c3 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -45,6 +45,10 @@ public:
char *ptr; // Position to field in record
uchar *null_ptr; // Byte where null_bit is
+ /*
+ Note that you can use table->in_use as replacement for current_thd member
+ only inside of val_*() and store() members (e.g. you can't use it in cons)
+ */
struct st_table *table; // Pointer for table
struct st_table *orig_table; // Pointer to original table
const char *table_name,*field_name;
@@ -264,7 +268,16 @@ public:
virtual CHARSET_INFO *charset(void) const { return &my_charset_bin; }
virtual bool has_charset(void) const { return FALSE; }
virtual void set_charset(CHARSET_INFO *charset) { }
- void set_warning(const unsigned int level, const unsigned int code);
+ bool set_warning(const unsigned int level, const unsigned int code,
+ int cuted_increment);
+ void set_datetime_warning(const uint level, const uint code,
+ const char *str, uint str_len,
+ timestamp_type ts_type, int cuted_increment);
+ void set_datetime_warning(const uint level, const uint code,
+ longlong nr, timestamp_type ts_type,
+ int cuted_increment);
+ void set_datetime_warning(const uint level, const uint code,
+ double nr, timestamp_type ts_type);
virtual field_cast_enum field_cast_type()= 0;
bool field_cast_compatible(field_cast_enum type);
/* maximum possible display length */