diff options
author | bell@sanja.is.com.ua <> | 2003-10-23 23:54:21 +0300 |
---|---|---|
committer | bell@sanja.is.com.ua <> | 2003-10-23 23:54:21 +0300 |
commit | 6457b89948c034aa7a65407555d2db73e9ab56fb (patch) | |
tree | dc867042337941940eb2f9556dac44abd3606799 /sql/item_subselect.cc | |
parent | 5fb30467ee289a2fef03bb3d0df66810e70336de (diff) | |
download | mariadb-git-6457b89948c034aa7a65407555d2db73e9ab56fb.tar.gz |
added check of cardinality to IN/ALL/ANY subquery transformer
(BUG#1638)
Diffstat (limited to 'sql/item_subselect.cc')
-rw-r--r-- | sql/item_subselect.cc | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 704681dd511..6ac191af267 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -514,6 +514,12 @@ Item_in_subselect::single_value_transformer(JOIN *join, THD *thd= join->thd; thd->where= "scalar IN/ALL/ANY subquery"; + if (select_lex->item_list.elements > 1) + { + my_error(ER_OPERAND_COLUMNS, MYF(0), 1); + DBUG_RETURN(RES_ERROR); + } + if ((abort_on_null || (upper_not && upper_not->top_level())) && !select_lex->master_unit()->dependent && (func == &Item_bool_func2::gt_creator || @@ -606,11 +612,6 @@ Item_in_subselect::single_value_transformer(JOIN *join, select_lex->dependent= 1; Item *item; - if (select_lex->item_list.elements > 1) - { - my_error(ER_OPERAND_COLUMNS, MYF(0), 1); - DBUG_RETURN(RES_ERROR); - } item= (Item*) select_lex->item_list.head(); @@ -710,6 +711,12 @@ Item_in_subselect::row_value_transformer(JOIN *join, SELECT_LEX *select_lex= join->select_lex; + if (select_lex->item_list.elements != left_expr->cols()) + { + my_error(ER_OPERAND_COLUMNS, MYF(0), left_expr->cols()); + DBUG_RETURN(RES_ERROR); + } + if (!substitution) { //first call for this unit |