summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2020-05-15 06:15:10 +0400
committerAlexander Barkov <bar@mariadb.com>2020-05-15 06:15:10 +0400
commit1408e26d0b15ea95d3d017bb059cd65b53b00a86 (patch)
tree4b49aa818aeb7945561791bad577ec178abf06bc /mysql-test
parentf7cf60991d7d4f78ee91004d522f9417cca0f7b9 (diff)
downloadmariadb-git-1408e26d0b15ea95d3d017bb059cd65b53b00a86.tar.gz
MDEV-22560 Crash on a table value constructor with an SP variable
fix_fields_for_tvc() could call fix_fields() for Items that have already been fixed before. Changing fix_fields() to fix_fields_if_needed().
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/main/table_value_constr.result11
-rw-r--r--mysql-test/main/table_value_constr.test13
2 files changed, 24 insertions, 0 deletions
diff --git a/mysql-test/main/table_value_constr.result b/mysql-test/main/table_value_constr.result
index 03e378e68f2..b00cfd28dcc 100644
--- a/mysql-test/main/table_value_constr.result
+++ b/mysql-test/main/table_value_constr.result
@@ -2599,3 +2599,14 @@ a
2
1
drop view v1;
+#
+# MDEV-22560 Crash on a table value constructor with an SP variable
+#
+BEGIN NOT ATOMIC
+DECLARE a INT DEFAULT 0;
+VALUES (a) UNION SELECT 1;
+END;
+$$
+a
+0
+1
diff --git a/mysql-test/main/table_value_constr.test b/mysql-test/main/table_value_constr.test
index 4464eb7b77b..e7843c604dd 100644
--- a/mysql-test/main/table_value_constr.test
+++ b/mysql-test/main/table_value_constr.test
@@ -1326,3 +1326,16 @@ create view v1 as with t(a) as (values (2), (1)) select a from t;
show create view v1;
select * from v1;
drop view v1;
+
+
+--echo #
+--echo # MDEV-22560 Crash on a table value constructor with an SP variable
+--echo #
+
+DELIMITER $$;
+BEGIN NOT ATOMIC
+ DECLARE a INT DEFAULT 0;
+ VALUES (a) UNION SELECT 1;
+END;
+$$
+DELIMITER ;$$