summaryrefslogtreecommitdiff
path: root/sql/item_timefunc.cc
diff options
context:
space:
mode:
authorunknown <ramil@mysql.com>2006-05-02 18:00:44 +0500
committerunknown <ramil@mysql.com>2006-05-02 18:00:44 +0500
commit409fb4895fd08e876b33c4d809919952871996a9 (patch)
treec3591641668aa04d2b41738ae65c6deec419c395 /sql/item_timefunc.cc
parent38b1f7c7c3790a6ee59dd213eab16fe9c6fd97f4 (diff)
downloadmariadb-git-409fb4895fd08e876b33c4d809919952871996a9.tar.gz
Fix for bug #16546: DATETIME+0 not always coerced the same way
mysql-test/r/func_time.result: Fix for bug #16546: DATETIME+0 not always coerced the same way - test case mysql-test/t/func_time.test: Fix for bug #16546: DATETIME+0 not always coerced the same way - test case sql/item_timefunc.cc: Fix for bug #16546: DATETIME+0 not always coerced the same way - set decimals to DATETIME_DEC sql/item_timefunc.h: Fix for bug #16546: DATETIME+0 not always coerced the same way - set decimals to DATETIME_DEC
Diffstat (limited to 'sql/item_timefunc.cc')
-rw-r--r--sql/item_timefunc.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index f3d6858755c..34850d4efdd 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -1372,7 +1372,7 @@ void Item_func_curtime::fix_length_and_dec()
{
TIME ltime;
- decimals=0;
+ decimals= DATETIME_DEC;
collation.set(&my_charset_bin);
store_now_in_TIME(&ltime);
value= TIME_to_ulonglong_time(&ltime);
@@ -1419,7 +1419,7 @@ String *Item_func_now::val_str(String *str)
void Item_func_now::fix_length_and_dec()
{
- decimals=0;
+ decimals= DATETIME_DEC;
collation.set(&my_charset_bin);
store_now_in_TIME(&ltime);
@@ -1680,7 +1680,7 @@ void Item_func_from_unixtime::fix_length_and_dec()
{
thd= current_thd;
collation.set(&my_charset_bin);
- decimals=0;
+ decimals= DATETIME_DEC;
max_length=MAX_DATETIME_WIDTH*MY_CHARSET_BIN_MB_MAXLEN;
maybe_null= 1;
thd->time_zone_used= 1;