summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/mysqldump.result19
-rw-r--r--mysql-test/t/mysqldump.test36
2 files changed, 55 insertions, 0 deletions
diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result
index 8d8e3b7eda4..68a9190030d 100644
--- a/mysql-test/r/mysqldump.result
+++ b/mysql-test/r/mysqldump.result
@@ -5628,3 +5628,22 @@ select count(*) from t2;
count(*)
2
drop tables t2, t1;
+#
+# 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 /INSERT INTO `proc`/ in MDEV-20939.sql
+NOT FOUND /INSERT INTO `db`/ in MDEV-20939.sql
+FOUND /CREATE TABLE `db`/ in MDEV-20939.sql
+FOUND /CREATE TABLE `proc`/ in MDEV-20939.sql
+use test;
+# End of 10.1 tests
diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test
index 7382bd455c8..3f33e4a1d64 100644
--- a/mysql-test/t/mysqldump.test
+++ b/mysql-test/t/mysqldump.test
@@ -2678,3 +2678,39 @@ select count(*) from t2;
--remove_file $MYSQLTEST_VARDIR/tmp/t2.txt
drop tables t2, t1;
+
+
+--echo #
+--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