summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.cc
diff options
context:
space:
mode:
authorTor Didriksen <tor.didriksen@oracle.com>2011-02-17 13:41:25 +0100
committerTor Didriksen <tor.didriksen@oracle.com>2011-02-17 13:41:25 +0100
commit8176dec7538c2a61331f6e587b894cba6eb2bc2f (patch)
tree66c02ad2e4665759358f1567cfa8391a67d27c53 /sql/item_cmpfunc.cc
parent557b9459a8381d4cf52f25abbd32a8a24b415c41 (diff)
downloadmariadb-git-8176dec7538c2a61331f6e587b894cba6eb2bc2f.tar.gz
Bug #11766860 - 60085: CRASH IN ITEM::SAVE_IN_FIELD() WITH TIME DATA TYPE
This assumption in Item_cache_datetime::cache_value_int was wrong: - /* Assume here that the underlying item will do correct conversion.*/ - int_value= example->val_int_result(); mysql-test/r/subselect_innodb.result: New test case. mysql-test/t/subselect_innodb.test: New test case. sql/item.cc: In Item_cache_datetime::cache_value_int() - call get_time() or get_date() depending on desired type - convert the returned MYSQL_TIME value to longlong depending on desired type sql/item.h: The cached int_value in Item_cache_datetime should not be unsigned: - it is used mostly in signed context - it can actually have negative value (for TIME data type) sql/item_cmpfunc.cc: Add comment on Bug#59685 sql/item_subselect.cc: Add some DBUG_TRACE for easier bug-hunting.
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r--sql/item_cmpfunc.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 6be1d09323d..9586004c630 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -403,6 +403,7 @@ static bool convert_constant_item(THD *thd, Item_field *field_item,
Field *field= field_item->field;
int result= 0;
+ // TODO: revert Bug#59685 here, as we now cache datetimes correctly.
if (!(*item)->with_subselect && (*item)->const_item())
{
TABLE *table= field->table;