diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2022-04-08 10:37:17 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2022-04-13 15:11:59 +0200 |
commit | 5615a78a69a596099d5f515dd03424b402c7fd17 (patch) | |
tree | 6d7d2f3990536b44977979cb43c74a86558982f1 /mysql-test | |
parent | cdc0bbdd87bbe139b543916f0ab32c90e3fb4917 (diff) | |
download | mariadb-git-5615a78a69a596099d5f515dd03424b402c7fd17.tar.gz |
MDEV-28266 Crash in Field_string::type_handler when calling procedures
on_table_fill_finished() should always be done at the end of open()
even if result is not Select_materialize but (for example)
Select_fetch_into_spvars.
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/main/sp-cursor.result | 12 | ||||
-rw-r--r-- | mysql-test/main/sp-cursor.test | 21 |
2 files changed, 33 insertions, 0 deletions
diff --git a/mysql-test/main/sp-cursor.result b/mysql-test/main/sp-cursor.result index b1c2b335ea4..230bf8c66ef 100644 --- a/mysql-test/main/sp-cursor.result +++ b/mysql-test/main/sp-cursor.result @@ -800,3 +800,15 @@ drop procedure test_proc; drop view v1; drop function get_name; drop table t1; +# +# MDEV-28266: Crash in Field_string::type_handler when calling procedures +# +CREATE TABLE t (f INT); +CREATE TRIGGER tr AFTER INSERT ON t FOR EACH ROW +FOR x IN (SELECT * FROM json_table(NULL, '$' COLUMNS(a CHAR(1) path '$.*')) tmp) +DO set @a=1; END FOR $ +INSERT INTO t () values (); +DROP TABLE t; +# +# End of 10.6 tests +# diff --git a/mysql-test/main/sp-cursor.test b/mysql-test/main/sp-cursor.test index 9794815c784..c95d59b1d3b 100644 --- a/mysql-test/main/sp-cursor.test +++ b/mysql-test/main/sp-cursor.test @@ -800,3 +800,24 @@ drop procedure test_proc; drop view v1; drop function get_name; drop table t1; + +--echo # +--echo # MDEV-28266: Crash in Field_string::type_handler when calling procedures +--echo # + +CREATE TABLE t (f INT); + +--delimiter $ +CREATE TRIGGER tr AFTER INSERT ON t FOR EACH ROW + FOR x IN (SELECT * FROM json_table(NULL, '$' COLUMNS(a CHAR(1) path '$.*')) tmp) + DO set @a=1; END FOR $ +--delimiter ; + +INSERT INTO t () values (); + +# Cleanup +DROP TABLE t; + +--echo # +--echo # End of 10.6 tests +--echo # |