diff options
author | Sergei Golubchik <sergii@pisem.net> | 2011-06-06 20:28:15 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2011-06-06 20:28:15 +0200 |
commit | 4d128777dde904c5f0adab9b093e854c9c580d41 (patch) | |
tree | 36875e84e65be596def46c5d7ce621e60abcbdae /sql/mysql_priv.h | |
parent | c1a92f9caeb368021d5ffbe0df237ded29692c1a (diff) | |
download | mariadb-git-4d128777dde904c5f0adab9b093e854c9c580d41.tar.gz |
revert a suggested "optimization" that introduced a bug
compilation error in mysys/my_getsystime.c fixed
some redundant code removed
sec_to_time, time_to_sec, from_unixtime, unix_timestamp, @@timestamp now
use decimal, not double for numbers with a fractional part.
purge_master_logs_before_date() fixed
many bugs in corner cases fixed
mysys/my_getsystime.c:
compilation failure fixed
sql/sql_parse.cc:
don't cut corners. it backfires.
Diffstat (limited to 'sql/mysql_priv.h')
-rw-r--r-- | sql/mysql_priv.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 035f546f37a..f984668e69f 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -781,6 +781,18 @@ mysql_type_to_time_type(enum enum_field_types mysql_type) #include "sql_profile.h" #include "sql_partition.h" +class Lazy_string_decimal: public Lazy_string +{ + const my_decimal *d; +public: + Lazy_string_decimal(const my_decimal *d_arg) + : Lazy_string(), d(d_arg) {} + void copy(String *dst) const { + my_decimal2string(E_DEC_FATAL_ERROR, d, + 0, 0, ' ', dst); + } +}; + class user_var_entry; class Security_context; enum enum_var_type @@ -1883,6 +1895,7 @@ void flush_thread_cache(); /* item_func.cc */ extern bool check_reserved_words(LEX_STRING *name); extern enum_field_types agg_field_type(Item **items, uint nitems); +Item *find_date_time_item(Item **args, uint nargs, uint col); /* strfunc.cc */ ulonglong find_set(TYPELIB *lib, const char *x, uint length, CHARSET_INFO *cs, @@ -2235,6 +2248,18 @@ void make_truncated_value_warning(THD *thd, MYSQL_ERROR::enum_warning_level leve const Lazy_string *str_val, timestamp_type time_type, const char *field_name); +bool double_to_datetime_with_warn(double value, MYSQL_TIME *ltime, + ulong fuzzydate, + enum_field_types f_type, + const char *name); +bool decimal_to_datetime_with_warn(const my_decimal *value, MYSQL_TIME *ltime, + ulong fuzzydate, + enum_field_types f_type, + const char *name); +bool int_to_datetime_with_warn(longlong value, MYSQL_TIME *ltime, + ulong fuzzydate, + enum_field_types f_type, + const char *name); static inline void make_truncated_value_warning(THD *thd, MYSQL_ERROR::enum_warning_level level, const char *str_val, |