1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

fixed column number fetchinmg for subqueries. (BUG#8020)

fixed cols() method call (it have to be called only after fix_fields())


mysql-test/r/subselect.result:
  Comparison subquery with * and row
mysql-test/t/subselect.test:
  Comparison subquery with * and row
sql/item_cmpfunc.h:
  initialization allowed_arg_cols for autodetection
sql/item_func.cc:
  support of allowed_arg_cols autodetection by first argument
sql/item_func.h:
  commant
sql/item_subselect.cc:
  correct column number fetching for subqueries
sql/sql_lex.h:
  method to check that UNION is prepared
This commit is contained in:
unknown
2005-01-24 14:25:44 +02:00
parent 1850f74925
commit d514a06a86
7 changed files with 59 additions and 7 deletions

View File

@ -1414,8 +1414,11 @@ SELECT f1 FROM t1
WHERE f1 <> ALL ( SELECT SUM(f1) AS sf1 FROM t2 HAVING sf1 > 10000);
drop table t1,t2;
#
# Test for BUG#7885: Server crash when 'any' subselect compared to
# non-existant field.
#
create table t1 (a1 int);
create table t2 (b1 int);
--error 1054
@ -1423,3 +1426,14 @@ select * from t1 where a2 > any(select b1 from t2);
select * from t1 where a1 > any(select b1 from t2);
drop table t1,t2;
#
# Comparison subquery with * and row
#
create table t1 (a integer, b integer);
select (select * from t1) = (select 1,2);
select (select 1,2) = (select * from t1);
# queries whih can be converted to IN
select row(1,2) = ANY (select * from t1);
select row(1,2) != ALL (select * from t1);
drop table t1;