MDEV-4877 mysqldump dumps all data from a connect table
This commit is contained in:
parent
89e71ffb40
commit
727c1f62a5
@ -5144,6 +5144,7 @@ char check_if_ignore_table(const char *table_name, char *table_type)
|
|||||||
if (!opt_no_data &&
|
if (!opt_no_data &&
|
||||||
(!my_strcasecmp(&my_charset_latin1, table_type, "MRG_MyISAM") ||
|
(!my_strcasecmp(&my_charset_latin1, table_type, "MRG_MyISAM") ||
|
||||||
!strcmp(table_type,"MRG_ISAM") ||
|
!strcmp(table_type,"MRG_ISAM") ||
|
||||||
|
!strcmp(table_type,"CONNECT") ||
|
||||||
!strcmp(table_type,"FEDERATED")))
|
!strcmp(table_type,"FEDERATED")))
|
||||||
result= IGNORE_DATA;
|
result= IGNORE_DATA;
|
||||||
}
|
}
|
||||||
|
@ -217,3 +217,24 @@ t2 CREATE TABLE `t2` (
|
|||||||
SELECT * FROM t2;
|
SELECT * FROM t2;
|
||||||
a
|
a
|
||||||
DROP TABLE t2, t1;
|
DROP TABLE t2, t1;
|
||||||
|
#
|
||||||
|
# MDEV-4877 mysqldump dumps all data from a connect table
|
||||||
|
#
|
||||||
|
CREATE TABLE t1 (a INT);
|
||||||
|
INSERT INTO t1 VALUES (10),(20),(30);
|
||||||
|
CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL CONNECTION='mysql://root@localhost:PORT/test/t1';
|
||||||
|
SELECT * FROM t2;
|
||||||
|
a
|
||||||
|
10
|
||||||
|
20
|
||||||
|
30
|
||||||
|
# Start of mysqldump ------
|
||||||
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||||
|
/*!40101 SET character_set_client = utf8 */;
|
||||||
|
CREATE TABLE `t2` (
|
||||||
|
`a` int(11) DEFAULT NULL
|
||||||
|
) ENGINE=CONNECT DEFAULT CHARSET=latin1 CONNECTION='mysql://root@localhost:PORT/test/t1' `TABLE_TYPE`='MYSQL';
|
||||||
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
|
# End of mysqldump ------
|
||||||
|
DROP TABLE t2;
|
||||||
|
DROP TABLE t1;
|
||||||
|
@ -420,3 +420,17 @@ DROP TABLE t2, t1;
|
|||||||
# TODO: add test for YEAR
|
# TODO: add test for YEAR
|
||||||
# TODO: add tests for fractional seconds
|
# TODO: add tests for fractional seconds
|
||||||
|
|
||||||
|
--echo #
|
||||||
|
--echo # MDEV-4877 mysqldump dumps all data from a connect table
|
||||||
|
--echo #
|
||||||
|
CREATE TABLE t1 (a INT);
|
||||||
|
INSERT INTO t1 VALUES (10),(20),(30);
|
||||||
|
--replace_result $PORT PORT
|
||||||
|
--eval CREATE TABLE t2 ENGINE=CONNECT TABLE_TYPE=MYSQL CONNECTION='mysql://root@localhost:$PORT/test/t1'
|
||||||
|
SELECT * FROM t2;
|
||||||
|
--echo # Start of mysqldump ------
|
||||||
|
--replace_result $PORT PORT
|
||||||
|
--exec $MYSQL_DUMP --compact test t2
|
||||||
|
--echo # End of mysqldump ------
|
||||||
|
DROP TABLE t2;
|
||||||
|
DROP TABLE t1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user