summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-04-06 08:59:09 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2022-04-06 08:59:09 +0300
commitd6d66c6e90050cb8aefcb55da48f7f849e5b11de (patch)
tree8a0fd06ca5605d9158e8d68924aff38262e073af /mysql-test
parentf6b09a7ce58f564d8e5c08c799d2fc45cfc10870 (diff)
parent7c584d8270cf192496f36e993e7759616f3b650b (diff)
downloadmariadb-git-d6d66c6e90050cb8aefcb55da48f7f849e5b11de.tar.gz
Merge 10.3 into 10.4
Diffstat (limited to 'mysql-test')
-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.result22
-rw-r--r--mysql-test/main/ps.test13
-rw-r--r--mysql-test/main/sp.result13
-rw-r--r--mysql-test/main/sp.test15
-rw-r--r--mysql-test/suite/encryption/r/innochecksum.result2
-rw-r--r--mysql-test/suite/encryption/t/innochecksum.test4
-rw-r--r--mysql-test/suite/galera/t/galera_sst_rsync2.cnf4
-rw-r--r--mysql-test/suite/galera/t/galera_sst_rsync2.test2
-rw-r--r--mysql-test/suite/mariabackup/full_backup.result1
-rw-r--r--mysql-test/suite/mariabackup/full_backup.test9
-rw-r--r--mysql-test/suite/versioning/r/debug.result14
-rw-r--r--mysql-test/suite/versioning/r/update.result12
-rw-r--r--mysql-test/suite/versioning/t/debug.test16
-rw-r--r--mysql-test/suite/versioning/t/update.test15
16 files changed, 144 insertions, 9 deletions
diff --git a/mysql-test/main/information_schema.result b/mysql-test/main/information_schema.result
index cd726f7298f..1d889ffa13d 100644
--- a/mysql-test/main/information_schema.result
+++ b/mysql-test/main/information_schema.result
@@ -2392,5 +2392,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 c7087958f79..77d0df59e2f 100644
--- a/mysql-test/main/information_schema.test
+++ b/mysql-test/main/information_schema.test
@@ -2105,7 +2105,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 5d72cde5dd2..134069d4717 100644
--- a/mysql-test/main/ps.result
+++ b/mysql-test/main/ps.result
@@ -5586,6 +5586,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
#
#
diff --git a/mysql-test/main/ps.test b/mysql-test/main/ps.test
index c99731e768d..062d729b2cc 100644
--- a/mysql-test/main/ps.test
+++ b/mysql-test/main/ps.test
@@ -5005,6 +5005,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 #
diff --git a/mysql-test/main/sp.result b/mysql-test/main/sp.result
index 3795e4db894..4dc033d4171 100644
--- a/mysql-test/main/sp.result
+++ b/mysql-test/main/sp.result
@@ -8902,6 +8902,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
diff --git a/mysql-test/main/sp.test b/mysql-test/main/sp.test
index 4fa5085128a..a93689ba4da 100644
--- a/mysql-test/main/sp.test
+++ b/mysql-test/main/sp.test
@@ -10461,6 +10461,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
diff --git a/mysql-test/suite/encryption/r/innochecksum.result b/mysql-test/suite/encryption/r/innochecksum.result
index 5dc6ed90acc..7c68164e52a 100644
--- a/mysql-test/suite/encryption/r/innochecksum.result
+++ b/mysql-test/suite/encryption/r/innochecksum.result
@@ -7,7 +7,7 @@ CREATE TABLE t3 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB ROW_FOR
CREATE TABLE t4 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB PAGE_COMPRESSED=1;
CREATE TABLE t5 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB PAGE_COMPRESSED=1 ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
CREATE TABLE t6 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB;
-# Run innochecksum on t1
+# Run innochecksum on t1, check -S does not cause crash for encrypted file
# Run innochecksum on t2
# Run innochecksum on t3
# Run innochecksum on t4
diff --git a/mysql-test/suite/encryption/t/innochecksum.test b/mysql-test/suite/encryption/t/innochecksum.test
index 0f44844c103..1dca45a0711 100644
--- a/mysql-test/suite/encryption/t/innochecksum.test
+++ b/mysql-test/suite/encryption/t/innochecksum.test
@@ -58,9 +58,9 @@ let MYSQLD_DATADIR=`select @@datadir`;
--source include/shutdown_mysqld.inc
---echo # Run innochecksum on t1
-- disable_result_log
---exec $INNOCHECKSUM $t1_IBD
+--echo # Run innochecksum on t1, check -S does not cause crash for encrypted file
+--exec $INNOCHECKSUM -S $t1_IBD
--echo # Run innochecksum on t2
diff --git a/mysql-test/suite/galera/t/galera_sst_rsync2.cnf b/mysql-test/suite/galera/t/galera_sst_rsync2.cnf
index 0159596f99b..a089baacf36 100644
--- a/mysql-test/suite/galera/t/galera_sst_rsync2.cnf
+++ b/mysql-test/suite/galera/t/galera_sst_rsync2.cnf
@@ -5,10 +5,10 @@ wsrep_sst_method=rsync
[mysqld.1]
wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true'
-log_bin=@ENV.MYSQLTEST_VARDIR/server1_binlog
+log_bin=@ENV.MYSQLTEST_VARDIR/mysqld.1/server1_binlog
log_bin_index=@ENV.MYSQLTEST_VARDIR/tmp/server1_binlog_index.index
[mysqld.2]
wsrep_provider_options='base_port=@mysqld.2.#galera_port;gcache.size=1;pc.ignore_sb=true'
-log_bin=@ENV.MYSQLTEST_VARDIR/server2_binlog
+log_bin=@ENV.MYSQLTEST_VARDIR/mysqld.2/server2_binlog
log_bin_index=@ENV.MYSQLTEST_VARDIR/tmp/server2_binlog_index.index
diff --git a/mysql-test/suite/galera/t/galera_sst_rsync2.test b/mysql-test/suite/galera/t/galera_sst_rsync2.test
index f796356cac7..20fae4a751e 100644
--- a/mysql-test/suite/galera/t/galera_sst_rsync2.test
+++ b/mysql-test/suite/galera/t/galera_sst_rsync2.test
@@ -7,6 +7,8 @@
--source suite/galera/include/galera_st_shutdown_slave.inc
--source suite/galera/include/galera_st_clean_slave.inc
+--let $wsrep_recover_additional=--log-bin=$MYSQLTEST_VARDIR/mysqld.2/server2_binlog --log-bin-index=$MYSQLTEST_VARDIR/tmp/server2_binlog_index.index
+
--source suite/galera/include/galera_st_kill_slave.inc
--source suite/galera/include/galera_st_kill_slave_ddl.inc
--source include/auto_increment_offset_restore.inc
diff --git a/mysql-test/suite/mariabackup/full_backup.result b/mysql-test/suite/mariabackup/full_backup.result
index 690c5e64b4a..e2d5cf185d5 100644
--- a/mysql-test/suite/mariabackup/full_backup.result
+++ b/mysql-test/suite/mariabackup/full_backup.result
@@ -1,6 +1,7 @@
CREATE TABLE t(i INT) ENGINE INNODB;
INSERT INTO t VALUES(1);
# xtrabackup backup
+NOT FOUND /InnoDB: Allocated tablespace ID/ in backup.log
INSERT INTO t VALUES(2);
# xtrabackup prepare
# shutdown server
diff --git a/mysql-test/suite/mariabackup/full_backup.test b/mysql-test/suite/mariabackup/full_backup.test
index d1d2ea21c08..66bed34cf3d 100644
--- a/mysql-test/suite/mariabackup/full_backup.test
+++ b/mysql-test/suite/mariabackup/full_backup.test
@@ -4,11 +4,18 @@ CREATE TABLE t(i INT) ENGINE INNODB;
INSERT INTO t VALUES(1);
echo # xtrabackup backup;
let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
+--let $backup_log=$MYSQLTEST_VARDIR/tmp/backup.log
--disable_result_log
-exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir;
+exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir > $backup_log 2>&1;
--enable_result_log
+# The following warning must not appear after MDEV-27343 fix
+--let SEARCH_PATTERN=InnoDB: Allocated tablespace ID
+--let SEARCH_FILE=$backup_log
+--source include/search_pattern_in_file.inc
+--remove_file $backup_log
+
INSERT INTO t VALUES(2);
diff --git a/mysql-test/suite/versioning/r/debug.result b/mysql-test/suite/versioning/r/debug.result
index c1c134692a2..0e2c67fd9aa 100644
--- a/mysql-test/suite/versioning/r/debug.result
+++ b/mysql-test/suite/versioning/r/debug.result
@@ -50,5 +50,17 @@ t4 CREATE TABLE `t4` (
`row_end` timestamp(6) GENERATED ALWAYS AS ROW END,
PERIOD FOR SYSTEM_TIME (`row_start`, `row_end`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
-set global debug_dbug=@old_dbug;
drop table t1, t2, t3, t4;
+#
+# MDEV-19525 remove ER_VERS_FIELD_WRONG_TYPE from init_from_binary_frm_image()
+#
+create table t1 (x int) with system versioning;
+set debug_dbug='+d,error_vers_wrong_type';
+show create table t1;
+ERROR HY000: Incorrect information in file: './test/t1.frm'
+show warnings;
+Level Code Message
+Warning 4110 `row_start` must be of type TIMESTAMP(6) for system-versioned table `t1`
+Error 1033 Incorrect information in file: './test/t1.frm'
+drop table t1;
+set global debug_dbug=@old_dbug;
diff --git a/mysql-test/suite/versioning/r/update.result b/mysql-test/suite/versioning/r/update.result
index a01d51f62cd..cbb75a10cf5 100644
--- a/mysql-test/suite/versioning/r/update.result
+++ b/mysql-test/suite/versioning/r/update.result
@@ -411,6 +411,17 @@ check_row_ts(row_start, row_end)
CURRENT ROW
drop table t1;
#
+# MDEV-22973 Assertion in compare_record upon multi-update involving versioned table via view
+#
+create or replace table t1 (a int, primary key (a)) engine=myisam;
+insert into t1 values (0);
+create or replace table t2 (pk int, b int, primary key (pk), key(b)) engine=innodb with system versioning;
+insert into t2 values (1, 0), (2, 0);
+create or replace view v as select a, b from t1, t2;
+update v set b= null where a = 0 order by b;
+drop view v;
+drop table t1, t2;
+#
# MDEV-24522 Assertion `inited==NONE' fails upon UPDATE on versioned table with unique blob
#
create table t1 (a int, b int, c text, unique(c), key (b)) engine=myisam with system versioning;
@@ -426,3 +437,4 @@ update t1 set a = 3 where b <= 9;
update t2 set a = 3 where b <= 9;
update t1, t2 set t1.a = 3, t2.a = 3 where t1.b <= 10 and t2.b <= 10 and t1.b = t2.b;
drop tables t1, t2;
+# End of 10.4 tests
diff --git a/mysql-test/suite/versioning/t/debug.test b/mysql-test/suite/versioning/t/debug.test
index 5069d7f6002..be58b67546d 100644
--- a/mysql-test/suite/versioning/t/debug.test
+++ b/mysql-test/suite/versioning/t/debug.test
@@ -1,5 +1,7 @@
--source include/have_debug.inc
+--let $datadir=`select @@datadir`
+
create table t1 (a int);
show create table t1;
@@ -30,6 +32,18 @@ set debug_dbug='+d,sysvers_show';
show create table t3;
create table t4 (a int);
show create table t4;
+drop table t1, t2, t3, t4;
+
+--echo #
+--echo # MDEV-19525 remove ER_VERS_FIELD_WRONG_TYPE from init_from_binary_frm_image()
+--echo #
+create table t1 (x int) with system versioning;
+set debug_dbug='+d,error_vers_wrong_type';
+--replace_result $datadir ./
+--error ER_NOT_FORM_FILE
+show create table t1;
+--replace_result $datadir ./
+show warnings;
+drop table t1;
set global debug_dbug=@old_dbug;
-drop table t1, t2, t3, t4;
diff --git a/mysql-test/suite/versioning/t/update.test b/mysql-test/suite/versioning/t/update.test
index 478f5ad231f..56bbd909256 100644
--- a/mysql-test/suite/versioning/t/update.test
+++ b/mysql-test/suite/versioning/t/update.test
@@ -337,6 +337,19 @@ select check_row_ts(row_start, row_end) from t1 for system_time all where row_st
drop table t1;
--echo #
+--echo # MDEV-22973 Assertion in compare_record upon multi-update involving versioned table via view
+--echo #
+create or replace table t1 (a int, primary key (a)) engine=myisam;
+insert into t1 values (0);
+create or replace table t2 (pk int, b int, primary key (pk), key(b)) engine=innodb with system versioning;
+insert into t2 values (1, 0), (2, 0);
+create or replace view v as select a, b from t1, t2;
+update v set b= null where a = 0 order by b;
+# cleanup
+drop view v;
+drop table t1, t2;
+
+--echo #
--echo # MDEV-24522 Assertion `inited==NONE' fails upon UPDATE on versioned table with unique blob
--echo #
create table t1 (a int, b int, c text, unique(c), key (b)) engine=myisam with system versioning;
@@ -360,4 +373,6 @@ update t1, t2 set t1.a = 3, t2.a = 3 where t1.b <= 10 and t2.b <= 10 and t1.b =
# cleanup
drop tables t1, t2;
+--echo # End of 10.4 tests
+
source suite/versioning/common_finish.inc;