summaryrefslogtreecommitdiff
path: root/sql/item_subselect.cc
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2003-10-23 20:50:53 +0300
committerunknown <bell@sanja.is.com.ua>2003-10-23 20:50:53 +0300
commitd3d001fd022ca69ba2310dce4c932fcea2b330a8 (patch)
tree3d9a27d3a8298630430123ea697a0b73425e3347 /sql/item_subselect.cc
parente4b7aaac474885a1520946c6e3dc454cefcb3a56 (diff)
downloadmariadb-git-d3d001fd022ca69ba2310dce4c932fcea2b330a8.tar.gz
ufter review fix (BUG#1444)
sql/item.cc: used variable to avoid using prev_unit->item which should be more clean sql/item_subselect.cc: uncachable tested on fix fields and correct bits set
Diffstat (limited to 'sql/item_subselect.cc')
-rw-r--r--sql/item_subselect.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index 4ad49ebec74..704681dd511 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -112,6 +112,11 @@ bool Item_subselect::fix_fields(THD *thd_param, TABLE_LIST *tables, Item **ref)
}
fix_length_and_dec();
}
+ if (engine->uncacheable())
+ {
+ const_item_cache= 0;
+ used_tables_cache|= RAND_TABLE_BIT;
+ }
fixed= 1;
thd->where= save_where;
return res;
@@ -149,13 +154,12 @@ void Item_subselect::fix_length_and_dec()
table_map Item_subselect::used_tables() const
{
- return (table_map) (engine->dependent() ? used_tables_cache :
- (engine->uncacheable() ? RAND_TABLE_BIT : 0L));
+ return (table_map) (engine->dependent() ? used_tables_cache : 0L);
}
bool Item_subselect::const_item() const
{
- return engine->uncacheable()? 0 : const_item_cache;
+ return const_item_cache;
}
void Item_subselect::update_used_tables()
@@ -163,7 +167,7 @@ void Item_subselect::update_used_tables()
if (!engine->uncacheable())
{
// did all used tables become ststic?
- if ((used_tables_cache & ~engine->upper_select_const_tables()) == 0)
+ if ((used_tables_cache & ~engine->upper_select_const_tables()))
const_item_cache= 1;
}
}