#At file:///home/satya/WORK/mysql-5.0-bugteam-21360/ based on revid:patrick.crews@stripped
2775 Satya B 2009-03-19
Fix for BUG#21360 - mysqldump error on federated tables
When loading dump created by mysqldump tool an error is
thrown saying storage engine for the table doesn't have
an option.
mysqldump tries to re-insert the data into the federated
table which causes the error. Since the data is already
available on the remote server, mysqldump shouldn't try
to dump the data again for FEDERATED tables.
As stated in the bug page, it can be considered similar
to the MERGE ENGINE with "view only" nature.
Fixed by adding the "FEDERATED ENGINE" to the exception
list to ignore the data.
modified:
client/mysqldump.c
mysql-test/r/federated.result
mysql-test/t/federated.test
per-file messages:
client/mysqldump.c
Fixed check_if_ignore_table() to ignore FEDERATED engine
when dumping the table data.
mysql-test/r/federated.result
Result file for BUG#21360
mysql-test/t/federated.test
Testcase for BUG#21360
=== modified file 'client/mysqldump.c'
--- a/client/mysqldump.c 2009-03-10 16:53:43 +0000
+++ b/client/mysqldump.c 2009-03-19 06:06:37 +0000
@@ -3576,7 +3576,8 @@ char check_if_ignore_table(const char *t
If these two types, we do want to skip dumping the table
*/
if (!opt_no_data &&
- (!strcmp(table_type,"MRG_MyISAM") || !strcmp(table_type,"MRG_ISAM")))
+ (!strcmp(table_type,"MRG_MyISAM") || !strcmp(table_type,"MRG_ISAM") ||
+ !strcmp(table_type,"FEDERATED")))
result= IGNORE_DATA;
}
mysql_free_result(res);
=== modified file 'mysql-test/r/federated.result'
--- a/mysql-test/r/federated.result 2008-11-14 07:42:29 +0000
+++ b/mysql-test/r/federated.result 2009-03-19 06:06:37 +0000
@@ -2094,6 +2094,26 @@ SELECT t1.a FROM t1, t1 as t2 WHERE t2.b
a
DROP TABLE t1;
DROP TABLE t1;
+#
+# BUG#21360 - mysqldump error on federated tables
+#
+#Switch to Connection Slave
+CREATE TABLE t1(id VARCHAR(20) NOT NULL, PRIMARY KEY(id));
+INSERT INTO t1 VALUES ('text1'),('text2'),('text3'),('text4');
+#Switch to Connection Master
+CREATE TABLE t1(id VARCHAR(20) NOT NULL, PRIMARY KEY(id)) ENGINE=FEDERATED
+CONNECTION='mysql://root@stripped:SLAVE_PORT/test/t1';
+# Dump table t1 using mysqldump tool
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `t1` (
+ `id` varchar(20) NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=FEDERATED DEFAULT CHARSET=latin1 CONNECTION='mysql://root@stripped:SLAVE_PORT/test/t1';
+/*!40101 SET character_set_client = @saved_cs_client */;
+DROP TABLE t1;
+#Switch to Connection Slave
+DROP TABLE t1;
End of 5.0 tests
SET @@GLOBAL.CONCURRENT_INSERT= @OLD_MASTER_CONCURRENT_INSERT;
SET @@GLOBAL.CONCURRENT_INSERT= @OLD_SLAVE_CONCURRENT_INSERT;
=== modified file 'mysql-test/t/federated.test'
--- a/mysql-test/t/federated.test 2008-11-14 07:42:29 +0000
+++ b/mysql-test/t/federated.test 2009-03-19 06:06:37 +0000
@@ -1843,6 +1843,28 @@ DROP TABLE t1;
connection master;
DROP TABLE t1;
+--echo #
+--echo # BUG#21360 - mysqldump error on federated tables
+--echo #
+connection slave;
+--echo #Switch to Connection Slave
+CREATE TABLE t1(id VARCHAR(20) NOT NULL, PRIMARY KEY(id));
+INSERT INTO t1 VALUES ('text1'),('text2'),('text3'),('text4');
+
+connection master;
+--echo #Switch to Connection Master
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+eval CREATE TABLE t1(id VARCHAR(20) NOT NULL, PRIMARY KEY(id)) ENGINE=FEDERATED
+ CONNECTION='mysql://root@stripped:$SLAVE_MYPORT/test/t1';
+--echo # Dump table t1 using mysqldump tool
+--replace_result $SLAVE_MYPORT SLAVE_PORT
+--exec $MYSQL_DUMP --compact test t1
+DROP TABLE t1;
+
+connection slave;
+--echo #Switch to Connection Slave
+DROP TABLE t1;
+
connection default;
--echo End of 5.0 tests
Thread |
---|
• bzr commit into mysql-5.0-bugteam branch (satya.bn:2775) Bug#21360 | Satya B | 19 Mar |