summaryrefslogtreecommitdiff
path: root/mysql-test/main
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-04-06 13:00:09 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2022-04-06 13:00:09 +0300
commit2d8e38bc9477aa00b371ed14d95390bede70c5cb (patch)
tree7d4e4e22138572b769263994697d69bd141c5bf3 /mysql-test/main
parentb249abde57f1788a8085f45cc6252ee70ece3354 (diff)
parent4e1ca388381eea27a9275571744ad17ce317b273 (diff)
downloadmariadb-git-2d8e38bc9477aa00b371ed14d95390bede70c5cb.tar.gz
Merge 10.6 into 10.7
Diffstat (limited to 'mysql-test/main')
-rw-r--r--mysql-test/main/backup_locks.result2
-rw-r--r--mysql-test/main/information_schema.result6
-rw-r--r--mysql-test/main/information_schema.test5
-rw-r--r--mysql-test/main/ps.result35
-rw-r--r--mysql-test/main/ps.test32
-rw-r--r--mysql-test/main/sp.result19
-rw-r--r--mysql-test/main/sp.test24
-rw-r--r--mysql-test/main/trigger.result2
8 files changed, 121 insertions, 4 deletions
diff --git a/mysql-test/main/backup_locks.result b/mysql-test/main/backup_locks.result
index 478cd1ef537..2942231678e 100644
--- a/mysql-test/main/backup_locks.result
+++ b/mysql-test/main/backup_locks.result
@@ -49,7 +49,7 @@ create sequence seq2;
backup lock seq1;
connection con1;
CREATE OR REPLACE SEQUENCE seq1 START -28;
-ERROR HY000: Sequence 'test.seq1' values are conflicting
+ERROR HY000: Sequence 'test.seq1' has out of range value for options
SET STATEMENT max_statement_time=10 FOR CREATE OR REPLACE SEQUENCE seq1 START 50;
ERROR 70100: Query execution was interrupted (max_statement_time exceeded)
SET STATEMENT max_statement_time=10 FOR ALTER SEQUENCE IF EXISTS seq1 NOMAXVALUE;
diff --git a/mysql-test/main/information_schema.result b/mysql-test/main/information_schema.result
index de9ff8d8e4d..ad78f413ea1 100644
--- a/mysql-test/main/information_schema.result
+++ b/mysql-test/main/information_schema.result
@@ -2524,5 +2524,11 @@ DROP TABLE t1;
DROP TABLE t1;
SET SQL_MODE=DEFAULT;
#
+# MDEV-27673 Warning after "select progress from information_schema.processlist"
+#
+select progress from information_schema.processlist limit 1;
+progress
+0.000
+#
# End of 10.3 tests
#
diff --git a/mysql-test/main/information_schema.test b/mysql-test/main/information_schema.test
index d8c23e1f673..0c403caa599 100644
--- a/mysql-test/main/information_schema.test
+++ b/mysql-test/main/information_schema.test
@@ -2103,7 +2103,10 @@ DROP TABLE t1;
DROP TABLE t1;
SET SQL_MODE=DEFAULT;
-
+--echo #
+--echo # MDEV-27673 Warning after "select progress from information_schema.processlist"
+--echo #
+select progress from information_schema.processlist limit 1;
--echo #
--echo # End of 10.3 tests
diff --git a/mysql-test/main/ps.result b/mysql-test/main/ps.result
index cd01a8949bd..bb4132d5c31 100644
--- a/mysql-test/main/ps.result
+++ b/mysql-test/main/ps.result
@@ -5576,6 +5576,28 @@ a
DEALLOCATE PREPARE stmt;
DROP VIEW v1;
DROP TABLE t1;
+#
+# MDEV-19631: Assertion `0' failed in st_select_lex_unit::optimize or
+# different plan upon 2nd execution of PS with EXPLAIN
+#
+CREATE TABLE t1 (a INT);
+PREPARE stmt FROM 'EXPLAIN SELECT * FROM t1 HAVING 6 IN ( SELECT 6 UNION SELECT 5 )';
+EXECUTE stmt;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 system NULL NULL NULL NULL 0 Const row not found
+2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used
+3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
+# Without the patch the second execution of the 'stmt' prepared statement
+# would result in server crash.
+EXECUTE stmt;
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t1 system NULL NULL NULL NULL 0 Const row not found
+2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used
+3 UNION NULL NULL NULL NULL NULL NULL NULL No tables used
+NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
+DEALLOCATE PREPARE stmt;
+DROP TABLE t1;
# End of 10.2 tests
#
#
@@ -5640,5 +5662,18 @@ connection default;
SET GLOBAL disconnect_on_expired_password=@disconnect_on_expired_password_save;
DROP USER user1@localhost;
#
+# MDEV-21173: Assertion `m_thd == __null' failed in sp_head::~sp_head
+#
+CREATE TABLE t1 (a INT);
+EXECUTE IMMEDIATE "CREATE PROCEDURE p1() SELECT 1 FROM t1 PROCEDURE ANALYSE( 10, (SELECT a FROM t1));";
+ERROR 42000: PROCEDURE does not support subqueries or stored functions
+DROP TABLE t1;
+BEGIN NOT ATOMIC
+PREPARE stmt FROM 'SELECT ?';
+EXECUTE stmt USING ((SELECT 1));
+END;
+$
+ERROR 42000: EXECUTE..USING does not support subqueries or stored functions
+#
# End of 10.4 tests
#
diff --git a/mysql-test/main/ps.test b/mysql-test/main/ps.test
index c4ec92540a2..678c24db1eb 100644
--- a/mysql-test/main/ps.test
+++ b/mysql-test/main/ps.test
@@ -5006,6 +5006,19 @@ DEALLOCATE PREPARE stmt;
DROP VIEW v1;
DROP TABLE t1;
+--echo #
+--echo # MDEV-19631: Assertion `0' failed in st_select_lex_unit::optimize or
+--echo # different plan upon 2nd execution of PS with EXPLAIN
+--echo #
+CREATE TABLE t1 (a INT);
+PREPARE stmt FROM 'EXPLAIN SELECT * FROM t1 HAVING 6 IN ( SELECT 6 UNION SELECT 5 )';
+EXECUTE stmt;
+--echo # Without the patch the second execution of the 'stmt' prepared statement
+--echo # would result in server crash.
+EXECUTE stmt;
+# Cleanup
+DEALLOCATE PREPARE stmt;
+DROP TABLE t1;
--echo # End of 10.2 tests
--echo #
@@ -5084,5 +5097,24 @@ SET GLOBAL disconnect_on_expired_password=@disconnect_on_expired_password_save;
DROP USER user1@localhost;
--echo #
+--echo # MDEV-21173: Assertion `m_thd == __null' failed in sp_head::~sp_head
+--echo #
+CREATE TABLE t1 (a INT);
+
+--error ER_SUBQUERIES_NOT_SUPPORTED
+EXECUTE IMMEDIATE "CREATE PROCEDURE p1() SELECT 1 FROM t1 PROCEDURE ANALYSE( 10, (SELECT a FROM t1));";
+DROP TABLE t1;
+
+delimiter $;
+--error ER_SUBQUERIES_NOT_SUPPORTED
+BEGIN NOT ATOMIC
+ PREPARE stmt FROM 'SELECT ?';
+ EXECUTE stmt USING ((SELECT 1));
+END;
+$
+
+delimiter ;$
+
+--echo #
--echo # End of 10.4 tests
--echo #
diff --git a/mysql-test/main/sp.result b/mysql-test/main/sp.result
index cf51ce96817..bddb41c0730 100644
--- a/mysql-test/main/sp.result
+++ b/mysql-test/main/sp.result
@@ -8897,6 +8897,19 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
BEGIN
RETURN '';
END' at line 2
+#
+# MDEV-28220: Assert failure in sp_head::~sp_head on parsing a syntax incorrect statement CREATE SEQUENCE ... RESTART inside CREATE PROCEDURE/CREATE FUNCTION
+
+# Specifying the RESTART clause for the statement CREATE SEQUENCE is a syntax error.
+# Check that CREATE PROCEDURE doesn't crash server if the statement
+# CREATE SEQUNCE ... RESTART is specified in its body.
+#
+CREATE PROCEDURE sp1() CREATE SEQUENCE s1 START WITH 300 INCREMENT BY 30 RESTART;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'RESTART' at line 1
+# CREATE SEQUNCE ... RESTART and CREATE SEQUNCE ... RESTART WITH ... are
+# handled by different grammar rules, so check the both cases.
+CREATE PROCEDURE sp1() CREATE SEQUENCE s1 START WITH 300 INCREMENT BY 30 RESTART WITH 100;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'RESTART' at line 1
# End of 10.3 tests
#
# Start of 10.4 tests
@@ -8911,6 +8924,12 @@ END;
$$
ERROR 42000: Incorrect usage/placement of 'HIGH_PRIORITY'
#
+# MDEV-21173: Assertion `m_thd == __null' failed in sp_head::~sp_head
+#
+CREATE TABLE t1 (a INT);
+CREATE PROCEDURE p1() SELECT 1 FROM t1 PROCEDURE ANALYSE( 10, (SELECT a FROM t1));
+ERROR 42000: PROCEDURE does not support subqueries or stored functions
+DROP TABLE t1;
# End of 10.4 tests
#
#
diff --git a/mysql-test/main/sp.test b/mysql-test/main/sp.test
index d0d1ebf62b5..9d0e05e4d1d 100644
--- a/mysql-test/main/sp.test
+++ b/mysql-test/main/sp.test
@@ -10460,6 +10460,21 @@ END;
$$
DELIMITER ;$$
+--echo #
+--echo # MDEV-28220: Assert failure in sp_head::~sp_head on parsing a syntax incorrect statement CREATE SEQUENCE ... RESTART inside CREATE PROCEDURE/CREATE FUNCTION
+--echo
+
+--echo # Specifying the RESTART clause for the statement CREATE SEQUENCE is a syntax error.
+--echo # Check that CREATE PROCEDURE doesn't crash server if the statement
+--echo # CREATE SEQUNCE ... RESTART is specified in its body.
+--echo #
+--error ER_PARSE_ERROR
+CREATE PROCEDURE sp1() CREATE SEQUENCE s1 START WITH 300 INCREMENT BY 30 RESTART;
+--echo # CREATE SEQUNCE ... RESTART and CREATE SEQUNCE ... RESTART WITH ... are
+--echo # handled by different grammar rules, so check the both cases.
+--error ER_PARSE_ERROR
+CREATE PROCEDURE sp1() CREATE SEQUENCE s1 START WITH 300 INCREMENT BY 30 RESTART WITH 100;
+
--echo # End of 10.3 tests
@@ -10480,8 +10495,15 @@ END;
$$
DELIMITER ;$$
-
--echo #
+--echo # MDEV-21173: Assertion `m_thd == __null' failed in sp_head::~sp_head
+--echo #
+CREATE TABLE t1 (a INT);
+--error ER_SUBQUERIES_NOT_SUPPORTED
+CREATE PROCEDURE p1() SELECT 1 FROM t1 PROCEDURE ANALYSE( 10, (SELECT a FROM t1));
+
+DROP TABLE t1;
+
--echo # End of 10.4 tests
--echo #
diff --git a/mysql-test/main/trigger.result b/mysql-test/main/trigger.result
index f031dec2e1a..d07be1b868f 100644
--- a/mysql-test/main/trigger.result
+++ b/mysql-test/main/trigger.result
@@ -319,7 +319,7 @@ drop table t1;
drop table t3;
create temporary table t1 (i int);
create trigger trg before insert on t1 for each row set @a:=1;
-ERROR HY000: Trigger's 't1' is view or temporary table
+ERROR HY000: Trigger's 't1' is a view, temporary table or sequence
drop table t1;
create table t1 (x1col char);
create trigger tx1 before insert on t1 for each row set new.x1col = 'x';