summaryrefslogtreecommitdiff
path: root/sql/sql_union.cc
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2003-12-10 22:46:14 +0200
committerunknown <bell@sanja.is.com.ua>2003-12-10 22:46:14 +0200
commitfc75518a78af9dfb68baac2cbf279983fe54b492 (patch)
treeae06b7876934d32768f586a08de67e43088d1fad /sql/sql_union.cc
parente0daf11201dd6e81af73c1c74270039e73845a24 (diff)
downloadmariadb-git-fc75518a78af9dfb68baac2cbf279983fe54b492.tar.gz
fixed unlocking tables during subquery execution (BUG#2048)
mysql-test/r/subselect_innodb.result: bug 2048 test mysql-test/t/subselect_innodb.test: bug 2048 test sql/item_subselect.cc: do not unlock tables for subqueries sql/sql_derived.cc: derived table tables can be unlocked sql/sql_lex.h: new interface to pass additional options sql/sql_union.cc: new interface to pass additional options do not unlock tables for UNION
Diffstat (limited to 'sql/sql_union.cc')
-rw-r--r--sql/sql_union.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index f2470a59944..435354cb4ad 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -29,7 +29,7 @@ int mysql_union(THD *thd, LEX *lex, select_result *result,
{
DBUG_ENTER("mysql_union");
int res= 0;
- if (!(res= unit->prepare(thd, result)))
+ if (!(res= unit->prepare(thd, result, SELECT_NO_UNLOCK)))
res= unit->exec();
res|= unit->cleanup();
DBUG_RETURN(res);
@@ -106,7 +106,8 @@ bool select_union::flush()
}
-int st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result)
+int st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result,
+ ulong additional_options)
{
SELECT_LEX *lex_select_save= thd_arg->lex.current_select;
SELECT_LEX *sl, *first_select;
@@ -146,7 +147,7 @@ int st_select_lex_unit::prepare(THD *thd_arg, select_result *sel_result)
for (;sl; sl= sl->next_select())
{
JOIN *join= new JOIN(thd_arg, sl->item_list,
- sl->options | thd_arg->options | SELECT_NO_UNLOCK,
+ sl->options | thd_arg->options | additional_options,
tmp_result);
thd_arg->lex.current_select= sl;
offset_limit_cnt= sl->offset_limit;