Bug #30474 Extra master columns: dropping partition on master not on slave cause failure
Submitted: 17 Aug 2007 14:05 Modified: 4 Sep 2007 12:34
Reporter: Jonathan Miller Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version: OS:Linux
Assigned to: Lars Thalmann CPU Architecture:Any

[17 Aug 2007 14:05] Jonathan Miller
Description:
070817 16:59:09 [ERROR] Slave: Error 'Partition management on a not partitioned table is not possible' on query. Default database: 'test'. Query: 'ALTER TABLE t1 DROP PARTITION p5', Error_code: 1493
070817 16:59:09 [Warning] Slave: Partition management on a not partitioned table is not possible Error_code: 1493

How to repeat:
connection master;
--disable_warnings
DROP TABLE IF EXISTS t1;

--echo **** Partition RANGE testing ****
connection slave;
STOP SLAVE;
RESET SLAVE;

eval CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
                 bc CHAR(255), d DECIMAL(10,4) DEFAULT 0,
                 f FLOAT DEFAULT 0, total BIGINT UNSIGNED)ENGINE=$engine_type;

connection master;

eval CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
                 bc CHAR(255), d DECIMAL(10,4) DEFAULT 0,
                 f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
                 y YEAR, t DATE)ENGINE=$engine_type
                 PARTITION BY RANGE (YEAR(t))
                (PARTITION p0 VALUES LESS THAN (1901),
                 PARTITION p1 VALUES LESS THAN (1946),
                 PARTITION p2 VALUES LESS THAN (1966),
                 PARTITION p3 VALUES LESS THAN (1986),
                 PARTITION p4 VALUES LESS THAN (2005),
                 PARTITION p5 VALUES LESS THAN MAXVALUE);
RESET MASTER;

connection slave;
START SLAVE;

ALTER TABLE t1 DROP PARTITION p5;

sync_slave_with_master;

Suggested fix:
Issue warning
[17 Aug 2007 14:48] Jonathan Miller
Note: Test files attached to http://bugs.mysql.com/bug.php?id=30476
[17 Aug 2007 14:49] Jonathan Miller
Additional Note: (Miss copy)

The following:

connection slave;
START SLAVE;

ALTER TABLE t1 DROP PARTITION p5;

sync_slave_with_master;

Should be:
connection slave;
START SLAVE;

connection master;
ALTER TABLE t1 DROP PARTITION p5;

sync_slave_with_master;
[4 Sep 2007 12:34] Lars Thalmann
The drop partition statement can't execute on the slave since there is
no partitioned table there.  

If there are different table defintions on master and slave you need
to execute different DDL statements on the two servers (and you can
not simply replicate the statements just because the end result of a
statement is already what is present on the slave).

Not a bug.