Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.0.8, 10.4(EOL), 10.5, 10.6, 10.11, 11.0(EOL), 11.1(EOL), 11.2(EOL), 11.3(EOL), 11.4
Description
In the provided test case, before I run INSERT, I execute a seemingly harmless, albeit useless, ALTER on a non-existent table, which expectedly fails with ER_NO_SUCH_TABLE.
But after that, the next INSERT on the existing table fails with ER_WRONG_PARTITION_NAME. It is expected to fail, but without the previous unrelated ALTER it fails with ER_NO_PARTITION_FOR_GIVEN_VALUE.
It wouldn't be so bad, but the whole sequence is executed on a master, the failed ALTER isn't written to the binary log, but INSERT might be, for example if it's run on a non-transactional table. In this case INSERT is written with ER_WRONG_PARTITION_NAME, but on a slave it causes ER_NO_PARTITION_FOR_GIVEN_VALUE, and this discrepancy causes replication failure.
--source include/have_partition.inc
|
--source include/master-slave.inc
|
--source include/have_binlog_format_statement.inc
|
|
CREATE TABLE IF NOT EXISTS t1 (a INT) |
ENGINE=MyISAM
|
PARTITION BY LIST(a) ( |
PARTITION p0 VALUES IN (9, NULL), |
PARTITION p1 VALUES IN (8, 2, 7), |
PARTITION p2 VALUES IN (6, 4, 5), |
PARTITION p3 VALUES IN (3, 1, 0) |
);
|
ALTER TABLE t1 DROP PARTITION p0; |
|
####### Game changer
|
--error ER_NO_SUCH_TABLE
|
ALTER TABLE non_existent TRUNCATE PARTITION p1,p2; |
#######
|
|
--error ER_NO_PARTITION_FOR_GIVEN_VALUE,ER_WRONG_PARTITION_NAME
|
INSERT INTO t1 PARTITION (p1,p2,p3) VALUES (0),(9); |
SHOW WARNINGS;
|
|
--sync_slave_with_master
|
140305 23:11:27 [ERROR] Slave SQL: Query caused different errors on master and slave. Error on master: message (format)='Incorrect partition name' error code=1567 ; Error on slave: actual message='Table has no partition for value 9', error code=1526. Default database: 'test'. Query: 'INSERT INTO t1 PARTITION (p1,p2,p3) VALUES (0),(9)', Internal MariaDB error code: 0
|
140305 23:11:27 [ERROR] Slave SQL: Table has no partition for value 9, Internal MariaDB error code: 1526
|
Attachments
Issue Links
Activity
Field | Original Value | New Value |
---|---|---|
Link | This issue relates to TODO-224 [ TODO-224 ] |
Remote Link | This issue links to "Bug #71947 - Unexpected change in error code on INSERT .. PARTITION causes replication abort (Web Link)" [ 15403 ] |
Fix Version/s | 10.0.11 [ 15200 ] | |
Fix Version/s | 10.0.10 [ 14500 ] |
Fix Version/s | 10.0.12 [ 15201 ] | |
Fix Version/s | 10.0.11 [ 15200 ] |
Workflow | defaullt [ 35818 ] | MariaDB v2 [ 43481 ] |
Fix Version/s | 10.0.13 [ 16000 ] | |
Fix Version/s | 10.0.12 [ 15201 ] |
Workflow | MariaDB v2 [ 43481 ] | MariaDB v3 [ 63615 ] |
Workflow | MariaDB v3 [ 63615 ] | MariaDB v4 [ 139594 ] |
Fix Version/s | 10.0 [ 16000 ] |
Component/s | Replication [ 10100 ] | |
Fix Version/s | 10.4 [ 22408 ] | |
Fix Version/s | 10.5 [ 23123 ] | |
Fix Version/s | 10.6 [ 24028 ] | |
Fix Version/s | 10.11 [ 27614 ] | |
Fix Version/s | 11.0 [ 28320 ] | |
Fix Version/s | 11.1 [ 28549 ] | |
Fix Version/s | 11.2 [ 28603 ] | |
Fix Version/s | 11.3 [ 28565 ] | |
Affects Version/s | 10.4 [ 22408 ] | |
Affects Version/s | 10.5 [ 23123 ] | |
Affects Version/s | 10.6 [ 24028 ] | |
Affects Version/s | 10.11 [ 27614 ] | |
Affects Version/s | 11.0 [ 28320 ] | |
Affects Version/s | 11.1 [ 28549 ] | |
Affects Version/s | 11.2 [ 28603 ] | |
Affects Version/s | 11.3 [ 28565 ] | |
Affects Version/s | 11.4 [ 29301 ] | |
Assignee | Andrei Elkin [ elkin ] |
Fix Version/s | 11.0 [ 28320 ] | |
Fix Version/s | 11.3 [ 28565 ] |
Fix Version/s | 10.4 [ 22408 ] |
Fix Version/s | 11.1 [ 28549 ] |
Fix Version/s | 11.2(EOL) [ 28603 ] |
Assignee | Andrei Elkin [ elkin ] | Kristian Nielsen [ knielsen ] |
Status | Open [ 1 ] | In Progress [ 3 ] |
Fix Version/s | 10.5.28 [ 29952 ] | |
Fix Version/s | 10.5 [ 23123 ] | |
Fix Version/s | 10.6 [ 24028 ] | |
Fix Version/s | 10.11 [ 27614 ] | |
Priority | Minor [ 4 ] | Critical [ 2 ] |
Resolution | Fixed [ 1 ] | |
Status | In Progress [ 3 ] | Closed [ 6 ] |
Fix Version/s | 10.6.21 [ 29953 ] | |
Fix Version/s | 10.11.11 [ 29954 ] | |
Fix Version/s | 11.4.5 [ 29956 ] | |
Fix Version/s | 11.7.2 [ 29914 ] |
Still reproducible on all existing versions.
I can't say whether it's reproducible on MySQL 8.x, as it refuses to create a partitioned MyISAM table in the provided test case.
Please also note the strangely looking error text (the "(format)" part):
Error on master: message (format)='Incorrect partition name'
Not sure whether it's a typo or it's trying to say something which I don't understand.