diff options
author | Elena Stepanova <elenst@montyprogram.com> | 2015-11-13 03:23:22 +0200 |
---|---|---|
committer | Elena Stepanova <elenst@montyprogram.com> | 2015-11-13 03:23:22 +0200 |
commit | 2828c2be554b62646fc990ac28b4aef20cd9b9d2 (patch) | |
tree | ad6aac641f5ee1704d3bf0eae28b774b0da17294 /mysql-test/t/mysqldump.test | |
parent | a430df3aba59c57b0756c25b1586d880d19286df (diff) | |
download | mariadb-git-2828c2be554b62646fc990ac28b4aef20cd9b9d2.tar.gz |
MDEV-9124 mysqldump does not dump data if table name is same as view earlier on
While querying INFORMATION SCHEMA, check for a table's engine
only used table name, but not schema name; so, if there were different
rows with the same table name, a wrong one could be retrieved.
The result of the check affected the decision whether the contents
of the table should be dumped, and whether a DELAYED option can be used.
Fixed by adding a clause for table_schema to the query.
Diffstat (limited to 'mysql-test/t/mysqldump.test')
-rw-r--r-- | mysql-test/t/mysqldump.test | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 2b9d1e78219..684e3ec691a 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -2516,3 +2516,38 @@ drop table t1; --remove_file $MYSQLTEST_VARDIR/tmp/mysqldump-test.out #select * from mysql.user; #checksum table mysql.user; + +--echo # +--echo # MDEV-9124 mysqldump does not dump data if table name is same as view earlier on +--echo # + +CREATE DATABASE db1 CHARSET=utf8; +CREATE DATABASE db2 CHARSET=utf8; +USE db2; +CREATE TABLE nonunique_table_name (i1 serial) ENGINE=MEMORY; +INSERT INTO nonunique_table_name VALUES (1),(2); +CREATE TABLE nonunique_table_view_name (i2 int) ENGINE=InnoDB; +INSERT INTO nonunique_table_view_name VALUES (3),(4); +use db1; +CREATE TABLE basetable (id smallint) ENGINE=MyISAM; +CREATE TABLE nonunique_table_name (i3 smallint) ENGINE=MERGE UNION (basetable) INSERT_METHOD=LAST; +INSERT INTO nonunique_table_name VALUES (5),(6); +CREATE VIEW nonunique_table_view_name AS SELECT 1; + +--echo +--echo ################################################## +--echo # --compact --databases db1 db2 +--exec $MYSQL_DUMP --compact --databases db1 db2 +--echo +--echo ################################################## +--echo # --compact db2 +--echo +--exec $MYSQL_DUMP --compact db2 +--echo +--echo ################################################## +--echo # --compact --delayed-insert --no-data-med=0 --databases db2 db1 +--exec $MYSQL_DUMP --compact --delayed-insert --no-data-med=0 --databases db2 db1 +--echo + +DROP DATABASE db1; +DROP DATABASE db2; |