mirror of
https://github.com/MariaDB/server.git
synced 2026-05-07 15:45:33 +02:00
merge 5.3->5.5
This commit is contained in:
commit
60ea100b03
3 changed files with 57 additions and 5 deletions
|
|
@ -417,6 +417,29 @@ MIN(i)
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
# End of 5.0 tests
|
# End of 5.0 tests
|
||||||
#
|
#
|
||||||
|
# MDEV-5005: Subquery in Procedure somehow affecting temporary table
|
||||||
|
#
|
||||||
|
create temporary table if not exists t1 (id int not null);
|
||||||
|
select A.* from ( select tt.* from t1 tt ) A;
|
||||||
|
id
|
||||||
|
prepare stmt from "select A.* from ( select tt.* from t1 tt ) A ";
|
||||||
|
execute stmt;
|
||||||
|
id
|
||||||
|
deallocate prepare stmt;
|
||||||
|
drop temporary table t1;
|
||||||
|
CREATE PROCEDURE p ()
|
||||||
|
BEGIN
|
||||||
|
select A.* from ( select tt.* from t1 tt ) A ;
|
||||||
|
END |
|
||||||
|
create temporary table if not exists t1 (id int not null);
|
||||||
|
CALL p();
|
||||||
|
id
|
||||||
|
CALL p();
|
||||||
|
id
|
||||||
|
drop procedure p;
|
||||||
|
drop temporary table t1;
|
||||||
|
# End of 5.3 tests
|
||||||
|
#
|
||||||
# Bug#58730 Assertion failed: table->key_read == 0 in close_thread_table,
|
# Bug#58730 Assertion failed: table->key_read == 0 in close_thread_table,
|
||||||
# temptable views
|
# temptable views
|
||||||
#
|
#
|
||||||
|
|
@ -440,7 +463,6 @@ SELECT 1 FROM t1 JOIN v1 ON 1 > (SELECT 1 FROM v2);
|
||||||
ERROR 21000: Subquery returns more than 1 row
|
ERROR 21000: Subquery returns more than 1 row
|
||||||
DROP TABLE t1, t2;
|
DROP TABLE t1, t2;
|
||||||
DROP VIEW v1, v2;
|
DROP VIEW v1, v2;
|
||||||
set optimizer_switch=@save_derived_optimizer_switch;
|
|
||||||
create table t1 (n bigint(20) unsigned, d1 datetime, d2 datetime, key (d1));
|
create table t1 (n bigint(20) unsigned, d1 datetime, d2 datetime, key (d1));
|
||||||
insert t1 values (2085,'2012-01-01 00:00:00','2013-01-01 00:00:00');
|
insert t1 values (2085,'2012-01-01 00:00:00','2013-01-01 00:00:00');
|
||||||
insert t1 values (2084,'2012-02-01 00:00:00','2013-01-01 00:00:00');
|
insert t1 values (2084,'2012-02-01 00:00:00','2013-01-01 00:00:00');
|
||||||
|
|
@ -454,3 +476,4 @@ n d1 d2 result
|
||||||
2085 2012-01-01 00:00:00 2013-01-01 00:00:00 0
|
2085 2012-01-01 00:00:00 2013-01-01 00:00:00 0
|
||||||
2084 2012-02-01 00:00:00 2013-01-01 00:00:00 0
|
2084 2012-02-01 00:00:00 2013-01-01 00:00:00 0
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
set optimizer_switch=@save_derived_optimizer_switch;
|
||||||
|
|
|
||||||
|
|
@ -320,6 +320,37 @@ DROP TABLE t1;
|
||||||
|
|
||||||
--echo # End of 5.0 tests
|
--echo # End of 5.0 tests
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-5005: Subquery in Procedure somehow affecting temporary table
|
||||||
|
--echo #
|
||||||
|
|
||||||
|
create temporary table if not exists t1 (id int not null);
|
||||||
|
|
||||||
|
select A.* from ( select tt.* from t1 tt ) A;
|
||||||
|
|
||||||
|
prepare stmt from "select A.* from ( select tt.* from t1 tt ) A ";
|
||||||
|
execute stmt;
|
||||||
|
deallocate prepare stmt;
|
||||||
|
|
||||||
|
drop temporary table t1;
|
||||||
|
|
||||||
|
--delimiter |
|
||||||
|
CREATE PROCEDURE p ()
|
||||||
|
BEGIN
|
||||||
|
select A.* from ( select tt.* from t1 tt ) A ;
|
||||||
|
END |
|
||||||
|
--delimiter ;
|
||||||
|
|
||||||
|
create temporary table if not exists t1 (id int not null);
|
||||||
|
|
||||||
|
CALL p();
|
||||||
|
CALL p();
|
||||||
|
|
||||||
|
drop procedure p;
|
||||||
|
|
||||||
|
drop temporary table t1;
|
||||||
|
|
||||||
|
--echo # End of 5.3 tests
|
||||||
|
|
||||||
--echo #
|
--echo #
|
||||||
--echo # Bug#58730 Assertion failed: table->key_read == 0 in close_thread_table,
|
--echo # Bug#58730 Assertion failed: table->key_read == 0 in close_thread_table,
|
||||||
|
|
@ -342,7 +373,6 @@ SELECT 1 FROM t1 JOIN v1 ON 1 > (SELECT 1 FROM v2);
|
||||||
|
|
||||||
DROP TABLE t1, t2;
|
DROP TABLE t1, t2;
|
||||||
DROP VIEW v1, v2;
|
DROP VIEW v1, v2;
|
||||||
set optimizer_switch=@save_derived_optimizer_switch;
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# MDEV-614 lp:1050806 - different result for a query using subquery between 5.5.25 and 5.5.27
|
# MDEV-614 lp:1050806 - different result for a query using subquery between 5.5.25 and 5.5.27
|
||||||
|
|
@ -358,3 +388,5 @@ select * from (
|
||||||
where d1 < '2012-12-12 12:12:12' and n in (2085, 2084) order by d2 asc
|
where d1 < '2012-12-12 12:12:12' and n in (2085, 2084) order by d2 asc
|
||||||
) as calculated_result;
|
) as calculated_result;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
set optimizer_switch=@save_derived_optimizer_switch;
|
||||||
|
|
|
||||||
|
|
@ -3769,10 +3769,7 @@ void SELECT_LEX::mark_as_belong_to_derived(TABLE_LIST *derived)
|
||||||
TABLE_LIST *tl;
|
TABLE_LIST *tl;
|
||||||
List_iterator<TABLE_LIST> ti(leaf_tables);
|
List_iterator<TABLE_LIST> ti(leaf_tables);
|
||||||
while ((tl= ti++))
|
while ((tl= ti++))
|
||||||
{
|
|
||||||
tl->open_type= OT_BASE_ONLY;
|
|
||||||
tl->belong_to_derived= derived;
|
tl->belong_to_derived= derived;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue