diff options
author | unknown <evgen@moonbone.local> | 2007-07-20 00:06:35 +0400 |
---|---|---|
committer | unknown <evgen@moonbone.local> | 2007-07-20 00:06:35 +0400 |
commit | a131428f041cd015662240bde255d159bcc53af7 (patch) | |
tree | c289f957a8353fed4b3b04d0291bdd114445733c /sql/item_timefunc.cc | |
parent | d0020607b324cb9e5c3f930315a4fb0c4a65239b (diff) | |
download | mariadb-git-a131428f041cd015662240bde255d159bcc53af7.tar.gz |
Bug#29898: Item_date_typecast::val_int doesn't reset the null_value flag.
The Item_date_typecast::val_int function doesn't reset null_value flag.
This makes all values that follows the first null value to be treated as nulls
and led to a wrong result.
Now the Item_date_typecast::val_int function correctly sets the null_value flag
for both null and non-null values.
mysql-test/t/cast.test:
Added a test case for the bug#29898: Item_date_typecast::val_int doesn't reset
the null_value flag.
mysql-test/r/cast.result:
Added a test case for the bug#29898: Item_date_typecast::val_int doesn't reset
the null_value flag.
sql/item_timefunc.cc:
Bug#29898: Item_date_typecast::val_int doesn't reset the null_value flag.
Now the Item_date_typecast::val_int function correctly sets the null_value flag
for both null and non-null values.
Diffstat (limited to 'sql/item_timefunc.cc')
-rw-r--r-- | sql/item_timefunc.cc | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc index 9795ec5f413..873e2833a1e 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -2662,11 +2662,8 @@ longlong Item_date_typecast::val_int() { DBUG_ASSERT(fixed == 1); MYSQL_TIME ltime; - if (args[0]->get_date(<ime, TIME_FUZZY_DATE)) - { - null_value= 1; + if ((null_value= args[0]->get_date(<ime, TIME_FUZZY_DATE))) return 0; - } return (longlong) (ltime.year * 10000L + ltime.month * 100 + ltime.day); } |