mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
fixed cleanup of result object of subqueries. (BUG#8125)
This commit is contained in:
@ -2196,3 +2196,15 @@ ERROR 42S22: Reference 'xx' not supported (forward reference in item list)
|
|||||||
select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx from DUAL;
|
select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx from DUAL;
|
||||||
ERROR 42S22: Reference 'xx' not supported (forward reference in item list)
|
ERROR 42S22: Reference 'xx' not supported (forward reference in item list)
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
CREATE TABLE `t1` ( `a` char(3) NOT NULL default '', `b` char(3) NOT NULL default '', `c` char(3) NOT NULL default '', PRIMARY KEY (`a`,`b`,`c`)) ENGINE=InnoDB;
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
INSERT INTO t1 VALUES (1,1,1);
|
||||||
|
INSERT INTO t2 VALUES (1,1,1);
|
||||||
|
PREPARE my_stmt FROM "SELECT t1.b, count(*) FROM t1 group by t1.b having
|
||||||
|
count(*) > ALL (SELECT COUNT(*) FROM t2 WHERE t2.a=1 GROUP By t2.b)";
|
||||||
|
EXECUTE my_stmt;
|
||||||
|
b count(*)
|
||||||
|
EXECUTE my_stmt;
|
||||||
|
b count(*)
|
||||||
|
deallocate prepare my_stmt;
|
||||||
|
drop table t1,t2;
|
||||||
|
@ -1465,3 +1465,17 @@ select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx;
|
|||||||
-- error 1247
|
-- error 1247
|
||||||
select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx from DUAL;
|
select 1 = ALL (select 1 from t1 where 1 = xx ), 1 as xx from DUAL;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
#
|
||||||
|
# cleaning up of results of subselects (BUG#8125)
|
||||||
|
#
|
||||||
|
CREATE TABLE `t1` ( `a` char(3) NOT NULL default '', `b` char(3) NOT NULL default '', `c` char(3) NOT NULL default '', PRIMARY KEY (`a`,`b`,`c`)) ENGINE=InnoDB;
|
||||||
|
CREATE TABLE t2 LIKE t1;
|
||||||
|
INSERT INTO t1 VALUES (1,1,1);
|
||||||
|
INSERT INTO t2 VALUES (1,1,1);
|
||||||
|
PREPARE my_stmt FROM "SELECT t1.b, count(*) FROM t1 group by t1.b having
|
||||||
|
count(*) > ALL (SELECT COUNT(*) FROM t2 WHERE t2.a=1 GROUP By t2.b)";
|
||||||
|
EXECUTE my_stmt;
|
||||||
|
EXECUTE my_stmt;
|
||||||
|
deallocate prepare my_stmt;
|
||||||
|
drop table t1,t2;
|
||||||
|
@ -1127,6 +1127,7 @@ void subselect_single_select_engine::cleanup()
|
|||||||
DBUG_ENTER("subselect_single_select_engine::cleanup");
|
DBUG_ENTER("subselect_single_select_engine::cleanup");
|
||||||
prepared= optimized= executed= 0;
|
prepared= optimized= executed= 0;
|
||||||
join= 0;
|
join= 0;
|
||||||
|
result->cleanup();
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1135,6 +1136,7 @@ void subselect_union_engine::cleanup()
|
|||||||
{
|
{
|
||||||
DBUG_ENTER("subselect_union_engine::cleanup");
|
DBUG_ENTER("subselect_union_engine::cleanup");
|
||||||
unit->reinit_exec_mechanism();
|
unit->reinit_exec_mechanism();
|
||||||
|
result->cleanup();
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1142,6 +1144,10 @@ void subselect_union_engine::cleanup()
|
|||||||
void subselect_uniquesubquery_engine::cleanup()
|
void subselect_uniquesubquery_engine::cleanup()
|
||||||
{
|
{
|
||||||
DBUG_ENTER("subselect_uniquesubquery_engine::cleanup");
|
DBUG_ENTER("subselect_uniquesubquery_engine::cleanup");
|
||||||
|
/*
|
||||||
|
subselect_uniquesubquery_engine have not 'result' assigbed, so we do not
|
||||||
|
cleanup() it
|
||||||
|
*/
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1240,6 +1240,14 @@ bool select_singlerow_subselect::send_data(List<Item> &items)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void select_max_min_finder_subselect::cleanup()
|
||||||
|
{
|
||||||
|
DBUG_ENTER("select_max_min_finder_subselect::cleanup");
|
||||||
|
cache= 0;
|
||||||
|
DBUG_VOID_RETURN;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool select_max_min_finder_subselect::send_data(List<Item> &items)
|
bool select_max_min_finder_subselect::send_data(List<Item> &items)
|
||||||
{
|
{
|
||||||
DBUG_ENTER("select_max_min_finder_subselect::send_data");
|
DBUG_ENTER("select_max_min_finder_subselect::send_data");
|
||||||
|
@ -1381,6 +1381,7 @@ public:
|
|||||||
select_max_min_finder_subselect(Item_subselect *item, bool mx)
|
select_max_min_finder_subselect(Item_subselect *item, bool mx)
|
||||||
:select_subselect(item), cache(0), fmax(mx)
|
:select_subselect(item), cache(0), fmax(mx)
|
||||||
{}
|
{}
|
||||||
|
void cleanup();
|
||||||
bool send_data(List<Item> &items);
|
bool send_data(List<Item> &items);
|
||||||
bool cmp_real();
|
bool cmp_real();
|
||||||
bool cmp_int();
|
bool cmp_int();
|
||||||
|
Reference in New Issue
Block a user