Bug #74841 handle_fatal_signal (sig=11) in cmp_rec_and_tuple | sql/sql_partition.cc:7610
Submitted: 13 Nov 2014 17:36 Modified: 10 Mar 2015 17:55
Reporter: Ramesh Sivaraman (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Partitions Severity:S3 (Non-critical)
Version:5.6.21-debug/5.7-debug OS:Linux (CentOS 7)
Assigned to: CPU Architecture:Any

[13 Nov 2014 17:36] Ramesh Sivaraman
Description:
#0  0x00007f6102626771 in pthread_kill () from /lib64/libpthread.so.0
#1  0x0000000000a954ea in my_write_core (sig=11) at /ssd/ramesh/mysql-server/mysql-5.6/mysys/stacktrace.c:422
#2  0x0000000000726494 in handle_fatal_signal (sig=11) at /ssd/ramesh/mysql-server/mysql-5.6/sql/signal_handler.cc:230
#3  <signal handler called>
#4  0x00000000009ca297 in cmp_rec_and_tuple (val=0x7f605d9505f8, nvals_in_rec=1) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_partition.cc:7610
#5  0x00000000009c1a76 in get_partition_id_list_col (part_info=0x7f605d89a8f8, part_id=0x7f6102bda9b8, func_value=0x7f6102bda9b0) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_partition.cc:3159
#6  0x0000000000972995 in partition_info::set_used_partition (this=0x7f605d89a8f8, fields=..., values=..., info=..., copy_default_values=true, used_partitions=0x7f6102bdaa70) at /ssd/ramesh/mysql-server/mysql-5.6/sql/partition_info.cc:484
#7  0x00000000007b189a in mysql_insert (thd=0x7f606f35d000, table_list=0x7f605d81f0f8, fields=..., values_list=..., update_fields=..., update_values=..., duplic=DUP_ERROR, ignore=false) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_insert.cc:817
#8  0x00000000007d43b7 in mysql_execute_command (thd=0x7f606f35d000) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_parse.cc:3443
#9  0x00000000007dbdbc in mysql_parse (thd=0x7f606f35d000, rawbuf=0x7f605d81f010 "INSERT INTO t1 VALUES(),()", length=26, parser_state=0x7f6102bdbe70) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_parse.cc:6245
#10 0x00000000007cf36f in dispatch_command (command=COM_QUERY, thd=0x7f606f35d000, packet=0x7f6063e66001 "INSERT INTO t1 VALUES(),()", packet_length=26) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_parse.cc:1332
#11 0x00000000007ce45e in do_command (thd=0x7f606f35d000) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_parse.cc:1034
#12 0x0000000000796879 in do_handle_one_connection (thd_arg=0x7f606f35d000) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_connect.cc:982
#13 0x0000000000796362 in handle_one_connection (arg=0x7f606f35d000) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_connect.cc:898
#14 0x0000000000d71288 in pfs_spawn_thread (arg=0x7f60febfea60) at /ssd/ramesh/mysql-server/mysql-5.6/storage/perfschema/pfs.cc:1860
#15 0x00007f6102621df3 in start_thread () from /lib64/libpthread.so.0
#16 0x00007f61014f301d in clone () from /lib64/libc.so.6

How to repeat:
DROP DATABASE test;CREATE DATABASE test;USE test;
CREATE TABLE t2(id1 INT);
create table t1(a INT,b binary);
lock table t1 write,t2 write,t1 as t1_2 write,t2 as t2_2 write;
ALTER TABLE t1 PARTITION BY LIST COLUMNS(a)(PARTITION p1 VALUES IN (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20));
ALTER TABLE t1 ADD PARTITION(PARTITION part_2 VALUES IN (21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40));
ALTER TABLE t1 ADD PARTITION(PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40));
INSERT INTO t1 VALUES(),();
[13 Nov 2014 18:26] Godofredo Miguel Solorzano
C:\dbs>c:\dbs\5.7\bin\mysql -uroot --port=3570 --prompt="mysql 5.7 > "
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.7.6-m16-debug Source distribution

Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql 5.7 > DROP DATABASE test;CREATE DATABASE test;USE test;
Query OK, 2 rows affected (0.41 sec)

