summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.cc
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2004-07-04 10:40:24 +0300
committerunknown <bell@sanja.is.com.ua>2004-07-04 10:40:24 +0300
commitad165ad183213234e7ec29351abac79c087fb981 (patch)
tree506b5b689f8566999d52b45e68e8bc8849799e67 /sql/item_cmpfunc.cc
parentd760bfd6b01e6d73719cd2198ba7b3a9b694a284 (diff)
downloadmariadb-git-ad165ad183213234e7ec29351abac79c087fb981.tar.gz
do not assign values of left expression of IN/ANN/ANY subquery in case of PS preparation (BUG#4403)
mysql-test/r/ps_2myisam.result: changes in results of select without order by mysql-test/r/ps_3innodb.result: changes in results of select without order by mysql-test/r/ps_5merge.result: changes in results of select without order by mysql-test/r/ps_6bdb.result: changes in results of select without order by sql/item_cmpfunc.cc: do not assign values of left expression of IN/ANN/ANY subquery in case of PS preparation
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r--sql/item_cmpfunc.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 91257c31fb9..60f80249e94 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -483,7 +483,14 @@ bool Item_in_optimizer::fix_left(THD *thd,
return 1;
cache->setup(args[0]);
- cache->store(args[0]);
+ /*
+ If it is preparation PS only then we do not know values of parameters =>
+ cant't get there values and do not need that values.
+
+ TODO: during merge with 5.0 it should be changed on !thd->only_prepare()
+ */
+ if (!thd->current_statement)
+ cache->store(args[0]);
if (cache->cols() == 1)
{
if ((used_tables_cache= args[0]->used_tables()))