Bug #74504 Assertion `map->bitmap && map2->bitmap && map->n_bits==map2->n_bits' failed
Submitted: 22 Oct 2014 12:09 Modified: 22 Oct 2014 12:33
Reporter: Ramesh Sivaraman Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DML Severity:S3 (Non-critical)
Version:5.6.20-debug OS:Linux (CentOS 7)
Assigned to: CPU Architecture:Any

[22 Oct 2014 12:09] Ramesh Sivaraman
Description:
mysqld: /ssd/ramesh/mysql-server/mysql-5.6/mysys/my_bitmap.c:483: bitmap_union: Assertion `map->bitmap && map2->bitmap && map->n_bits==map2->n_bits' fail
ed.
12:06:11 UTC - mysqld got signal 6 ;

***** GDB info

#0  0x00007f44b635e771 in pthread_kill () from /lib64/libpthread.so.0
#1  0x0000000000a9035e in my_write_core (sig=6) at /ssd/ramesh/mysql-server/mysql-5.6/mysys/stacktrace.c:422
#2  0x0000000000723688 in handle_fatal_signal (sig=6) at /ssd/ramesh/mysql-server/mysql-5.6/sql/signal_handler.cc:230
#3  <signal handler called>
#4  0x00007f44b516a5c9 in raise () from /lib64/libc.so.6
#5  0x00007f44b516bcd8 in abort () from /lib64/libc.so.6
#6  0x00007f44b5163536 in __assert_fail_base () from /lib64/libc.so.6
#7  0x00007f44b51635e2 in __assert_fail () from /lib64/libc.so.6
#8  0x0000000000a85ba2 in bitmap_union (map=0x7f4419893f18, map2=0x7f441987e6c0) at /ssd/ramesh/mysql-server/mysql-5.6/mysys/my_bitmap.c:482
#9  0x0000000000e09119 in ha_partition::external_lock (this=0x7f4419893b10, thd=0x7f4422f24000, lock_type=1) at /ssd/ramesh/mysql-server/mysql-5.6/sql/ha_partition.cc:3597
#10 0x0000000000641b21 in handler::ha_external_lock (this=0x7f4419893b10, thd=0x7f4422f24000, lock_type=1) at /ssd/ramesh/mysql-server/mysql-5.6/sql/handler.cc:7190
#11 0x0000000000934355 in lock_external (thd=0x7f4422f24000, tables=0x7f441981a488, count=1) at /ssd/ramesh/mysql-server/mysql-5.6/sql/lock.cc:362
#12 0x00000000009340a2 in mysql_lock_tables (thd=0x7f4422f24000, tables=0x7f441991b078, count=1, flags=18539) at /ssd/ramesh/mysql-server/mysql-5.6/sql/lock.cc:307
#13 0x0000000000764bad in Locked_tables_list::reopen_tables (this=0x7f4422f26018, thd=0x7f4422f24000) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_base.cc:3637
#14 0x00000000009c537b in handle_alter_part_error (lpt=0x7f44b6952c00, action_completed=true, drop_partition=false, frm_install=false, close_table=false) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_partition.cc:6845
#15 0x00000000009c65d8 in fast_alter_partition_table (thd=0x7f4422f24000, table=0x7f441984ee00, alter_info=0x7f44b6954650, create_info=0x7f44b69546e0, table_list=0x7f441981f108, db=0x7f441981f668 "test", table_name=0x7f441981f0d0 "t1") at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_partition.cc:7256
#16 0x0000000000841bd1 in mysql_alter_table (thd=0x7f4422f24000, new_db=0x7f441981f668 "test", new_name=0x0, create_info=0x7f44b69546e0, table_list=0x7f441981f108, alter_info=0x7f44b6954650, order_num=0, order=0x0, ignore=false) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_table.cc:8109
#17 0x000000000098177f in Sql_cmd_alter_table::execute (this=0x7f441981f678, thd=0x7f4422f24000) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_alter.cc:313
#18 0x00000000007d5ea3 in mysql_execute_command (thd=0x7f4422f24000) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_parse.cc:4945
#19 0x00000000007d8fa4 in mysql_parse (thd=0x7f4422f24000, rawbuf=0x7f441981f010 "ALTER TABLE t1 COALESCE PARTITION 1", length=35, parser_state=0x7f44b6955e70) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_parse.cc:6245
#20 0x00000000007cc557 in dispatch_command (command=COM_QUERY, thd=0x7f4422f24000, packet=0x7f4422f62001 "ALTER TABLE t1 COALESCE PARTITION 1", packet_length=35) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_parse.cc:1332
#21 0x00000000007cb646 in do_command (thd=0x7f4422f24000) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_parse.cc:1034
#22 0x0000000000793a61 in do_handle_one_connection (thd_arg=0x7f4422f24000) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_connect.cc:982
#23 0x000000000079354a in handle_one_connection (arg=0x7f4422f24000) at /ssd/ramesh/mysql-server/mysql-5.6/sql/sql_connect.cc:898
#24 0x0000000000ad4b5c in pfs_spawn_thread (arg=0x7f44afb38b00) at /ssd/ramesh/mysql-server/mysql-5.6/storage/perfschema/pfs.cc:1860
#25 0x00007f44b6359df3 in start_thread () from /lib64/libpthread.so.0
#26 0x00007f44b522b01d in clone () from /lib64/libc.so.6

How to repeat:
CREATE TABLE t1(a int)PARTITION BY KEY (a) (PARTITION x0,PARTITION x1);
lock tables t1 write,t1 as t0 write,t1 as t2 read;
ALTER TABLE t1 MODIFY a CHAR(1)CHARACTER SET ucs2 COLLATE ucs2_czech_ci;
ALTER TABLE t1 COALESCE PARTITION 1;
[22 Oct 2014 12:25] MySQL Verification Team
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 > create database e;
Query OK, 1 row affected (0.01 sec)

mysql 5.7 > use e
Database changed
mysql 5.7 > CREATE TABLE t1(a int)PARTITION BY KEY (a) (PARTITION x0,PARTITION x1);
Query OK, 0 rows affected (1.81 sec)

mysql 5.7 > lock tables t1 write,t1 as t0 write,t1 as t2 read;
Query OK, 0 rows affected (0.06 sec)

mysql 5.7 > ALTER TABLE t1 MODIFY a CHAR(1)CHARACTER SET ucs2 COLLATE ucs2_czech_ci;
Query OK, 0 rows affected (2.25 sec)
Records: 0  Duplicates: 0  Warnings: 0

mysql 5.7 > ALTER TABLE t1 COALESCE PARTITION 1;
ERROR 2013 (HY000): Lost connection to MySQL server during query
mysql 5.7 >

7ff760b0e295    mysqld.exe!my_sigabrt_handler()[my_thr_init.c:392]
7ff76120d01f    mysqld.exe!raise()[winsig.c:594]
7ff761208fc0    mysqld.exe!abort()[abort.c:82]
7ff7611f8d8b    mysqld.exe!_wassert()[assert.c:380]
7ff760b2347e    mysqld.exe!bitmap_union()[my_bitmap.c:496]
7ff76110acc4    mysqld.exe!ha_partition::external_lock()[ha_partition.cc:3683]
7ff7603557e7    mysqld.exe!handler::ha_external_lock()[handler.cc:7366]
7ff7606599f0    mysqld.exe!lock_external()[lock.cc:356]
7ff760657b40    mysqld.exe!mysql_lock_tables()[lock.cc:301]
7ff760547ed0    mysqld.exe!Locked_tables_list::reopen_tables()[sql_base.cc:3910]
7ff7609865b1    mysqld.exe!handle_alter_part_error()[sql_partition.cc:6860]
7ff760977860    mysqld.exe!fast_alter_partition_table()[sql_partition.cc:7272]
7ff76051e957    mysqld.exe!mysql_alter_table()[sql_table.cc:8347]
7ff7608fe41a    mysqld.exe!Sql_cmd_alter_table::execute()[sql_alter.cc:315]
7ff7604ddfcf    mysqld.exe!mysql_execute_command()[sql_parse.cc:4786]
7ff7604d605a    mysqld.exe!mysql_parse()[sql_parse.cc:5398]
7ff7604dfa48    mysqld.exe!dispatch_command()[sql_parse.cc:1253]
7ff7604debec    mysqld.exe!do_command()[sql_parse.cc:834]
7ff760346f0c    mysqld.exe!handle_connection()[connection_handler_per_thread.cc:298]
7ff76109edd8    mysqld.exe!pfs_spawn_thread()[pfs.cc:2139]
7ff760b0cb36    mysqld.exe!pthread_start()[my_winthread.c:73]
7ff76120c875    mysqld.exe!_callthreadstartex()[threadex.c:376]
7ff76120cac7    mysqld.exe!_threadstartex()[threadex.c:359]
7fff7ece16ad    KERNEL32.DLL!BaseThreadInitThunk()
7fff81314409    ntdll.dll!RtlUserThreadStart()

Trying to get some variables.
[22 Oct 2014 12:33] MySQL Verification Team
Thank you for the bug report.