mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 20:12:31 +01:00
fixed optimized SOME subquery
mysql-test/r/subselect.result: correct results of SOME subquery sql/item_cmpfunc.cc: some comments added fixed optimized SOME subquery
This commit is contained in:
parent
3ce0df5937
commit
a9457c573d
2 changed files with 4 additions and 10 deletions
|
@ -1490,9 +1490,6 @@ Warnings:
|
|||
Note 1003 select test.t3.a AS `a` from test.t3 where <not>((test.t3.a < (select max(test.t2.b) from test.t2)))
|
||||
select * from t3 where a >= some (select b from t2);
|
||||
a
|
||||
6
|
||||
7
|
||||
3
|
||||
explain extended select * from t3 where a >= some (select b from t2);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where
|
||||
|
@ -1512,9 +1509,6 @@ Warnings:
|
|||
Note 1003 select test.t3.a AS `a` from test.t3 where <not>((test.t3.a < <max>(select test.t2.b AS `b` from test.t2 group by test.t2.b)))
|
||||
select * from t3 where a >= some (select b from t2 group by 1);
|
||||
a
|
||||
6
|
||||
7
|
||||
3
|
||||
explain extended select * from t3 where a >= some (select b from t2 group by 1);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where
|
||||
|
|
|
@ -120,7 +120,7 @@ longlong Item_func_not_all::val_int()
|
|||
|
||||
/*
|
||||
return TRUE if there was records in underlaying select in max/min
|
||||
optimisation
|
||||
optimisation (ALL subquery)
|
||||
*/
|
||||
if (empty_underlying_subquery())
|
||||
return 1;
|
||||
|
@ -157,11 +157,11 @@ longlong Item_func_nop_all::val_int()
|
|||
double value= args[0]->val();
|
||||
|
||||
/*
|
||||
return TRUE if there was records in underlaying select in max/min
|
||||
optimisation
|
||||
return FALSE if there was records in underlaying select in max/min
|
||||
optimisation (SAME/ANY subquery)
|
||||
*/
|
||||
if (empty_underlying_subquery())
|
||||
return 1;
|
||||
return 0;
|
||||
|
||||
null_value= args[0]->null_value;
|
||||
return (null_value || value == 0) ? 0 : 1;
|
||||
|
|
Loading…
Reference in a new issue