diff options
author | Alexey Botchkov <holyfoot@askmonty.org> | 2021-09-30 15:57:32 +0400 |
---|---|---|
committer | Alexey Botchkov <holyfoot@askmonty.org> | 2021-09-30 15:57:32 +0400 |
commit | 39efcfbf9d9a69f8e40275f02d87328cf6c082f7 (patch) | |
tree | 10d05680e3c2ac0f1b70d4187d996aca6b0a8851 /mysql-test/t/derived.test | |
parent | 3690c549c6e72646ba74f6b4c83813ee4ac3aea4 (diff) | |
download | mariadb-git-bb-10.2-hf.tar.gz |
MDEV-24383 SIGSEGV in heap_info from make_join_statistics on 2nd SP exec.bb-10.2-hf
Since some optimizer switches lead to the changes in the
parser-generated structures, we have to reload cached SP-s after
the change.
Diffstat (limited to 'mysql-test/t/derived.test')
-rw-r--r-- | mysql-test/t/derived.test | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/mysql-test/t/derived.test b/mysql-test/t/derived.test index 6d9d5e23cf9..a5fc3e0f93f 100644 --- a/mysql-test/t/derived.test +++ b/mysql-test/t/derived.test @@ -1037,5 +1037,34 @@ drop view v1,v2,v3,v4; drop table t1,t2,t3; --echo # +--echo # MDEV-42383 SIGSEGV in heap_info from make_join_statistics on 2nd SP exec. +--echo # +CREATE TABLE t1 (name varchar(100)); +insert into t1 values ("one"), ("two"), ("threee"); +CREATE PROCEDURE p() SELECT * FROM (SELECT 1 FROM t1) AS a; +SET SESSION optimizer_switch="derived_merge=OFF"; +CALL p(); +SET SESSION optimizer_switch="derived_merge=ON"; +CALL p(); +drop procedure p; + +SET GLOBAL optimizer_switch="derived_merge=OFF"; +connect (con1,localhost,root,,); +connection con1; +CREATE PROCEDURE p() SELECT * FROM (SELECT 1 FROM t1) AS a; +CALL p(); + +connection default; +SET GLOBAL optimizer_switch="derived_merge=ON"; +connection con1; +CALL p(); +drop procedure p; +connection default; +disconnect con1; + +drop table t1; +set optimizer_switch=@save_derived_optimizer_switch; + +--echo # --echo # End of 10.2 tests --echo # |