summaryrefslogtreecommitdiff
path: root/sql/item_subselect.cc
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2003-01-28 14:48:12 +0200
committerunknown <bell@sanja.is.com.ua>2003-01-28 14:48:12 +0200
commitca0d06d599c7e174927a75720974dc457968be23 (patch)
tree627ebfbd22d44074e53cd22c32b38bd9aee3f9c3 /sql/item_subselect.cc
parent42ba47184c0394b682d4873d5bea4d31e2438b6a (diff)
downloadmariadb-git-ca0d06d599c7e174927a75720974dc457968be23.tar.gz
fixed bugs in temporary tables in subselect implementation (SCRUM)
merging with switching on static tables optimization (SCRUM) fixed subselects with uncacheable results added test for fixed bugs from bugreports mysql-test/r/subselect.result: changes in subselect test after switching on static tables optimization fixed bug test added uncacheable subselects mysql-test/t/subselect.test: changes in subselect test after switching on static tables optimization fixed bug test added uncacheable subselects sql/item_create.cc: fixed subselects with uncacheable results sql/item_func.cc: fixed subselects with uncacheable results sql/item_subselect.cc: fixed subselects with uncacheable results clean up sql/item_subselect.h: fixed subselects with uncacheable results sql/sql_lex.cc: fixed subselects with uncacheable results sql/sql_lex.h: fixed subselects with uncacheable results sql/sql_select.cc: fixed bugs in temporary tables in subselect implementation fixed subselects with uncacheable results sql/sql_union.cc: fixed subselects with uncacheable results sql/sql_yacc.yy: fixed subselects with uncacheable results
Diffstat (limited to 'sql/item_subselect.cc')
-rw-r--r--sql/item_subselect.cc23
1 files changed, 15 insertions, 8 deletions
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index 18a32b97a9f..ffb4d715159 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -129,7 +129,8 @@ void Item_subselect::fix_length_and_dec()
inline table_map Item_subselect::used_tables() const
{
- return (table_map) engine->depended() ? 1L : 0L;
+ return (table_map) (engine->dependent() ? 1L :
+ (engine->uncacheable() ? RAND_TABLE_BIT : 0L));
}
Item_singlerow_subselect::Item_singlerow_subselect(THD *thd,
@@ -795,7 +796,7 @@ int subselect_single_select_engine::exec()
DBUG_RETURN(join->error?join->error:1);
}
}
- if (select_lex->dependent && executed)
+ if ((select_lex->dependent || select_lex->uncacheable) && executed)
{
if (join->reinit())
{
@@ -837,16 +838,26 @@ uint subselect_union_engine::cols()
return unit->first_select()->item_list.elements;
}
-bool subselect_single_select_engine::depended()
+bool subselect_single_select_engine::dependent()
{
return select_lex->dependent;
}
-bool subselect_union_engine::depended()
+bool subselect_union_engine::dependent()
{
return unit->dependent;
}
+bool subselect_single_select_engine::uncacheable()
+{
+ return select_lex->uncacheable;
+}
+
+bool subselect_union_engine::uncacheable()
+{
+ return unit->uncacheable;
+}
+
bool subselect_single_select_engine::check_loop(uint id)
{
DBUG_ENTER("subselect_single_select_engine::check_loop");
@@ -865,13 +876,9 @@ bool subselect_union_engine::check_loop(uint id)
void subselect_single_select_engine::exclude()
{
select_lex->master_unit()->exclude_level();
- //if (current_thd->lex->describe)
}
void subselect_union_engine::exclude()
{
unit->exclude_level();
- // for (SELECT_LEX *sl= unit->first_select(); sl; sl= sl->next_select())
- // if (sl->join && sl->join->check_loop(id))
- // DBUG_RETURN(1);
}