MDEV-241 lp:992722 - Server crashes in get_datetime_value
Create an Item_cache based on item's cmp_type, not result_type in subselect_engine. Use result_field in Item_cache_temporal::cache_value(), just like all other Item_cache*::cache_value() do.
This commit is contained in:
parent
6920491587
commit
beec2a2b1d
5
mysql-test/r/in_datetime_241.result
Normal file
5
mysql-test/r/in_datetime_241.result
Normal file
@ -0,0 +1,5 @@
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1 ( a DATE );
|
||||
SELECT * FROM t1 WHERE ( SELECT a FROM t1 ) IN ('2012-04-25','2012-04-26');
|
||||
a
|
||||
DROP TABLE t1;
|
9
mysql-test/t/in_datetime_241.test
Normal file
9
mysql-test/t/in_datetime_241.test
Normal file
@ -0,0 +1,9 @@
|
||||
#
|
||||
# MDEV-241 lp:992722 - Server crashes in get_datetime_value
|
||||
#
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
CREATE TABLE t1 ( a DATE );
|
||||
SELECT * FROM t1 WHERE ( SELECT a FROM t1 ) IN ('2012-04-25','2012-04-26');
|
||||
DROP TABLE t1;
|
@ -8329,7 +8329,7 @@ bool Item_cache_temporal::cache_value()
|
||||
value_cached= true;
|
||||
|
||||
MYSQL_TIME ltime;
|
||||
if (example->get_date(<ime, TIME_FUZZY_DATE))
|
||||
if (example->get_date_result(<ime, TIME_FUZZY_DATE))
|
||||
value=0;
|
||||
else
|
||||
value= pack_time(<ime);
|
||||
|
@ -2893,7 +2893,7 @@ void subselect_engine::set_row(List<Item> &item_list, Item_cache **row)
|
||||
item->decimals= sel_item->decimals;
|
||||
item->unsigned_flag= sel_item->unsigned_flag;
|
||||
maybe_null= sel_item->maybe_null;
|
||||
if (!(row[i]= Item_cache::get_cache(sel_item)))
|
||||
if (!(row[i]= Item_cache::get_cache(sel_item, sel_item->cmp_type())))
|
||||
return;
|
||||
row[i]->setup(sel_item);
|
||||
//psergey-backport-timours: row[i]->store(sel_item);
|
||||
|
Loading…
x
Reference in New Issue
Block a user