Query OK, 1 row affected (0.00 sec)

Database changed
mysql 5.7 > CREATE TABLE t2(id1 INT);
Query OK, 0 rows affected (0.19 sec)

mysql 5.7 > create table t1(a INT,b binary);
Query OK, 0 rows affected (0.23 sec)

mysql 5.7 > lock table t1 write,t2 write,t1 as t1_2 write,t2 as t2_2 write;
Query OK, 0 rows affected (0.00 sec)

mysql 5.7 > ALTER TABLE t1 PARTITION BY LIST COLUMNS(a)(PARTITION p1 VALUES IN (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20));
Query OK, 0 rows affected (0.58 sec)
Records: 0  Duplicates: 0  Warnings: 0

mysql 5.7 > ALTER TABLE t1 ADD PARTITION(PARTITION part_2 VALUES IN (21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40));
Query OK, 0 rows affected (0.86 sec)
Records: 0  Duplicates: 0  Warnings: 0

mysql 5.7 > ALTER TABLE t1 ADD PARTITION(PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40));
ERROR 1495 (HY000): Multiple definition of same constant in list partitioning
mysql 5.7 > INSERT INTO t1 VALUES(),();
ERROR 2013 (HY000): Lost connection to MySQL server during query
[13 Nov 2014 18:28] Godofredo Miguel Solorzano
Thank you for the bug report.

Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
13f74f675    mysqld.exe!cmp_rec_and_tuple()[sql_partition.cc:7624]
13f74cf11    mysqld.exe!get_partition_id_list_col()[sql_partition.cc:3130]
13f6f511a    mysqld.exe!partition_info::set_used_partition()[partition_info.cc:488]
13f6d1f24    mysqld.exe!mysql_insert()[sql_insert.cc:468]
13f2a7dd3    mysqld.exe!mysql_execute_command()[sql_parse.cc:3338]
13f2a450a    mysqld.exe!mysql_parse()[sql_parse.cc:5397]
13f2adef8    mysqld.exe!dispatch_command()[sql_parse.cc:1252]
13f2ad09c    mysqld.exe!do_command()[sql_parse.cc:833]
13f120c3c    mysqld.exe!handle_connection()[connection_handler_per_thread.cc:298]
13fe727b8    mysqld.exe!pfs_spawn_thread()[pfs.cc:2139]
13f8deca6    mysqld.exe!pthread_start()[my_winthread.c:73]
13ffe03a5    mysqld.exe!_callthreadstartex()[threadex.c:376]
13ffe05f7    mysqld.exe!_threadstartex()[threadex.c:359]
775159ed    kernel32.dll!BaseThreadInitThunk()
7764c541    ntdll.dll!RtlUserThreadStart()
[23 Feb 2015 9:11] Mattias Jonsson
Posted by developer:
 
Base bug fixed and pushed which also fixes this bug and included the test case from here.
[27 Feb 2015 9:26] Roel Van de Paar
Thank you Mattias! What version is the bugfix in?
[10 Mar 2015 17:55] Jon Stephens
Documented fix in the 5.6.24 and 5.7.7 changelogs, as follows:

    A number of ALTER TABLE statements that attempted to add a
    partition, column, or index to a partitioned table while a write
    lock was in effect for this table were not handled correctly.

Also fixes BUG#74451, BUG#74478, BUG#74491, BUG#74560, BUG#74746, BUG#74860, and BUG#74869.

Closed.
[16 Mar 2015 12:36] Daniel Price
Posted by developer:
 
The base bug under which this bug is fixed (Bug #19856162 / MySQL Bug #74451) is also fixed in trunk (5.8.0). The changelog entry has been updated to include the 5.8.0 version number.