summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-04-01 09:19:37 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-04-01 09:19:37 +0300
commitbc862c4ebeb9d706465d580ed58c235704579c05 (patch)
tree71a88ec195e4408ecb254040fd365afe820e9086 /mysql-test
parentb1742a5c951633213d756600ee73ba7bfa7800ff (diff)
parentf9639c2d1a5e24f1a1533b6277fe7eca3aa3c3c0 (diff)
downloadmariadb-git-bc862c4ebeb9d706465d580ed58c235704579c05.tar.gz
Merge 10.1 into 10.2
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/mysqldump.result21
-rw-r--r--mysql-test/suite/innodb/r/foreign_key.result7
-rw-r--r--mysql-test/suite/innodb/t/foreign_key.test11
-rw-r--r--mysql-test/t/mysqldump.test39
4 files changed, 76 insertions, 2 deletions
diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result
index e83edb8c121..e527dbffe43 100644
--- a/mysql-test/r/mysqldump.result
+++ b/mysql-test/r/mysqldump.result
@@ -5647,9 +5647,27 @@ count(*)
2
drop tables t2, t1;
#
-# Test for --add-drop-trigger
+# MDEV-22037: Add ability to skip content of some tables
+# (work around for MDEV-20939)
#
+use mysql;
+# check that all tables we need are not empty
+select count(*) >= 1 from mysql.proc;
+count(*) >= 1
+1
+select count(*) >= 1 from mysql.db;
+count(*) >= 1
+1
+# for proc we have CREATE and INSERT for all other only CREATE
+FOUND 1 /INSERT INTO `proc`/ in MDEV-20939.sql
+NOT FOUND /INSERT INTO `db`/ in MDEV-20939.sql
+FOUND 1 /CREATE TABLE `db`/ in MDEV-20939.sql
+FOUND 1 /CREATE TABLE `proc`/ in MDEV-20939.sql
use test;
+# End of 10.1 tests
+#
+# Test for --add-drop-trigger
+#
CREATE TABLE t1 (a int, b int);
CREATE TRIGGER tt1_t1 BEFORE INSERT ON t1 FOR EACH ROW
SET NEW.b=NEW.a + 10;
@@ -5695,3 +5713,4 @@ DELIMITER ;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
DROP TABLE t1;
+# End of 10.2 tests
diff --git a/mysql-test/suite/innodb/r/foreign_key.result b/mysql-test/suite/innodb/r/foreign_key.result
index 5eb0658bf48..749aa5943d3 100644
--- a/mysql-test/suite/innodb/r/foreign_key.result
+++ b/mysql-test/suite/innodb/r/foreign_key.result
@@ -274,6 +274,13 @@ CREATE TABLE t2 (f INT, KEY(f)) ENGINE=InnoDB;
ALTER TABLE t1 ADD FOREIGN KEY (f2) REFERENCES t2 (f);
ALTER IGNORE TABLE t1 ADD FOREIGN KEY (f3) REFERENCES t1 (f1);
DROP TABLE t1, t2;
+CREATE TABLE t1 (a INT, b INT, KEY idx(a)) ENGINE=InnoDB;
+SET FOREIGN_KEY_CHECKS= OFF;
+ALTER TABLE t1 ADD FOREIGN KEY (a) REFERENCES tx(x);
+ALTER TABLE t1 DROP KEY idx;
+ALTER TABLE t1 CHANGE a c INT;
+DROP TABLE t1;
+SET FOREIGN_KEY_CHECKS=1;
# Start of 10.2 tests
#
# MDEV-13246 Stale rows despite ON DELETE CASCADE constraint
diff --git a/mysql-test/suite/innodb/t/foreign_key.test b/mysql-test/suite/innodb/t/foreign_key.test
index 06cab983656..b5a84756914 100644
--- a/mysql-test/suite/innodb/t/foreign_key.test
+++ b/mysql-test/suite/innodb/t/foreign_key.test
@@ -257,6 +257,17 @@ ALTER TABLE t1 ADD FOREIGN KEY (f2) REFERENCES t2 (f);
ALTER IGNORE TABLE t1 ADD FOREIGN KEY (f3) REFERENCES t1 (f1);
DROP TABLE t1, t2;
+# MDEV-19092 Server crash when renaming the column when
+# FOREIGN_KEY_CHECKS is disabled
+CREATE TABLE t1 (a INT, b INT, KEY idx(a)) ENGINE=InnoDB;
+SET FOREIGN_KEY_CHECKS= OFF;
+ALTER TABLE t1 ADD FOREIGN KEY (a) REFERENCES tx(x);
+ALTER TABLE t1 DROP KEY idx;
+ALTER TABLE t1 CHANGE a c INT;
+# Cleanup
+DROP TABLE t1;
+SET FOREIGN_KEY_CHECKS=1;
+
--echo # Start of 10.2 tests
--echo #
diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test
index 34976350c78..4478406b395 100644
--- a/mysql-test/t/mysqldump.test
+++ b/mysql-test/t/mysqldump.test
@@ -2688,10 +2688,45 @@ select count(*) from t2;
--remove_file $MYSQLTEST_VARDIR/tmp/t2.txt
drop tables t2, t1;
+
--echo #
---echo # Test for --add-drop-trigger
+--echo # MDEV-22037: Add ability to skip content of some tables
+--echo # (work around for MDEV-20939)
--echo #
+
+use mysql;
+
+--echo # check that all tables we need are not empty
+
+select count(*) >= 1 from mysql.proc;
+select count(*) >= 1 from mysql.db;
+
+
+--exec $MYSQL_DUMP mysql --ignore-table-data=mysql.db >$MYSQLTEST_VARDIR/tmp/MDEV-20939.sql
+
+
+--echo # for proc we have CREATE and INSERT for all other only CREATE
+
+let SEARCH_RANGE=500000000;
+let SEARCH_FILE=$MYSQLTEST_VARDIR/tmp/MDEV-20939.sql;
+let SEARCH_PATTERN=INSERT INTO `proc`;
+source include/search_pattern_in_file.inc;
+let SEARCH_PATTERN=INSERT INTO `db`;
+source include/search_pattern_in_file.inc;
+let SEARCH_PATTERN=CREATE TABLE `db`;
+source include/search_pattern_in_file.inc;
+let SEARCH_PATTERN=CREATE TABLE `proc`;
+source include/search_pattern_in_file.inc;
+
+--remove_file $MYSQLTEST_VARDIR/tmp/MDEV-20939.sql
use test;
+
+--echo # End of 10.1 tests
+
+--echo #
+--echo # Test for --add-drop-trigger
+--echo #
+
CREATE TABLE t1 (a int, b int);
CREATE TRIGGER tt1_t1 BEFORE INSERT ON t1 FOR EACH ROW
SET NEW.b=NEW.a + 10;
@@ -2699,3 +2734,5 @@ CREATE TRIGGER tt1_t1 BEFORE INSERT ON t1 FOR EACH ROW
INSERT INTO t1 (a) VALUES (1),(2),(3);
--exec $MYSQL_DUMP --default-character-set=utf8mb4 --triggers --no-data --no-create-info --add-drop-trigger --skip-comments --databases test
DROP TABLE t1;
+
+--echo # End of 10.2 tests