mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge branch '10.3' into 10.4
This commit is contained in:
@@ -1204,6 +1204,59 @@ REPLACE INTO v2 ( SELECT * FROM v4 ) UNION ( SELECT f FROM v2 );
|
||||
drop view v1,v2,v3,v4;
|
||||
drop table t1,t2,t3;
|
||||
#
|
||||
# MDEV-20325: Assertion `outer_context || !*from_field || *from_field == not_found_field' failed in Item_field::fix_outer_field | `!derived->is_excluded()' failed in TABLE_LIST::set_check_materialized | SIGEGV in st_select_lex::mark_as_dependent (optimized builds)
|
||||
#
|
||||
CREATE TABLE t1 (a INT);
|
||||
# Check that re-execution of a stored routine containing
|
||||
# a query with subquery in the FROM clause doesn't result in
|
||||
# assert failure in case the 'derived_merge' optimizer option
|
||||
# has been turned on/off
|
||||
CREATE PROCEDURE sp() SELECT * FROM (SELECT a FROM t1) tb;
|
||||
CALL sp();
|
||||
a
|
||||
SET optimizer_switch='derived_merge=off';
|
||||
# Without the patch the following statement would result in assert
|
||||
# failure
|
||||
CALL sp();
|
||||
a
|
||||
# Check the same test case for Prepared Statement
|
||||
SET optimizer_switch='derived_merge=on';
|
||||
PREPARE stmt FROM "SELECT * FROM (SELECT a FROM t1) tb";
|
||||
EXECUTE stmt;
|
||||
a
|
||||
SET optimizer_switch='derived_merge=off';
|
||||
# Without the patch the following statement would result in assert
|
||||
# failure
|
||||
EXECUTE stmt;
|
||||
a
|
||||
DEALLOCATE PREPARE stmt;
|
||||
# Here check the reverse test case - first turn off the 'derived_merge'
|
||||
# optimizer option, run the stored routine containing a query with
|
||||
# subquery in the FROM clause, then turn on the 'derived_merge'
|
||||
# optimizer option and re-execute the same stored routine to check that
|
||||
# the routine is finished successfully.
|
||||
CREATE PROCEDURE sp1() SELECT * FROM (SELECT a FROM t1) tb;
|
||||
SET optimizer_switch='derived_merge=off';
|
||||
CALL sp1();
|
||||
a
|
||||
SET optimizer_switch='derived_merge=on';
|
||||
CALL sp1();
|
||||
a
|
||||
# Check the same test case for Prepared Statement
|
||||
SET optimizer_switch='derived_merge=off';
|
||||
PREPARE stmt FROM "SELECT * FROM (SELECT a FROM t1) tb";
|
||||
EXECUTE stmt;
|
||||
a
|
||||
SET optimizer_switch='derived_merge=on';
|
||||
# Without the patch the following statement would result in assert
|
||||
# failure
|
||||
EXECUTE stmt;
|
||||
a
|
||||
DEALLOCATE PREPARE stmt;
|
||||
DROP PROCEDURE sp;
|
||||
DROP PROCEDURE sp1;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# End of 10.2 tests
|
||||
#
|
||||
#
|
||||
|
Reference in New Issue
Block a user