Browse Source

lp:737474 Wrong result with DAY(COALESCE(NULL)) in 5.1-micro

fix the return value of Item_func_coalesce::get_date()
pull/374/head
Sergei Golubchik 15 years ago
parent
commit
c629477981
  1. 3
      mysql-test/r/func_time.result
  2. 5
      mysql-test/t/func_time.test
  3. 2
      sql/item_cmpfunc.cc

3
mysql-test/r/func_time.result

@ -1533,3 +1533,6 @@ select least(greatest(f3, f2, f4), f5) from t1;
least(greatest(f3, f2, f4), f5)
0000-00-00 00:00:00
drop table t1;
select day(coalesce(null));
day(coalesce(null))
NULL

5
mysql-test/t/func_time.test

@ -968,3 +968,8 @@ insert ignore t1 values ('04:38:11','0000-00-00 00:00:00',0,'0000-00-00 00:00:00
select least(greatest(f3, f2, f4), f5) from t1;
drop table t1;
#
# lp:737474 Wrong result with DAY(COALESCE(NULL)) in 5.1-micro
#
select day(coalesce(null));

2
sql/item_cmpfunc.cc

@ -2917,7 +2917,7 @@ bool Item_func_coalesce::get_date(MYSQL_TIME *ltime,uint fuzzydate)
return res;
}
null_value=1;
return 0;
return 1;
}

Loading…
Cancel
Save