|
|
Test case for `part_id == m_last_part' in ha_partition::delete_row
|
--source include/have_partition.inc
|
--source include/have_innodb.inc
|
|
CREATE TABLE t1 (pk INT PRIMARY KEY, f INT) ENGINE=InnoDB WITH SYSTEM VERSIONING PARTITION BY KEY() PARTITIONS 2;
|
INSERT INTO t1 VALUES (1,10),(2,20);
|
ALTER TABLE t1 DROP SYSTEM VERSIONING;
|
DELETE FROM t1;
|
|
# Cleanup
|
DROP TABLE t1;
|
|
10.3 95f3c142a
|
mysqld: /data/src/10.3/sql/ha_partition.cc:4528: virtual int ha_partition::delete_row(const uchar*): Assertion `part_id == m_last_part' failed.
|
181202 13:45:19 [ERROR] mysqld got signal 6 ;
|
|
#7 0x00007f4a9a879ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
|
#8 0x00005582f3d2b7e0 in ha_partition::delete_row (this=0x7f4a400a5d58, buf=0x7f4a400a7978 "\375\002") at /data/src/10.3/sql/ha_partition.cc:4528
|
#9 0x00005582f35d6024 in handler::ha_delete_row (this=0x7f4a400a5d58, buf=0x7f4a400a7978 "\375\002") at /data/src/10.3/sql/handler.cc:6325
|
#10 0x00005582f376db5b in TABLE::delete_row (this=0x7f4a400a5110) at /data/src/10.3/sql/sql_delete.cc:253
|
#11 0x00005582f376ad91 in mysql_delete (thd=0x7f4a40000b00, table_list=0x7f4a40014da0, conds=0x0, order_list=0x7f4a40005398, limit=18446744073709551614, options=0, result=0x0) at /data/src/10.3/sql/sql_delete.cc:753
|
#12 0x00005582f32d26cd in mysql_execute_command (thd=0x7f4a40000b00) at /data/src/10.3/sql/sql_parse.cc:4924
|
#13 0x00005582f32dc7cb in mysql_parse (thd=0x7f4a40000b00, rawbuf=0x7f4a40014cd8 "DELETE FROM t1", length=14, parser_state=0x7f4a9441f5f0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:8091
|
#14 0x00005582f32c997f in dispatch_command (command=COM_QUERY, thd=0x7f4a40000b00, packet=0x7f4a40161121 "DELETE FROM t1", packet_length=14, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1850
|
#15 0x00005582f32c83a3 in do_command (thd=0x7f4a40000b00) at /data/src/10.3/sql/sql_parse.cc:1395
|
#16 0x00005582f34300a0 in do_handle_one_connection (connect=0x5582f684f4d0) at /data/src/10.3/sql/sql_connect.cc:1402
|
#17 0x00005582f342fe24 in handle_one_connection (arg=0x5582f684f4d0) at /data/src/10.3/sql/sql_connect.cc:1308
|
#18 0x00005582f38ca41d in pfs_spawn_thread (arg=0x5582f6890dc0) at /data/src/10.3/storage/perfschema/pfs.cc:1862
|
#19 0x00007f4a9c335494 in start_thread (arg=0x7f4a94420700) at pthread_create.c:333
|
#20 0x00007f4a9a93693f in clone () from /lib/x86_64-linux-gnu/libc.so.6
|
|
Test case for `old_part_id == m_last_part' in ha_partition::update_row
|
--source include/have_partition.inc
|
--source include/have_innodb.inc
|
|
CREATE TABLE t1 (pk INT PRIMARY KEY, f INT) ENGINE=InnoDB WITH SYSTEM VERSIONING PARTITION BY KEY() PARTITIONS 2;
|
INSERT INTO t1 VALUES (1,10),(2,20);
|
ALTER TABLE t1 DROP SYSTEM VERSIONING;
|
UPDATE t1 SET f=pk;
|
|
# Cleanup
|
DROP TABLE t1;
|
|
10.3 95f3c142a
|
mysqld: /data/src/10.3/sql/ha_partition.cc:4383: virtual int ha_partition::update_row(const uchar*, const uchar*): Assertion `old_part_id == m_last_part' failed.
|
181202 13:46:42 [ERROR] mysqld got signal 6 ;
|
|
#7 0x00007fd1840e3ee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
|
#8 0x0000560ae9e1f1d9 in ha_partition::update_row (this=0x7fd1280a5d58, old_data=0x7fd1280a7988 "\375\002", new_data=0x7fd1280a7978 "\375\002") at /data/src/10.3/sql/ha_partition.cc:4383
|
#9 0x0000560ae96c9c3d in handler::ha_update_row (this=0x7fd1280a5d58, old_data=0x7fd1280a7988 "\375\002", new_data=0x7fd1280a7978 "\375\002") at /data/src/10.3/sql/handler.cc:6269
|
#10 0x0000560ae94bd8ba in mysql_update (thd=0x7fd128000b00, table_list=0x7fd128014db0, fields=..., values=..., conds=0x0, order_num=0, order=0x0, limit=18446744073709551614, handle_duplicates=DUP_ERROR, ignore=false, found_return=0x7fd17d4286f0, updated_return=0x7fd17d4287b0) at /data/src/10.3/sql/sql_update.cc:947
|
#11 0x0000560ae93c53af in mysql_execute_command (thd=0x7fd128000b00) at /data/src/10.3/sql/sql_parse.cc:4580
|
#12 0x0000560ae93d07cb in mysql_parse (thd=0x7fd128000b00, rawbuf=0x7fd128014cd8 "UPDATE t1 SET f=pk", length=18, parser_state=0x7fd17d4295f0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:8091
|
#13 0x0000560ae93bd97f in dispatch_command (command=COM_QUERY, thd=0x7fd128000b00, packet=0x7fd128161121 "UPDATE t1 SET f=pk", packet_length=18, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1850
|
#14 0x0000560ae93bc3a3 in do_command (thd=0x7fd128000b00) at /data/src/10.3/sql/sql_parse.cc:1395
|
#15 0x0000560ae95240a0 in do_handle_one_connection (connect=0x560aec343250) at /data/src/10.3/sql/sql_connect.cc:1402
|
#16 0x0000560ae9523e24 in handle_one_connection (arg=0x560aec343250) at /data/src/10.3/sql/sql_connect.cc:1308
|
#17 0x0000560ae99be41d in pfs_spawn_thread (arg=0x560aec384b40) at /data/src/10.3/storage/perfschema/pfs.cc:1862
|
#18 0x00007fd185b9f494 in start_thread (arg=0x7fd17d42a700) at pthread_create.c:333
|
#19 0x00007fd1841a093f in clone () from /lib/x86_64-linux-gnu/libc.so.6
|
|
|
Second time I see how system versioning reveals interesting server's corner cases.
The thing is to catch both rows in same partition:
CREATE OR REPLACE TABLE t1 (pk INT, f INT, primary key(pk, f))
|
ENGINE=InnoDB PARTITION BY KEY() PARTITIONS 2;
|
INSERT INTO t1 VALUES (1,10),(2,11);
|
SELECT * FROM t1 PARTITION (P0);
|
+----+----+
|
| pk | f |
|
+----+----+
|
| 1 | 10 |
|
| 2 | 11 |
|
+----+----+
|
ALTER TABLE t1 DROP PRIMARY KEY, DROP F, ADD PRIMARY KEY(PK);
|
SELECT * FROM t1 PARTITION(P0);
|
+----+
|
| pk |
|
+----+
|
| 1 |
|
| 2 | -- <--- should not be here!!
|
+----+
|
2 rows in set (0.001 sec)
|
|
DELETE FROM t1; # fails
|
ALTER algorithm is chosen to be INPLACE, which seems to be incorrect since we have to repartition the table.
|