diff options
author | Alexander Barkov <alexander.barkov@oracle.com> | 2012-01-12 13:02:51 +0400 |
---|---|---|
committer | Alexander Barkov <alexander.barkov@oracle.com> | 2012-01-12 13:02:51 +0400 |
commit | cbee6f82b91af228f719e601b86492abc0ebbc6d (patch) | |
tree | e730d8a3f92a6758729971a6df7bf357592611fc /sql/item.cc | |
parent | 87f6756fdb7790f75271293c0b145a02fee5b8b2 (diff) | |
download | mariadb-git-cbee6f82b91af228f719e601b86492abc0ebbc6d.tar.gz |
BUG#13354387 - CRASH IN IN MY_DECIMAL::OPERATOR FOR VIEW AND FUNCTION UNIX_TIME
Fixing the 5.5 part (the 5.6 part will go in a separate commit soon).
Problem:
Item_direct_ref::get_date() incorrectly calculated its "null_value",
which made UNIX_TIMESTAMP(view_column) incorrectly return NULL
for a NOT NULL view_column.
Fix:
Make Item_direct_ref::get_date() calculate null_value
in the similar way with the other methods
(val_real,val_str,val_int,val_decimal):
copy null_value from the referenced Item.
modified:
mysql-test/r/func_time.result
mysql-test/t/func_time.test
sql/item.cc
Diffstat (limited to 'sql/item.cc')
-rw-r--r-- | sql/item.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/item.cc b/sql/item.cc index c8c68a3924b..edb4dc60277 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -6812,7 +6812,9 @@ bool Item_direct_ref::is_null() bool Item_direct_ref::get_date(MYSQL_TIME *ltime,uint fuzzydate) { - return (null_value=(*ref)->get_date(ltime,fuzzydate)); + bool tmp= (*ref)->get_date(ltime, fuzzydate); + null_value= (*ref)->null_value; + return tmp; } |