diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2022-01-27 08:45:36 +0100 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2022-01-27 08:45:36 +0100 |
commit | 9b4a179d69a1c795bef303a88f9d3195669f00ec (patch) | |
tree | 87811d81af231e2945468ead0cba58cfc5514548 /mysql-test/main/derived.test | |
parent | 020dc54dabe64f238e8ef4f50a630a22e0f06949 (diff) | |
parent | 7db489fc7dea2b4c236807035e57f169074c6682 (diff) | |
download | mariadb-git-10.3-merge.tar.gz |
Merge branch '10.2' into bb-10.3-release10.3-merge
Diffstat (limited to 'mysql-test/main/derived.test')
-rw-r--r-- | mysql-test/main/derived.test | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/mysql-test/main/derived.test b/mysql-test/main/derived.test index f4477ce8550..4ff0cf4165c 100644 --- a/mysql-test/main/derived.test +++ b/mysql-test/main/derived.test @@ -1037,6 +1037,57 @@ drop view v1,v2,v3,v4; drop table t1,t2,t3; --echo # +--echo # 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) +--echo # +CREATE TABLE t1 (a INT); + +--echo # Check that re-execution of a stored routine containing +--echo # a query with subquery in the FROM clause doesn't result in +--echo # assert failure in case the 'derived_merge' optimizer option +--echo # has been turned on/off +CREATE PROCEDURE sp() SELECT * FROM (SELECT a FROM t1) tb; +CALL sp(); +SET optimizer_switch='derived_merge=off'; +--echo # Without the patch the following statement would result in assert +--echo # failure +CALL sp(); + +--echo # 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; +SET optimizer_switch='derived_merge=off'; +--echo # Without the patch the following statement would result in assert +--echo # failure +EXECUTE stmt; +DEALLOCATE PREPARE stmt; + +--echo # Here check the reverse test case - first turn off the 'derived_merge' +--echo # optimizer option, run the stored routine containing a query with +--echo # subquery in the FROM clause, then turn on the 'derived_merge' +--echo # optimizer option and re-execute the same stored routine to check that +--echo # the routine is finished successfully. +CREATE PROCEDURE sp1() SELECT * FROM (SELECT a FROM t1) tb; +SET optimizer_switch='derived_merge=off'; +CALL sp1(); +SET optimizer_switch='derived_merge=on'; +CALL sp1(); + +--echo # 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; +SET optimizer_switch='derived_merge=on'; +--echo # Without the patch the following statement would result in assert +--echo # failure +EXECUTE stmt; +DEALLOCATE PREPARE stmt; + +DROP PROCEDURE sp; +DROP PROCEDURE sp1; +DROP TABLE t1; + +--echo # --echo # End of 10.2 tests --echo # |