summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.cc
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2003-03-11 12:43:30 +0200
committerunknown <bell@sanja.is.com.ua>2003-03-11 12:43:30 +0200
commit79a6e9dcda812157a56dc6abddee918ffb4a9755 (patch)
tree934bb3676530d387979a10d4ee3c0dcda89c64c0 /sql/item_cmpfunc.cc
parentfc5832de0838d3d1c0e596c11e30077f372ffc6c (diff)
downloadmariadb-git-79a6e9dcda812157a56dc6abddee918ffb4a9755.tar.gz
fixed cached constsnt determination (bug #142 related)
mysql-test/r/subselect.result: test of constant redecing mysql-test/t/subselect.test: test of constant redecing sql/item_cmpfunc.cc: fixed cached constsnt determination
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r--sql/item_cmpfunc.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index ec3c7f22556..c4197beffbf 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -298,12 +298,22 @@ bool Item_in_optimizer::fix_fields(THD *thd, struct st_table_list *tables,
return 1;
cache->setup(args[0]);
if (cache->cols() == 1)
- cache->set_used_tables(RAND_TABLE_BIT);
+ {
+ if (args[0]->used_tables())
+ cache->set_used_tables(RAND_TABLE_BIT);
+ else
+ cache->set_used_tables(0);
+ }
else
{
uint n= cache->cols();
for (uint i= 0; i < n; i++)
- ((Item_cache *)cache->el(i))->set_used_tables(RAND_TABLE_BIT);
+ {
+ if (args[0]->el(i)->used_tables())
+ ((Item_cache *)cache->el(i))->set_used_tables(RAND_TABLE_BIT);
+ else
+ ((Item_cache *)cache->el(i))->set_used_tables(0);
+ }
}
if (args[1]->fix_fields(thd, tables, args))
return 1;