summaryrefslogtreecommitdiff
path: root/sql/item_subselect.cc
diff options
context:
space:
mode:
authorunknown <konstantin@mysql.com>2005-05-30 20:56:11 +0400
committerunknown <konstantin@mysql.com>2005-05-30 20:56:11 +0400
commit5cdac9906945bbe7e7bc459c7e042568574102ab (patch)
tree4ed95e1092af1922457a7c10ddee5b8e88ecc9e8 /sql/item_subselect.cc
parent1c7b61e3aef5227165a9957ead000e67935708b2 (diff)
parent78422442df581b736862bd090ab3c18d92e7d324 (diff)
downloadmariadb-git-5cdac9906945bbe7e7bc459c7e042568574102ab.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/opt/local/work/mysql-5.0-7306-new sql/item_subselect.cc: Auto merged sql/mysql_priv.h: Auto merged sql/opt_range.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_insert.cc: Auto merged sql/sql_lex.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_olap.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_select.cc: Auto merged
Diffstat (limited to 'sql/item_subselect.cc')
-rw-r--r--sql/item_subselect.cc21
1 files changed, 9 insertions, 12 deletions
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc
index 29c52e73159..43af7df44e6 100644
--- a/sql/item_subselect.cc
+++ b/sql/item_subselect.cc
@@ -537,8 +537,6 @@ Item_exists_subselect::Item_exists_subselect(st_select_lex *select_lex):
null_value= 0; //can't be NULL
maybe_null= 0; //can't be NULL
value= 0;
- // We need only 1 row to determinate existence
- select_lex->master_unit()->global_parameters->select_limit= 1;
DBUG_VOID_RETURN;
}
@@ -605,6 +603,8 @@ void Item_exists_subselect::fix_length_and_dec()
decimals= 0;
max_length= 1;
max_columns= engine->cols();
+ /* We need only 1 row to determinate existence */
+ unit->global_parameters->select_limit= 1;
}
double Item_exists_subselect::val_real()
@@ -854,9 +854,6 @@ Item_in_subselect::single_value_transformer(JOIN *join,
else
{
Item_maxmin_subselect *item;
- // remove LIMIT placed by ALL/ANY subquery
- select_lex->master_unit()->global_parameters->select_limit=
- HA_POS_ERROR;
subs= item= new Item_maxmin_subselect(thd, this, select_lex, func->l_op());
if (upper_item)
upper_item->set_sub_test(item);
@@ -1286,13 +1283,10 @@ subselect_single_select_engine(st_select_lex *select,
select_subselect *result,
Item_subselect *item)
:subselect_engine(item, result),
- prepared(0), optimized(0), executed(0), join(0)
+ prepared(0), optimized(0), executed(0),
+ select_lex(select), join(0)
{
- select_lex= select;
- SELECT_LEX_UNIT *unit= select_lex->master_unit();
- unit->set_limit(unit->global_parameters, select_lex);
- unit->item= item;
- this->select_lex= select_lex;
+ select_lex->master_unit()->item= item;
}
@@ -1440,7 +1434,10 @@ int subselect_single_select_engine::exec()
thd->lex->current_select= select_lex;
if (!optimized)
{
- optimized=1;
+ SELECT_LEX_UNIT *unit= select_lex->master_unit();
+
+ optimized= 1;
+ unit->set_limit(unit->global_parameters);
if (join->optimize())
{
thd->where= save_where;