mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-5798: Wrong errorcode for missing partition after TRUNCATE PARTITION
The partitioning error handling code was looking at thd->lex->alter_info.partition_flags in non-alter-table cases, in which cases the value is stale and contains whatever was set by any earlier ALTER TABLE. This could cause the wrong error code to be generated, which then in some cases can cause replication to break with "different errorcode" error. Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
This commit is contained in:
@@ -142,9 +142,26 @@ SELECT * FROM test.regular_tbl ORDER BY fkid DESC LIMIT 2;
|
||||
id dt user uuidf fkid filler
|
||||
1 date-time USER UUID 300 Partitioned table! Going to test replication for MySQL
|
||||
2 date-time USER UUID 299 Partitioned table! Going to test replication for MySQL
|
||||
*** MDEV-5798: Wrong errorcode for missing partition after TRUNCATE PARTITION
|
||||
connection master;
|
||||
CREATE TABLE t1 (a INT)
|
||||
ENGINE='InnoDB'
|
||||
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;
|
||||
ALTER TABLE non_existent TRUNCATE PARTITION p1,p2;
|
||||
ERROR 42S02: Table 'test.non_existent' doesn't exist
|
||||
INSERT INTO t1 PARTITION (p1,p2,p3) VALUES (0),(9);
|
||||
ERROR HY000: Table has no partition for value 9
|
||||
connection slave;
|
||||
connection master;
|
||||
DROP PROCEDURE test.proc_norm;
|
||||
DROP PROCEDURE test.proc_byrange;
|
||||
DROP TABLE test.regular_tbl;
|
||||
DROP TABLE test.byrange_tbl;
|
||||
DROP TABLE test.t1;
|
||||
include/rpl_end.inc
|
||||
|
Reference in New Issue
Block a user