summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <holyfoot/hf@mysql.com/deer.(none)>2006-12-03 21:49:26 +0400
committerunknown <holyfoot/hf@mysql.com/deer.(none)>2006-12-03 21:49:26 +0400
commite8b32b2b01e28926867d12ca3c0f8dc33690db5b (patch)
tree1fe0b04832085349d1ce22fb2c57b14e2a013a5a /sql
parent7fe3f31345313d8580d1b5e976fcfed67160e06a (diff)
downloadmariadb-git-e8b32b2b01e28926867d12ca3c0f8dc33690db5b.tar.gz
bug #20835 (Subqueries: literal string with =any fails)
We create Item_cache_* object for each operand for each left operand of a subquery predicate. We also create Item_func_conv_charset for each string constant that needs charset conversion. So here we have Item_cache wrapped into Item_func_conv_charset. When Item_func_conv_charset wraps an constant Item it gets it's value in constructor. The problem is that Item_cache is ready to be used only at execution time, which is too late. The fix makes Item_cache wrapping constant to get ready at fix_fields() time. mysql-test/r/subselect.result: test result mysql-test/t/subselect.test: test case sql/item_cmpfunc.cc: now Item_optimizer::fix_left will store constant arguments in cache on fix_fields() stage
Diffstat (limited to 'sql')
-rw-r--r--sql/item_cmpfunc.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 02e94d31f02..8d4b58f05a1 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -797,7 +797,8 @@ bool Item_in_optimizer::fix_left(THD *thd, Item **ref)
}
not_null_tables_cache= args[0]->not_null_tables();
with_sum_func= args[0]->with_sum_func;
- const_item_cache= args[0]->const_item();
+ if ((const_item_cache= args[0]->const_item()))
+ cache->store(args[0]);
return 0;
}