Description:
Found during RQG testing
mysql-trunk
commit 024a2c67ce842c9aeae8e6039972d63487ba84fa (Apr 22)
5.8.0-m17-debug-log
mysqld: <tree>/sql/partitioning/partition_handler.cc:1891: int Partition_helper::ph_rnd_init(bool): Assertion `0' failed.
13:50:54 UTC - mysqld got signal 6 ;
...
Query (7f4f80192430): DELETE A FROM t1 AS A WHERE A.pk IN ( SELECT pk FROM t1_part AS B WHERE B.pk = A.pk )
Connection ID (thread ID): 3
Status: NOT_KILLED
#0 pthread_kill () from /lib64/libpthread.so.0
#0 pthread_kill () from /lib64/libpthread.so.0
#1 my_write_core (sig=6)
at <tree>/mysys/stacktrace.c:247
#2 handle_fatal_signal (sig=6)
at <tree>/sql/signal_handler.cc:221
#3 <signal handler called>
#4 raise () from /lib64/libc.so.6
#5 abort () from /lib64/libc.so.6
#6 __assert_fail_base () from /lib64/libc.so.6
#7 __assert_fail () from /lib64/libc.so.6
#8 Partition_helper::ph_rnd_init (this=0x7f4f8000ca20, scan=true)
at <tree>/sql/partitioning/partition_handler.cc:1891
#9 ha_innopart::rnd_init (this=0x7f4f8000c740, scan=true)
at <tree>/storage/innobase/handler/ha_innopart.h:1077
#10 handler::ha_rnd_init (this=0x7f4f8000c740, scan=true)
at <tree>/sql/handler.cc:2558
#11 init_read_record (info=0x7f4f80292550, thd=0x7f4f800120d0, table=0x7f4f80006530, qep_tab=0x7f4f80292500, use_record_cache=1, print_error=true, disable_rr_cache=false)
at <tree>/sql/records.cc:316
#12 join_init_read_record (tab=0x7f4f80292500)
at <tree>/sql/sql_executor.cc:2454
#13 sub_select (join=0x7f4f80291160, qep_tab=0x7f4f80292500, end_of_records=false)
at <tree>/sql/sql_executor.cc:1275
#14 evaluate_join_record (join=0x7f4f80291160, qep_tab=0x7f4f80292388)
at <tree>/sql/sql_executor.cc:1640
#15 sub_select (join=0x7f4f80291160, qep_tab=0x7f4f80292388, end_of_records=false)
at <tree>/sql/sql_executor.cc:1295
#16 do_select (join=0x7f4f80291160)
at <tree>/sql/sql_executor.cc:948
#17 JOIN::exec (this=0x7f4f80291160)
at <tree>/sql/sql_executor.cc:210
#18 handle_query (thd=0x7f4f800120d0, lex=0x7f4f80014210, result=0x7f4f80304f10, added_options=1342177408, removed_options=131072)
at <tree>/sql/sql_select.cc:188
#19 Sql_cmd_delete_multi::execute (this=0x7f4f80304e58, thd=0x7f4f800120d0)
at <tree>/sql/sql_delete.cc:1404
#20 mysql_execute_command (thd=0x7f4f800120d0)
at <tree>/sql/sql_parse.cc:3196
#21 mysql_parse (thd=0x7f4f800120d0, parser_state=0x7f4fdce47e50)
at <tree>/sql/sql_parse.cc:5165
#22 dispatch_command (thd=0x7f4f800120d0, com_data=0x7f4fdce48e00, command=COM_QUERY)
at <tree>/sql/sql_parse.cc:1247
#23 do_command (thd=0x7f4f800120d0)
at <tree>/sql/sql_parse.cc:816
#24 handle_connection (arg=0x4d86020)
at <tree>/sql/conn_handler/connection_handler_per_thread.cc:300
#25 pfs_spawn_thread (arg=0x4d27ab0)
at <tree>/storage/perfschema/pfs.cc:2147
#26 start_thread () from /lib64/libpthread.so.0
#27 clone () from /lib64/libc.so.6
How to repeat:
CREATE TABLE t1 (pk INT) ;
INSERT INTO t1 VALUES (1), (2);
COMMIT;
CREATE TABLE t1_part ENGINE = InnoDB PARTITION BY KEY (pk) PARTITIONS 2 AS
SELECT * FROM t1;
# harmless, harvests error 1093
# DELETE A FROM t1 AS A WHERE A.pk IN
# ( SELECT pk FROM t1 AS B WHERE B.pk = A.pk );
# No assert
# DELETE A FROM t1_part AS A WHERE A.pk IN
# ( SELECT pk FROM t1 AS B WHERE B.pk = A.pk );
# Get the assert
DELETE A FROM t1 AS A WHERE A.pk IN
( SELECT pk FROM t1_part AS B WHERE B.pk = A.pk );
DROP TABLE t1;
DROP TABLE t1_part;