Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Duplicate
-
10.4(EOL), 10.5, 10.6
Description
I'm not sure why such an ugly way of adding a unique key is required (via a SERIAL column – while the column isn't added since it already exists, the unique key is); but adding just a unique key directly doesn't cause the same effect.
--source include/have_innodb.inc
|
|
CREATE TABLE t1 (pk INT PRIMARY KEY, a VARCHAR(150), b TEXT, KEY(a(64))) ENGINE=InnoDB; |
ALTER TABLE t1 ADD IF NOT EXISTS b SERIAL, ORDER BY b; |
ALTER TABLE t1 FORCE; |
|
# Cleanup
|
DROP TABLE t1; |
10.4 04ad98b5 debug |
mysqld: /data/src/10.4/sql/table.cc:9234: void setup_keyinfo_hash(KEY*): Assertion `key_info->key_part->field->flags & (1<< 30)' failed.
|
211109 19:19:56 [ERROR] mysqld got signal 6 ;
|
|
#7 0x00007f0c4368bf36 in __GI___assert_fail (assertion=0x55d04488e7e8 "key_info->key_part->field->flags & (1<< 30)", file=0x55d04488b060 "/data/src/10.4/sql/table.cc", line=9234, function=0x55d04488e784 "void setup_keyinfo_hash(KEY*)") at assert.c:101
|
#8 0x000055d043c9128b in setup_keyinfo_hash (key_info=0x7f0bec096028) at /data/src/10.4/sql/table.cc:9234
|
#9 0x000055d043c40559 in mysql_prepare_alter_table (thd=0x7f0bec000d90, table=0x7f0bec192c60, create_info=0x7f0c3c7052b0, alter_info=0x7f0c3c7051f0, alter_ctx=0x7f0c3c7046b0) at /data/src/10.4/sql/sql_table.cc:8531
|
#10 0x000055d043c44b4d in mysql_alter_table (thd=0x7f0bec000d90, new_db=0x7f0bec005568, new_name=0x7f0bec005990, create_info=0x7f0c3c7052b0, table_list=0x7f0bec014868, alter_info=0x7f0c3c7051f0, order_num=0, order=0x0, ignore=false) at /data/src/10.4/sql/sql_table.cc:9970
|
#11 0x000055d043ce0752 in Sql_cmd_alter_table::execute (this=0x7f0bec014f38, thd=0x7f0bec000d90) at /data/src/10.4/sql/sql_alter.cc:520
|
#12 0x000055d043b544a9 in mysql_execute_command (thd=0x7f0bec000d90) at /data/src/10.4/sql/sql_parse.cc:6192
|
#13 0x000055d043b59897 in mysql_parse (thd=0x7f0bec000d90, rawbuf=0x7f0bec014798 "ALTER TABLE t1 FORCE", length=20, parser_state=0x7f0c3c7064d0, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:7995
|
#14 0x000055d043b45b9f in dispatch_command (command=COM_QUERY, thd=0x7f0bec000d90, packet=0x7f0bec00abf1 "ALTER TABLE t1 FORCE", packet_length=20, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1857
|
#15 0x000055d043b44405 in do_command (thd=0x7f0bec000d90) at /data/src/10.4/sql/sql_parse.cc:1373
|
#16 0x000055d043cd6ee4 in do_handle_one_connection (connect=0x55d0468de070) at /data/src/10.4/sql/sql_connect.cc:1420
|
#17 0x000055d043cd6b7d in handle_one_connection (arg=0x55d0468de070) at /data/src/10.4/sql/sql_connect.cc:1316
|
#18 0x000055d04420abf4 in pfs_spawn_thread (arg=0x55d04682a790) at /data/src/10.4/storage/perfschema/pfs.cc:1869
|
#19 0x00007f0c43ba4609 in start_thread (arg=<optimized out>) at pthread_create.c:477
|
#20 0x00007f0c43777293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
|
10.4 04ad98b5 non-debug |
#3 <signal handler called>
|
#4 0x00005589ea635482 in fields_in_hash_keyinfo (keyinfo=keyinfo@entry=0x7f59f812d410) at /data/src/10.4/sql/item.h:2694
|
#5 0x00005589ea6354a5 in setup_keyinfo_hash (key_info=key_info@entry=0x7f59f812d410) at /data/src/10.4/sql/table.cc:9235
|
#6 0x00005589ea60027f in mysql_prepare_alter_table (thd=<optimized out>, table=<optimized out>, create_info=<optimized out>, alter_info=<optimized out>, alter_ctx=<optimized out>) at /data/src/10.4/sql/sql_table.cc:8531
|
#7 0x00005589ea606a0c in mysql_alter_table (thd=thd@entry=0x7f59f8000c48, new_db=new_db@entry=0x7f59f8005260, new_name=new_name@entry=0x7f59f8005688, create_info=create_info@entry=0x7f5a463062a0, table_list=<optimized out>, table_list@entry=0x7f59f8010180, alter_info=alter_info@entry=0x7f5a463061e0, order_num=0, order=0x0, ignore=false) at /data/src/10.4/sql/sql_table.cc:9970
|
#8 0x00005589ea661def in Sql_cmd_alter_table::execute (this=<optimized out>, thd=0x7f59f8000c48) at /data/src/10.4/sql/sql_alter.cc:520
|
#9 0x00005589ea55cc60 in mysql_execute_command (thd=0x7f59f8000c48) at /data/src/10.4/sql/sql_parse.cc:6192
|
#10 0x00005589ea563f43 in mysql_parse (thd=0x7f59f8000c48, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>, is_com_multi=<optimized out>, is_next_command=<optimized out>) at /data/src/10.4/sql/sql_parse.cc:7995
|
#11 0x00005589ea56661d in dispatch_command (command=COM_QUERY, thd=0x7f59f8000c48, packet=<optimized out>, packet_length=<optimized out>, is_com_multi=<optimized out>, is_next_command=<optimized out>) at /data/src/10.4/sql/sql_class.h:1201
|
#12 0x00005589ea568cb0 in do_command (thd=0x7f59f8000c48) at /data/src/10.4/sql/sql_parse.cc:1373
|
#13 0x00005589ea65d87e in do_handle_one_connection (connect=connect@entry=0x5589ed9950d8) at /data/src/10.4/sql/sql_connect.cc:1420
|
#14 0x00005589ea65d9af in handle_one_connection (arg=arg@entry=0x5589ed9950d8) at /data/src/10.4/sql/sql_connect.cc:1316
|
#15 0x00005589ea9f2686 in pfs_spawn_thread (arg=0x5589ed6c4568) at /data/src/10.4/storage/perfschema/pfs.cc:1869
|
#16 0x00007f5a517d9609 in start_thread (arg=<optimized out>) at pthread_create.c:477
|
#17 0x00007f5a513c7293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
|
The failures appeared in 10.4 after the merge from 10.3
commit 47ab793d71f2755b026672e4657174a1740b6ae2 (HEAD)
|
Merge: de2fa9eced7 524b4a89da3
|
Author: Marko Mäkelä
|
Date: Tue Nov 9 08:40:14 2021 +0200
|
|
Merge 10.3 into 10.4
|
but given that 10.3 doesn't have unique blobs, it doesn't fail there.
Attachments
Issue Links
- duplicates
-
MDEV-27244 Table corruption upon adding serial data type
-
- Closed
-
Here are a couple of other ones, the stack traces are different, but the test cases are too similar to suspect that they can be a separate issue.
--source include/have_innodb.inc
# Cleanup
10.4 04ad98b5
#3 <signal handler called>
#4 0x0000564a880f1f26 in key_copy (to_key=0x7f8b76352ea2 "", from_record=0x7f8b2005afc0 "\363", key_info=0x7f8b2005be50, key_length=6, with_zerofill=false) at /data/src/10.4/sql/key.cc:159
#5 0x0000564a87fd8407 in check_duplicate_long_entry_key (table=0x7f8b20063fc0, h=0x7f8b2005b418, new_rec=0x7f8b2005afc0 "\363", key_no=2) at /data/src/10.4/sql/handler.cc:6606
#6 0x0000564a87fd8ba3 in check_duplicate_long_entries (table=0x7f8b20063fc0, h=0x7f8b2005b418, new_rec=0x7f8b2005afc0 "\363") at /data/src/10.4/sql/handler.cc:6688
#7 0x0000564a87fd8ef2 in handler::ha_write_row (this=0x7f8b2005b418, buf=0x7f8b2005afc0 "\363") at /data/src/10.4/sql/handler.cc:6768
#8 0x0000564a87d80ec7 in copy_data_between_tables (thd=0x7f8b20000d90, from=0x7f8b20043f40, to=0x7f8b20063fc0, create=..., ignore=false, order_num=0, order=0x0, copied=0x7f8b76353c38, deleted=0x7f8b76353c40, keys_onoff=Alter_info::LEAVE_AS_IS, alter_ctx=0x7f8b763556b0) at /data/src/10.4/sql/sql_table.cc:10972
#9 0x0000564a87d7ed27 in mysql_alter_table (thd=0x7f8b20000d90, new_db=0x7f8b20005568, new_name=0x7f8b20005990, create_info=0x7f8b763562b0, table_list=0x7f8b200148c8, alter_info=0x7f8b763561f0, order_num=0, order=0x0, ignore=false) at /data/src/10.4/sql/sql_table.cc:10392
#10 0x0000564a87e19752 in Sql_cmd_alter_table::execute (this=0x7f8b200152a0, thd=0x7f8b20000d90) at /data/src/10.4/sql/sql_alter.cc:520
#11 0x0000564a87c8d4a9 in mysql_execute_command (thd=0x7f8b20000d90) at /data/src/10.4/sql/sql_parse.cc:6192
#12 0x0000564a87c92897 in mysql_parse (thd=0x7f8b20000d90, rawbuf=0x7f8b20014798 "ALTER TABLE t ADD IF NOT EXISTS f SERIAL, CHANGE IF EXISTS x xx INT", length=67, parser_state=0x7f8b763574d0, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:7995
#13 0x0000564a87c7eb9f in dispatch_command (command=COM_QUERY, thd=0x7f8b20000d90, packet=0x7f8b2000abf1 "ALTER TABLE t ADD IF NOT EXISTS f SERIAL, CHANGE IF EXISTS x xx INT", packet_length=67, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1857
#14 0x0000564a87c7d405 in do_command (thd=0x7f8b20000d90) at /data/src/10.4/sql/sql_parse.cc:1373
#15 0x0000564a87e0fee4 in do_handle_one_connection (connect=0x564a8b8e1150) at /data/src/10.4/sql/sql_connect.cc:1420
#16 0x0000564a87e0fb7d in handle_one_connection (arg=0x564a8b8e1150) at /data/src/10.4/sql/sql_connect.cc:1316
#17 0x0000564a88343bf4 in pfs_spawn_thread (arg=0x564a8b8d37b0) at /data/src/10.4/storage/perfschema/pfs.cc:1869
#18 0x00007f8b81808609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#19 0x00007f8b813db293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
--source include/have_innodb.inc
# Cleanup
#3 <signal handler called>
#4 0x000055d612f43002 in Type_handler_hybrid_field_type::set_handler (this=0x120, other=0x55d614601d40 <type_handler_double>) at /data/src/10.4/sql/sql_type.h:6650
#5 0x000055d6134780e1 in Item_sum_sum::fix_length_and_dec_double (this=0x0) at /data/src/10.4/sql/item_sum.cc:1533
#6 0x000055d61326007a in Type_handler_string_result::Item_sum_sum_fix_length_and_dec (this=0x55d614601cf0 <type_handler_null>, item=0x0) at /data/src/10.4/sql/sql_type.cc:4478
#7 0x000055d61349ef32 in key_copy (to_key=0x7fc9ce961ea2 "", from_record=0x7fc984062c10 "\363", key_info=0x7fc9840632b0, key_length=6, with_zerofill=false) at /data/src/10.4/sql/key.cc:159
#8 0x000055d613385407 in check_duplicate_long_entry_key (table=0x7fc98405a3b0, h=0x7fc98405b218, new_rec=0x7fc984062c10 "\363", key_no=2) at /data/src/10.4/sql/handler.cc:6606
#9 0x000055d613385ba3 in check_duplicate_long_entries (table=0x7fc98405a3b0, h=0x7fc98405b218, new_rec=0x7fc984062c10 "\363") at /data/src/10.4/sql/handler.cc:6688
#10 0x000055d613385ef2 in handler::ha_write_row (this=0x7fc98405b218, buf=0x7fc984062c10 "\363") at /data/src/10.4/sql/handler.cc:6768
#11 0x000055d61312dec7 in copy_data_between_tables (thd=0x7fc984000d90, from=0x7fc984041e10, to=0x7fc98405a3b0, create=..., ignore=false, order_num=0, order=0x0, copied=0x7fc9ce962c38, deleted=0x7fc9ce962c40, keys_onoff=Alter_info::LEAVE_AS_IS, alter_ctx=0x7fc9ce9646b0) at /data/src/10.4/sql/sql_table.cc:10972
#12 0x000055d61312bd27 in mysql_alter_table (thd=0x7fc984000d90, new_db=0x7fc984005568, new_name=0x7fc984005990, create_info=0x7fc9ce9652b0, table_list=0x7fc9840148c8, alter_info=0x7fc9ce9651f0, order_num=0, order=0x0, ignore=false) at /data/src/10.4/sql/sql_table.cc:10392
#13 0x000055d6131c6752 in Sql_cmd_alter_table::execute (this=0x7fc9840152a0, thd=0x7fc984000d90) at /data/src/10.4/sql/sql_alter.cc:520
#14 0x000055d61303a4a9 in mysql_execute_command (thd=0x7fc984000d90) at /data/src/10.4/sql/sql_parse.cc:6192
#15 0x000055d61303f897 in mysql_parse (thd=0x7fc984000d90, rawbuf=0x7fc984014798 "ALTER TABLE t ADD IF NOT EXISTS f SERIAL, CHANGE IF EXISTS x xx INT", length=67, parser_state=0x7fc9ce9664d0, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:7995
#16 0x000055d61302bb9f in dispatch_command (command=COM_QUERY, thd=0x7fc984000d90, packet=0x7fc98400abf1 "ALTER TABLE t ADD IF NOT EXISTS f SERIAL, CHANGE IF EXISTS x xx INT", packet_length=67, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1857
#17 0x000055d61302a405 in do_command (thd=0x7fc984000d90) at /data/src/10.4/sql/sql_parse.cc:1373
#18 0x000055d6131bcee4 in do_handle_one_connection (connect=0x55d61590ff60) at /data/src/10.4/sql/sql_connect.cc:1420
#19 0x000055d6131bcb7d in handle_one_connection (arg=0x55d61590ff60) at /data/src/10.4/sql/sql_connect.cc:1316
#20 0x000055d6136f0bf4 in pfs_spawn_thread (arg=0x55d6159025c0) at /data/src/10.4/storage/perfschema/pfs.cc:1869
#21 0x00007fc9d9e1a609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#22 0x00007fc9d99ed293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95