[MDEV-22627] InnoDB: Failing assertion: dict_tf2_is_valid(flags, flags2) in dict_mem_table_create and in dict_table_t::create Created: 2020-05-19  Updated: 2022-02-15  Resolved: 2021-10-20

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.2, 10.3, 10.4, 10.5, 10.6, 10.7
Fix Version/s: 10.2.41, 10.3.32, 10.4.22, 10.5.13, 10.6.5, 10.7.1

Type: Bug Priority: Critical
Reporter: Roel Van de Paar Assignee: Marko Mäkelä
Resolution: Fixed Votes: 1
Labels: affects-tests, not-10.1

Issue Links:
Relates
relates to MDEV-12873 InnoDB SYS_TABLES.TYPE incompatibilit... Closed
relates to MDEV-17989 InnoDB: Failing assertion: dict_tf2_i... Closed

 Description   

USE test;
SET SESSION innodb_compression_default=1;
SET GLOBAL innodb_compression_level=0;
CREATE TABLE t(c INT);

Leads to:

10.5.4 69077dea25f6e7cab4ff8927e4429ad62af9de49

2020-05-19 08:52:46 0x14ecdb935700  InnoDB: Assertion failure in file /test/10.5_opt/storage/innobase/dict/dict0mem.cc line 149
InnoDB: Failing assertion: dict_tf2_is_valid(flags, flags2)

10.5.4 69077dea25f6e7cab4ff8927e4429ad62af9de49

Core was generated by `/test/MD160520-mariadb-10.5.4-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
Program terminated with signal SIGABRT, Aborted.
#0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
    at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
[Current thread is 1 (Thread 0x153bea836700 (LWP 1289077))]
(gdb) bt
#0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
#1  0x0000556e9614d617 in my_write_core (sig=sig@entry=6) at /test/10.5_opt/mysys/stacktrace.c:518
#2  0x0000556e95b100fa in handle_fatal_signal (sig=6) at /test/10.5_opt/sql/signal_handler.cc:329
#3  <signal handler called>
#4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#5  0x0000153be8f7a801 in __GI_abort () at abort.c:79
#6  0x0000556e95819828 in ut_dbg_assertion_failed (expr=expr@entry=0x556e96488f48 "dict_tf2_is_valid(flags, flags2)", file=file@entry=0x556e96488ed8 "/test/10.5_opt/storage/innobase/dict/dict0mem.cc", line=line@entry=149) at /test/10.5_opt/storage/innobase/ut/ut0dbg.cc:60
#7  0x0000556e9602fc78 in dict_mem_table_create (name=name@entry=0x153bea832720 "test/t", space=space@entry=0x0, n_cols=1, n_v_cols=n_v_cols@entry=0, flags=161, flags2=80) at /test/10.5_opt/storage/innobase/dict/dict0mem.cc:149
#8  0x0000556e95e40062 in create_table_info_t::create_table_def (this=0x153bea8326c0) at /test/10.5_opt/storage/innobase/handler/ha_innodb.cc:10534
#9  0x0000556e95e3e93d in create_table_info_t::create_table (this=this@entry=0x153bea8326c0, create_fk=create_fk@entry=true) at /test/10.5_opt/storage/innobase/handler/ha_innodb.cc:12579
#10 0x0000556e95e45fca in ha_innobase::create (this=<optimized out>, name=0x153bea8348f0 "./test/t", form=<optimized out>, create_info=<optimized out>, file_per_table=<optimized out>, trx=<optimized out>) at /test/10.5_opt/storage/innobase/handler/ha_innodb.cc:13128
#11 0x0000556e95b18ba8 in handler::ha_create (this=0x153bc586d030, name=<optimized out>, form=0x153bea832c60, info_arg=0x153bea834cd0) at /test/10.5_opt/sql/handler.cc:4902
#12 0x0000556e95b19401 in ha_create_table (thd=thd@entry=0x153bc5812018, path=path@entry=0x153bea8348f0 "./test/t", db=0x153bc58477f0 "test", table_name=0x153bc58470e8 "t", create_info=create_info@entry=0x153bea834cd0, frm=frm@entry=0x153bea8348e0) at /test/10.5_opt/sql/handler.cc:5366
#13 0x0000556e959adff2 in create_table_impl (thd=thd@entry=0x153bc5812018, orig_db=..., orig_table_name=..., db=..., table_name=..., path=path@entry=0x153bea8348f0 "./test/t", options=..., create_info=0x153bea834cd0, alter_info=0x153bea834c00, create_table_mode=0, is_trans=0x153bea834b77, key_info=0x153bea8348d8, key_count=0x153bea8348d4, frm=0x153bea8348e0) at /test/10.5_opt/sql/sql_table.cc:5172
#14 0x0000556e959ae3fb in mysql_create_table_no_lock (thd=thd@entry=0x153bc5812018, db=db@entry=0x153bc5847138, table_name=table_name@entry=0x153bc5847148, create_info=create_info@entry=0x153bea834cd0, alter_info=0x153bea834c00, is_trans=is_trans@entry=0x153bea834b77, create_table_mode=0, table_list=0x153bc5847120) at /test/10.5_opt/sql/sql_table.cc:5256
#15 0x0000556e959ae611 in mysql_create_table (thd=thd@entry=0x153bc5812018, create_table=create_table@entry=0x153bc5847120, create_info=create_info@entry=0x153bea834cd0, alter_info=alter_info@entry=0x153bea834c00) at /test/10.5_opt/sql/sql_table.cc:5348
#16 0x0000556e959af9c1 in Sql_cmd_create_table_like::execute (this=<optimized out>, thd=0x153bc5812018) at /test/10.5_opt/sql/sql_table.cc:11873
#17 0x0000556e9591a5d0 in mysql_execute_command (thd=thd@entry=0x153bc5812018) at /test/10.5_opt/sql/sql_parse.cc:5912
#18 0x0000556e9592182c in mysql_parse (thd=0x153bc5812018, rawbuf=<optimized out>, length=21, parser_state=0x153bea8354b0, is_com_multi=<optimized out>, is_next_command=<optimized out>) at /test/10.5_opt/sql/sql_parse.cc:7957
#19 0x0000556e95916e75 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x153bc5812018, packet=packet@entry=0x153bc583a019 "CREATE TABLE t(c INT)", packet_length=packet_length@entry=21, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_opt/sql/sql_parse.cc:1839
#20 0x0000556e95915106 in do_command (thd=0x153bc5812018) at /test/10.5_opt/sql/sql_parse.cc:1358
#21 0x0000556e95a09bf1 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x153be84329b8, put_in_cache=put_in_cache@entry=true) at /test/10.5_opt/sql/sql_connect.cc:1411
#22 0x0000556e95a09f54 in handle_one_connection (arg=arg@entry=0x153be84329b8) at /test/10.5_opt/sql/sql_connect.cc:1313
#23 0x0000556e95d7543a in pfs_spawn_thread (arg=0x153be844b018) at /test/10.5_opt/storage/perfschema/pfs.cc:2201
#24 0x0000153be9c5d6db in start_thread (arg=0x153bea836700) at pthread_create.c:463
#25 0x0000153be905b88f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

10.5.4 69077dea25f6e7cab4ff8927e4429ad62af9de49

Core was generated by `/test/MD160520-mariadb-10.5.4-linux-x86_64-opt/bin/mysqld --no-defaults --core-'.
Program terminated with signal SIGABRT, Aborted.
[Current thread is 1 (Thread 0x151a6d484700 (LWP 1298866))]
(gdb) bt
#0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
    at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
#1  0x000055b31c328617 in my_write_core (sig=sig@entry=6) at /test/10.5_opt/mysys/stacktrace.c:518
#2  0x000055b31bceb0fa in handle_fatal_signal (sig=6) at /test/10.5_opt/sql/signal_handler.cc:329
#3  <signal handler called>
#4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#5  0x0000151a6bbc8801 in __GI_abort () at abort.c:79
#6  0x000055b31b9f4828 in ut_dbg_assertion_failed (
    expr=expr@entry=0x55b31c663f48 "dict_tf2_is_valid(flags, flags2)", 
    file=file@entry=0x55b31c663ed8 "/test/10.5_opt/storage/innobase/dict/dict0mem.cc", 
    line=line@entry=149) at /test/10.5_opt/storage/innobase/ut/ut0dbg.cc:60
#7  0x000055b31c20ac78 in dict_mem_table_create (name=name@entry=0x151a6d480720 "test/t", 
    space=space@entry=0x0, n_cols=1, n_v_cols=n_v_cols@entry=0, flags=161, flags2=80)
    at /test/10.5_opt/storage/innobase/dict/dict0mem.cc:149
#8  0x000055b31c01b062 in create_table_info_t::create_table_def (this=0x151a6d4806c0)
    at /test/10.5_opt/storage/innobase/handler/ha_innodb.cc:10534
#9  0x000055b31c01993d in create_table_info_t::create_table (this=this@entry=0x151a6d4806c0, 
    create_fk=create_fk@entry=true) at /test/10.5_opt/storage/innobase/handler/ha_innodb.cc:12579
#10 0x000055b31c020fca in ha_innobase::create (this=<optimized out>, name=0x151a6d4828f0 "./test/t", 
    form=<optimized out>, create_info=<optimized out>, file_per_table=<optimized out>, 
    trx=<optimized out>) at /test/10.5_opt/storage/innobase/handler/ha_innodb.cc:13128
#11 0x000055b31bcf3ba8 in handler::ha_create (this=0x151a4a46d030, name=<optimized out>, 
    form=0x151a6d480c60, info_arg=0x151a6d482cd0) at /test/10.5_opt/sql/handler.cc:4902
#12 0x000055b31bcf4401 in ha_create_table (thd=thd@entry=0x151a4a412018, 
    path=path@entry=0x151a6d4828f0 "./test/t", db=0x151a4a4477f0 "test", 
    table_name=0x151a4a4470e8 "t", create_info=create_info@entry=0x151a6d482cd0, 
    frm=frm@entry=0x151a6d4828e0) at /test/10.5_opt/sql/handler.cc:5366
#13 0x000055b31bb88ff2 in create_table_impl (thd=thd@entry=0x151a4a412018, orig_db=..., 
    orig_table_name=..., db=..., table_name=..., path=path@entry=0x151a6d4828f0 "./test/t", 
    options=..., create_info=0x151a6d482cd0, alter_info=0x151a6d482c00, create_table_mode=0, 
    is_trans=0x151a6d482b77, key_info=0x151a6d4828d8, key_count=0x151a6d4828d4, frm=0x151a6d4828e0)
    at /test/10.5_opt/sql/sql_table.cc:5172
#14 0x000055b31bb893fb in mysql_create_table_no_lock (thd=thd@entry=0x151a4a412018, 
    db=db@entry=0x151a4a447138, table_name=table_name@entry=0x151a4a447148, 
    create_info=create_info@entry=0x151a6d482cd0, alter_info=0x151a6d482c00, 
    is_trans=is_trans@entry=0x151a6d482b77, create_table_mode=0, table_list=0x151a4a447120)
    at /test/10.5_opt/sql/sql_table.cc:5256
#15 0x000055b31bb89611 in mysql_create_table (thd=thd@entry=0x151a4a412018, 
    create_table=create_table@entry=0x151a4a447120, create_info=create_info@entry=0x151a6d482cd0, 
    alter_info=alter_info@entry=0x151a6d482c00) at /test/10.5_opt/sql/sql_table.cc:5348
#16 0x000055b31bb8a9c1 in Sql_cmd_create_table_like::execute (this=<optimized out>, 
    thd=0x151a4a412018) at /test/10.5_opt/sql/sql_table.cc:11873
#17 0x000055b31baf55d0 in mysql_execute_command (thd=thd@entry=0x151a4a412018)
    at /test/10.5_opt/sql/sql_parse.cc:5912
#18 0x000055b31bafc82c in mysql_parse (thd=0x151a4a412018, rawbuf=<optimized out>, length=21, 
    parser_state=0x151a6d4834b0, is_com_multi=<optimized out>, is_next_command=<optimized out>)
    at /test/10.5_opt/sql/sql_parse.cc:7957
#19 0x000055b31baf1e75 in dispatch_command (command=command@entry=COM_QUERY, 
    thd=thd@entry=0x151a4a412018, packet=packet@entry=0x151a4a43a019 "CREATE TABLE t(c INT)", 
    packet_length=packet_length@entry=21, is_com_multi=is_com_multi@entry=false, 
    is_next_command=is_next_command@entry=false) at /test/10.5_opt/sql/sql_parse.cc:1839
#20 0x000055b31baf0106 in do_command (thd=0x151a4a412018) at /test/10.5_opt/sql/sql_parse.cc:1358
#21 0x000055b31bbe4bf1 in do_handle_one_connection (connect=<optimized out>, 
    connect@entry=0x151a6b0329b8, put_in_cache=put_in_cache@entry=true)
    at /test/10.5_opt/sql/sql_connect.cc:1411
#22 0x000055b31bbe4f54 in handle_one_connection (arg=arg@entry=0x151a6b0329b8)
    at /test/10.5_opt/sql/sql_connect.cc:1313
#23 0x000055b31bf5043a in pfs_spawn_thread (arg=0x151a6b04b018)
    at /test/10.5_opt/storage/perfschema/pfs.cc:2201
#24 0x0000151a6c8ab6db in start_thread (arg=0x151a6d484700) at pthread_create.c:463
#25 0x0000151a6bca988f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Bug confirmed present in:
MariaDB: 10.2.32 (dbg), 10.2.32 (opt), 10.3.23 (dbg), 10.3.23 (opt), 10.4.13 (dbg), 10.4.13 (opt), 10.5.2 (dbg), 10.5.2 (opt), 10.5.3 (dbg), 10.5.3 (opt), 10.5.4 (dbg), 10.5.4 (opt)

Bug confirmed not present in:
MariaDB: 10.1.45 (dbg), 10.1.45 (opt)
MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.47 (dbg), 5.6.47 (opt), 5.7.29 (dbg), 5.7.29 (opt), 8.0.19 (dbg), 8.0.19 (opt)



 Comments   
Comment by Roel Van de Paar [ 2020-05-19 ]

Assert previously seen in MDEV-17989

Comment by Roel Van de Paar [ 2020-05-20 ]

When testing patch, please also test reversed testcase. Thank you

USE test;
SET GLOBAL innodb_compression_level=0;
SET SESSION innodb_compression_default=1;
CREATE TABLE t(c INT);

Comment by Ramesh Sivaraman [ 2021-04-08 ]

ALTER TABLE statement also failing with similar assertion.

CREATE TABLE tp (a INT)ENGINE=InnoDB ROW_FORMAT=DYNAMIC page_compressed=1;
SET GLOBAL innodb_compression_level=-1;
ALTER TABLE tp ENGINE=InnoDB;

10.6.0 8dd35a2507f8d63ca8df9335d2c6072d5c0e3b86 (Optimized)

InnoDB: Failing assertion: dict_tf2_is_valid(flags, flags2)

10.6.0 8dd35a2507f8d63ca8df9335d2c6072d5c0e3b86 (Optimized)

Core was generated by `/test/MD160321-mariadb-10.6.0-linux-x86_64-opt/bin/mysqld --no-defaults --core-'.
Program terminated with signal SIGABRT, Aborted.
#0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
    at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
[Current thread is 1 (Thread 0x1471040e9700 (LWP 2661762))]
(gdb) bt
#0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
#1  0x0000562f0ab6826f in my_write_core (sig=sig@entry=6) at /test/10.6_opt/mysys/stacktrace.c:424
#2  0x0000562f0a5e35e0 in handle_fatal_signal (sig=6) at /test/10.6_opt/sql/signal_handler.cc:331
#3  <signal handler called>
#4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#5  0x0000147106e5d859 in __GI_abort () at abort.c:79
#6  0x0000562f0a2a81b7 in ut_dbg_assertion_failed (expr=expr@entry=0x562f0aea3b90 "dict_tf2_is_valid(flags, flags2)", file=file@entry=0x562f0aea3b20 "/test/10.6_opt/storage/innobase/dict/dict0mem.cc", line=line@entry=146) at /test/10.6_opt/storage/innobase/ut/ut0dbg.cc:60
#7  0x0000562f0a2b94e2 in dict_mem_table_create (name=name@entry=0x1470b4020268 "test/#sql-alter-289d0c-4", space=space@entry=0x0, n_cols=1, n_v_cols=n_v_cols@entry=0, flags=flags@entry=161, flags2=flags2@entry=80) at /test/10.6_opt/storage/innobase/dict/dict0mem.cc:146
#8  0x0000562f0a9250a3 in prepare_inplace_alter_table_dict (ha_alter_info=<optimized out>, altered_table=<optimized out>, old_table=<optimized out>, table_name=<optimized out>, flags=<optimized out>, flags2=80, fts_doc_id_col=<optimized out>, add_fts_doc_id=<optimized out>, add_fts_doc_id_idx=<optimized out>) at /test/10.6_opt/storage/innobase/handler/handler0alter.cc:6358
#9  0x0000562f0a92ccbb in ha_innobase::prepare_inplace_alter_table (this=<optimized out>, altered_table=<optimized out>, ha_alter_info=<optimized out>) at /test/10.6_opt/storage/innobase/handler/ha_innodb.h:707
#10 0x0000562f0a47551b in mysql_inplace_alter_table (thd=0x1470b4000c58, table_list=0x1470b4010590, table=0x1470b401cef8, altered_table=0x1471040e5a50, ha_alter_info=0x1471040e59a0, alter_ctx=0x1471040e6a00, target_mdl_request=<optimized out>) at /test/10.6_opt/sql/sql_table.cc:8105
#11 0x0000562f0a483545 in mysql_alter_table (thd=thd@entry=0x1470b4000c58, new_db=new_db@entry=0x1470b4005518, new_name=new_name@entry=0x1470b4005938, create_info=create_info@entry=0x1471040e7630, table_list=<optimized out>, table_list@entry=0x1470b4010590, alter_info=alter_info@entry=0x1471040e7540, order_num=0, order=0x0, ignore=false, if_exists=false) at /test/10.6_opt/sql/sql_table.cc:10779
#12 0x0000562f0a4e201d in Sql_cmd_alter_table::execute (this=<optimized out>, thd=0x1470b4000c58) at /test/10.6_opt/sql/structs.h:563
#13 0x0000562f0a3dc846 in mysql_execute_command (thd=0x1470b4000c58) at /test/10.6_opt/sql/sql_parse.cc:5972
#14 0x0000562f0a3ccdc4 in mysql_parse (thd=0x1470b4000c58, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at /test/10.6_opt/sql/sql_parse.cc:7998
#15 0x0000562f0a3d8d2d in dispatch_command (command=COM_QUERY, thd=0x1470b4000c58, packet=<optimized out>, packet_length=<optimized out>, blocking=<optimized out>) at /test/10.6_opt/sql/sql_class.h:1318
#16 0x0000562f0a3dadb6 in do_command (thd=0x1470b4000c58, blocking=blocking@entry=true) at /test/10.6_opt/sql/sql_parse.cc:1397
#17 0x0000562f0a4dd557 in do_handle_one_connection (connect=<optimized out>, put_in_cache=true) at /test/10.6_opt/sql/sql_connect.cc:1410
#18 0x0000562f0a4dd8bd in handle_one_connection (arg=arg@entry=0x562f0cb24d18) at /test/10.6_opt/sql/sql_connect.cc:1312
#19 0x0000562f0a85df97 in pfs_spawn_thread (arg=0x562f0ca9ab88) at /test/10.6_opt/storage/perfschema/pfs.cc:2201
#20 0x000014710736b609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#21 0x0000147106f5a293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Comment by Roel Van de Paar [ 2021-08-10 ]

Additional testcase and new stack in dict_table_t::create on 10.7:

SET GLOBAL innodb_compression_default=1;
SET GLOBAL innodb_compression_level=0;
CREATE TABLE t (c INT);

Leads to:

10.7.0 71ed8c136fa203b9b3a678a6d5cc72235ef73ef7 (Debug)

InnoDB: Failing assertion: dict_tf2_is_valid(flags, flags2)

10.7.0 71ed8c136fa203b9b3a678a6d5cc72235ef73ef7 (Debug)

Core was generated by `/test/MD200721-mariadb-10.7.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
Program terminated with signal SIGABRT, Aborted.
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
[Current thread is 1 (Thread 0x14e7ccf56700 (LWP 1946469))]
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x000014e7e1ddc859 in __GI_abort () at abort.c:79
#2  0x000055eff28b9234 in ut_dbg_assertion_failed (expr=expr@entry=0x55eff2f1c108 "dict_tf2_is_valid(flags, flags2)", file=file@entry=0x55eff2f1ba08 "/test/10.7_dbg/storage/innobase/dict/dict0mem.cc", line=line@entry=142) at /test/10.7_dbg/storage/innobase/ut/ut0dbg.cc:60
#3  0x000055eff29a8e0d in dict_table_t::create (name=@0x14e7ccf526a0: {data_ = 0x14e7ccf52ca0 "test/t", size_ = 6}, space=space@entry=0x0, n_cols=1, n_v_cols=n_v_cols@entry=0, flags=161, flags2=80) at /test/10.7_dbg/storage/innobase/dict/dict0mem.cc:142
#4  0x000055eff268f3fd in create_table_info_t::create_table_def (this=this@entry=0x14e7ccf52c40) at /test/10.7_dbg/include/span.h:66
#5  0x000055eff2686874 in create_table_info_t::create_table (this=this@entry=0x14e7ccf52c40, create_fk=create_fk@entry=true) at /test/10.7_dbg/storage/innobase/handler/ha_innodb.cc:12586
#6  0x000055eff26912de in ha_innobase::create (this=<optimized out>, name=0x14e7ccf54680 "./test/t", form=<optimized out>, create_info=0x14e7ccf54bb0, file_per_table=<optimized out>, trx=0x14e7cd15a390, trx@entry=0x0) at /test/10.7_dbg/storage/innobase/handler/ha_innodb.cc:13135
#7  0x000055eff2687235 in ha_innobase::create (this=<optimized out>, name=<optimized out>, form=<optimized out>, create_info=<optimized out>) at /test/10.7_dbg/storage/innobase/handler/ha_innodb.cc:13173
#8  0x000055eff22dfe11 in handler::ha_create (this=0x14e78c01e360, name=0x14e7ccf54680 "./test/t", form=form@entry=0x14e7ccf53210, info_arg=info_arg@entry=0x14e7ccf54bb0) at /test/10.7_dbg/sql/handler.cc:5405
#9  0x000055eff22e0aab in ha_create_table (thd=thd@entry=0x14e78c000db8, path=0x14e7ccf54680 "./test/t", db=0x14e78c014458 "test", table_name=0x14e78c013d40 "t", create_info=create_info@entry=0x14e7ccf54bb0, frm=frm@entry=0x14e7ccf54670, skip_frm_file=false) at /test/10.7_dbg/sql/handler.cc:5870
#10 0x000055eff20c15a5 in create_table_impl (thd=thd@entry=0x14e78c000db8, ddl_log_state_create=ddl_log_state_create@entry=0x14e7ccf54910, ddl_log_state_rm=<optimized out>, ddl_log_state_rm@entry=0x14e7ccf54930, orig_db=@0x14e78c013d90: {str = 0x14e78c014458 "test", length = 4}, orig_table_name=@0x14e78c013da0: {str = 0x14e78c013d40 "t", length = 1}, db=@0x14e78c013d90: {str = 0x14e78c014458 "test", length = 4}, table_name=@0x14e78c013da0: {str = 0x14e78c013d40 "t", length = 1}, path=@0x14e7ccf54660: {str = 0x14e7ccf54680 "./test/t", length = 8}, options=<optimized out>, create_info=0x14e7ccf54bb0, alter_info=0x14e7ccf54ac0, create_table_mode=0, is_trans=0x14e7ccf5490f, key_info=0x14e7ccf54658, key_count=0x14e7ccf54654, frm=0x14e7ccf54670) at /test/10.7_dbg/sql/sql_table.cc:4449
#11 0x000055eff20c1b72 in mysql_create_table_no_lock (thd=thd@entry=0x14e78c000db8, ddl_log_state_create=ddl_log_state_create@entry=0x14e7ccf54910, ddl_log_state_rm=ddl_log_state_rm@entry=0x14e7ccf54930, db=db@entry=0x14e78c013d90, table_name=table_name@entry=0x14e78c013da0, create_info=create_info@entry=0x14e7ccf54bb0, alter_info=0x14e7ccf54ac0, is_trans=0x14e7ccf5490f, create_table_mode=0, table_list=0x14e78c013d78) at /test/10.7_dbg/sql/sql_table.cc:4548
#12 0x000055eff20c1f95 in mysql_create_table (thd=thd@entry=0x14e78c000db8, create_table=create_table@entry=0x14e78c013d78, create_info=create_info@entry=0x14e7ccf54bb0, alter_info=alter_info@entry=0x14e7ccf54ac0) at /test/10.7_dbg/sql/sql_table.cc:4660
#13 0x000055eff20c3e3f in Sql_cmd_create_table_like::execute (this=<optimized out>, thd=0x14e78c000db8) at /test/10.7_dbg/sql/sql_table.cc:11775
#14 0x000055eff1fe01c2 in mysql_execute_command (thd=thd@entry=0x14e78c000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.7_dbg/sql/sql_parse.cc:5993
#15 0x000055eff1fc6ead in mysql_parse (thd=thd@entry=0x14e78c000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14e7ccf55400) at /test/10.7_dbg/sql/sql_parse.cc:8026
#16 0x000055eff1fd59f8 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14e78c000db8, packet=packet@entry=0x14e78c00b749 "CREATE TABLE t (c INT)", packet_length=packet_length@entry=22, blocking=blocking@entry=true) at /test/10.7_dbg/sql/sql_class.h:1340
#17 0x000055eff1fd8e05 in do_command (thd=0x14e78c000db8, blocking=blocking@entry=true) at /test/10.7_dbg/sql/sql_parse.cc:1404
#18 0x000055eff214ef48 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55eff55ecfa8, put_in_cache=put_in_cache@entry=true) at /test/10.7_dbg/sql/sql_connect.cc:1410
#19 0x000055eff214f54d in handle_one_connection (arg=arg@entry=0x55eff55ecfa8) at /test/10.7_dbg/sql/sql_connect.cc:1312
#20 0x000055eff25b75b2 in pfs_spawn_thread (arg=0x55eff5515b28) at /test/10.7_dbg/storage/perfschema/pfs.cc:2201
#21 0x000014e7e22eb609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#22 0x000014e7e1ed9293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

10.7.0 71ed8c136fa203b9b3a678a6d5cc72235ef73ef7 (Optimized)

InnoDB: Failing assertion: dict_tf2_is_valid(flags, flags2)

10.7.0 71ed8c136fa203b9b3a678a6d5cc72235ef73ef7 (Optimized)

Core was generated by `/test/MD200721-mariadb-10.7.0-linux-x86_64-opt/bin/mysqld --no-defaults --core-'.
Program terminated with signal SIGABRT, Aborted.
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
[Current thread is 1 (Thread 0x14d138419700 (LWP 2084048))]
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x000014d143844859 in __GI_abort () at abort.c:79
#2  0x000055b01eafbb05 in ut_dbg_assertion_failed (expr=expr@entry=0x55b01f718a10 "dict_tf2_is_valid(flags, flags2)", file=file@entry=0x55b01f7189a0 "/test/10.7_opt/storage/innobase/dict/dict0mem.cc", line=line@entry=142) at /test/10.7_opt/storage/innobase/ut/ut0dbg.cc:60
#3  0x000055b01eb0a984 in dict_table_t::create (name=@0x14d138415670: {data_ = 0x14d138415ee0 "test/t", size_ = 6}, space=space@entry=0x0, n_cols=1, n_v_cols=0, flags=161, flags2=80) at /test/10.7_opt/storage/innobase/dict/dict0mem.cc:142
#4  0x000055b01f18159f in create_table_info_t::create_table_def (this=0x14d138415e80) at /test/10.7_opt/include/span.h:66
#5  0x000055b01f17ff85 in create_table_info_t::create_table (this=0x14d138415e80, create_fk=<optimized out>) at /test/10.7_opt/storage/innobase/handler/ha_innodb.cc:12586
#6  0x000055b01f184121 in ha_innobase::create (this=<optimized out>, name=0x14d138417780 "./test/t", form=<optimized out>, create_info=<optimized out>, file_per_table=<optimized out>, trx=0x14d13a6d4230) at /test/10.7_opt/storage/innobase/handler/ha_innodb.cc:13135
#7  0x000055b01eea1f34 in handler::ha_create (this=<optimized out>, name=<optimized out>, form=0x14d138416420, info_arg=0x14d138417c70) at /test/10.7_opt/sql/handler.cc:5405
#8  0x000055b01eea283a in ha_create_table (thd=thd@entry=0x14d0dc000c58, path=<optimized out>, db=0x14d0dc010f78 "test", table_name=0x14d0dc010860 "t", create_info=create_info@entry=0x14d138417c70, frm=frm@entry=0x14d138417770, skip_frm_file=false) at /test/10.7_opt/sql/handler.cc:5870
#9  0x000055b01ed0c635 in create_table_impl (thd=thd@entry=0x14d0dc000c58, ddl_log_state_create=ddl_log_state_create@entry=0x14d138417a20, ddl_log_state_rm=<optimized out>, orig_db=@0x14d0dc0108b0: {str = 0x14d0dc010f78 "test", length = 4}, orig_table_name=@0x14d0dc0108c0: {str = 0x14d0dc010860 "t", length = 1}, db=@0x14d0dc0108b0: {str = 0x14d0dc010f78 "test", length = 4}, table_name=@0x14d0dc0108c0: {str = 0x14d0dc010860 "t", length = 1}, path=@0x14d138417760: {str = 0x14d138417780 "./test/t", length = 8}, options={m_options = DDL_options_st::OPT_NONE}, create_info=0x14d138417c70, alter_info=0x14d138417b80, create_table_mode=0, is_trans=0x14d138417a1f, key_info=0x14d138417758, key_count=0x14d138417754, frm=0x14d138417770) at /test/10.7_opt/sql/sql_table.cc:4449
#10 0x000055b01ed0cfb8 in mysql_create_table_no_lock (thd=thd@entry=0x14d0dc000c58, ddl_log_state_create=ddl_log_state_create@entry=0x14d138417a20, ddl_log_state_rm=ddl_log_state_rm@entry=0x14d138417a40, db=db@entry=0x14d0dc0108b0, table_name=table_name@entry=0x14d0dc0108c0, create_info=create_info@entry=0x14d138417c70, alter_info=0x14d138417b80, is_trans=0x14d138417a1f, create_table_mode=0, table_list=0x14d0dc010898) at /test/10.7_opt/sql/sql_table.cc:4548
#11 0x000055b01ed0d3a4 in mysql_create_table (thd=thd@entry=0x14d0dc000c58, create_table=create_table@entry=0x14d0dc010898, create_info=create_info@entry=0x14d138417c70, alter_info=alter_info@entry=0x14d138417b80) at /test/10.7_opt/sql/sql_table.cc:4660
#12 0x000055b01ed0ec39 in Sql_cmd_create_table_like::execute (this=<optimized out>, thd=0x14d0dc000c58) at /test/10.7_opt/sql/sql_table.cc:11775
#13 0x000055b01ec5d92e in mysql_execute_command (thd=0x14d0dc000c58, is_called_from_prepared_stmt=<optimized out>) at /test/10.7_opt/sql/sql_parse.cc:5993
#14 0x000055b01ec4dd46 in mysql_parse (thd=0x14d0dc000c58, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at /test/10.7_opt/sql/sql_parse.cc:8026
#15 0x000055b01ec59c35 in dispatch_command (command=COM_QUERY, thd=0x14d0dc000c58, packet=<optimized out>, packet_length=<optimized out>, blocking=<optimized out>) at /test/10.7_opt/sql/sql_class.h:1340
#16 0x000055b01ec5bb57 in do_command (thd=0x14d0dc000c58, blocking=blocking@entry=true) at /test/10.7_opt/sql/sql_parse.cc:1404
#17 0x000055b01ed76fe7 in do_handle_one_connection (connect=<optimized out>, put_in_cache=true) at /test/10.7_opt/sql/sql_connect.cc:1410
#18 0x000055b01ed7734d in handle_one_connection (arg=arg@entry=0x55b022070888) at /test/10.7_opt/sql/sql_connect.cc:1312
#19 0x000055b01f0c92d8 in pfs_spawn_thread (arg=0x55b02214cbe8) at /test/10.7_opt/storage/perfschema/pfs.cc:2201
#20 0x000014d143d53609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#21 0x000014d143941293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Bug confirmed present in:
MariaDB: 10.2.39 (dbg), 10.2.39 (opt), 10.3.30 (dbg), 10.3.30 (opt), 10.4.20 (dbg), 10.4.20 (opt), 10.5.11 (dbg), 10.5.11 (opt), 10.6.4 (dbg), 10.6.4 (opt), 10.7.0 (dbg), 10.7.0 (opt)

Bug (or feature/syntax) confirmed not present in:
MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.34 (dbg), 5.7.34 (opt), 8.0.24 (dbg), 8.0.24 (opt)

Comment by Roel Van de Paar [ 2021-08-10 ]

Another testcase variation:

SET GLOBAL innodb_compression_level=0;
CREATE TABLE t (a INT) ENGINE=InnoDB ROW_FORMAT=DYNAMIC page_compressed=1;

Leads to:

10.7.0 71ed8c136fa203b9b3a678a6d5cc72235ef73ef7 (Optimized)

InnoDB: Failing assertion: dict_tf2_is_valid(flags, flags2)

10.7.0 71ed8c136fa203b9b3a678a6d5cc72235ef73ef7 (Optimized)

Core was generated by `/test/MD200721-mariadb-10.7.0-linux-x86_64-opt/bin/mysqld --no-defaults --core-'.
Program terminated with signal SIGABRT, Aborted.
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
[Current thread is 1 (Thread 0x149788f0b700 (LWP 3108377))]
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x000014979dd9f859 in __GI_abort () at abort.c:79
#2  0x00005609cb5b2b05 in ut_dbg_assertion_failed (expr=expr@entry=0x5609cc1cfa10 "dict_tf2_is_valid(flags, flags2)", file=file@entry=0x5609cc1cf9a0 "/test/10.7_opt/storage/innobase/dict/dict0mem.cc", line=line@entry=142) at /test/10.7_opt/storage/innobase/ut/ut0dbg.cc:60
#3  0x00005609cb5c1984 in dict_table_t::create (name=@0x149788f07670: {data_ = 0x149788f07ee0 "test/t", size_ = 6}, space=space@entry=0x0, n_cols=1, n_v_cols=0, flags=161, flags2=80) at /test/10.7_opt/storage/innobase/dict/dict0mem.cc:142
#4  0x00005609cbc3859f in create_table_info_t::create_table_def (this=0x149788f07e80) at /test/10.7_opt/include/span.h:66
#5  0x00005609cbc36f85 in create_table_info_t::create_table (this=0x149788f07e80, create_fk=<optimized out>) at /test/10.7_opt/storage/innobase/handler/ha_innodb.cc:12586
#6  0x00005609cbc3b121 in ha_innobase::create (this=<optimized out>, name=0x149788f09780 "./test/t", form=<optimized out>, create_info=<optimized out>, file_per_table=<optimized out>, trx=0x14978915a230) at /test/10.7_opt/storage/innobase/handler/ha_innodb.cc:13135
#7  0x00005609cb958f34 in handler::ha_create (this=<optimized out>, name=<optimized out>, form=0x149788f08420, info_arg=0x149788f09c70) at /test/10.7_opt/sql/handler.cc:5405
#8  0x00005609cb95983a in ha_create_table (thd=thd@entry=0x149744000c58, path=<optimized out>, db=0x149744010fe0 "test", table_name=0x1497440108c8 "t", create_info=create_info@entry=0x149788f09c70, frm=frm@entry=0x149788f09770, skip_frm_file=false) at /test/10.7_opt/sql/handler.cc:5870
#9  0x00005609cb7c3635 in create_table_impl (thd=thd@entry=0x149744000c58, ddl_log_state_create=ddl_log_state_create@entry=0x149788f09a20, ddl_log_state_rm=<optimized out>, orig_db=@0x149744010918: {str = 0x149744010fe0 "test", length = 4}, orig_table_name=@0x149744010928: {str = 0x1497440108c8 "t", length = 1}, db=@0x149744010918: {str = 0x149744010fe0 "test", length = 4}, table_name=@0x149744010928: {str = 0x1497440108c8 "t", length = 1}, path=@0x149788f09760: {str = 0x149788f09780 "./test/t", length = 8}, options={m_options = DDL_options_st::OPT_NONE}, create_info=0x149788f09c70, alter_info=0x149788f09b80, create_table_mode=0, is_trans=0x149788f09a1f, key_info=0x149788f09758, key_count=0x149788f09754, frm=0x149788f09770) at /test/10.7_opt/sql/sql_table.cc:4449
#10 0x00005609cb7c3fb8 in mysql_create_table_no_lock (thd=thd@entry=0x149744000c58, ddl_log_state_create=ddl_log_state_create@entry=0x149788f09a20, ddl_log_state_rm=ddl_log_state_rm@entry=0x149788f09a40, db=db@entry=0x149744010918, table_name=table_name@entry=0x149744010928, create_info=create_info@entry=0x149788f09c70, alter_info=0x149788f09b80, is_trans=0x149788f09a1f, create_table_mode=0, table_list=0x149744010900) at /test/10.7_opt/sql/sql_table.cc:4548
#11 0x00005609cb7c43a4 in mysql_create_table (thd=thd@entry=0x149744000c58, create_table=create_table@entry=0x149744010900, create_info=create_info@entry=0x149788f09c70, alter_info=alter_info@entry=0x149788f09b80) at /test/10.7_opt/sql/sql_table.cc:4660
#12 0x00005609cb7c5c39 in Sql_cmd_create_table_like::execute (this=<optimized out>, thd=0x149744000c58) at /test/10.7_opt/sql/sql_table.cc:11775
#13 0x00005609cb71492e in mysql_execute_command (thd=0x149744000c58, is_called_from_prepared_stmt=<optimized out>) at /test/10.7_opt/sql/sql_parse.cc:5993
#14 0x00005609cb704d46 in mysql_parse (thd=0x149744000c58, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at /test/10.7_opt/sql/sql_parse.cc:8026
#15 0x00005609cb710c35 in dispatch_command (command=COM_QUERY, thd=0x149744000c58, packet=<optimized out>, packet_length=<optimized out>, blocking=<optimized out>) at /test/10.7_opt/sql/sql_class.h:1340
#16 0x00005609cb712b57 in do_command (thd=0x149744000c58, blocking=blocking@entry=true) at /test/10.7_opt/sql/sql_parse.cc:1404
#17 0x00005609cb82dfe7 in do_handle_one_connection (connect=<optimized out>, put_in_cache=true) at /test/10.7_opt/sql/sql_connect.cc:1410
#18 0x00005609cb82e34d in handle_one_connection (arg=arg@entry=0x5609cdbe4dd8) at /test/10.7_opt/sql/sql_connect.cc:1312
#19 0x00005609cbb802d8 in pfs_spawn_thread (arg=0x5609cd7babe8) at /test/10.7_opt/storage/perfschema/pfs.cc:2201
#20 0x000014979e2ae609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#21 0x000014979de9c293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Bug confirmed present in:
MariaDB: 10.2.39 (dbg), 10.2.39 (opt), 10.3.30 (dbg), 10.3.30 (opt), 10.4.20 (dbg), 10.4.20 (opt), 10.5.11 (dbg), 10.5.11 (opt), 10.6.4 (dbg), 10.6.4 (opt), 10.7.0 (dbg), 10.7.0 (opt)

Bug (or feature/syntax) confirmed not present in:
MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.34 (dbg), 5.7.34 (opt), 8.0.24 (dbg), 8.0.24 (opt)

Comment by Roel Van de Paar [ 2021-08-10 ]

Earlier testcase by Ramesh gives a slightly different trace (which was not currently filtered yet).

CREATE TABLE tp (a INT)ENGINE=InnoDB ROW_FORMAT=DYNAMIC page_compressed=1;
SET GLOBAL innodb_compression_level=-1;
ALTER TABLE tp ENGINE=InnoDB;

Leads to:

10.7.0 71ed8c136fa203b9b3a678a6d5cc72235ef73ef7 (Optimized)

Core was generated by `/test/MD200721-mariadb-10.7.0-linux-x86_64-opt/bin/mysqld --no-defaults --core-'.
Program terminated with signal SIGABRT, Aborted.
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
[Current thread is 1 (Thread 0x14e708adb700 (LWP 3344570))]
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x000014e70b65f859 in __GI_abort () at abort.c:79
#2  0x000055fafcea4b05 in ut_dbg_assertion_failed (expr=expr@entry=0x55fafdac1a10 "dict_tf2_is_valid(flags, flags2)", file=file@entry=0x55fafdac19a0 "/test/10.7_opt/storage/innobase/dict/dict0mem.cc", line=line@entry=142) at /test/10.7_opt/storage/innobase/ut/ut0dbg.cc:60
#3  0x000055fafceb3984 in dict_table_t::create (name=@0x14e708ad6390: {data_ = 0x14e6b801f3f8 "test/#sql-alter-33078b-4", size_ = 24}, space=space@entry=0x0, n_cols=1, n_v_cols=n_v_cols@entry=0, flags=flags@entry=161, flags2=flags2@entry=80) at /test/10.7_opt/storage/innobase/dict/dict0mem.cc:142
#4  0x000055fafd53525c in prepare_inplace_alter_table_dict (ha_alter_info=<optimized out>, altered_table=<optimized out>, old_table=<optimized out>, table_name=<optimized out>, flags=<optimized out>, flags2=80, fts_doc_id_col=<optimized out>, add_fts_doc_id=<optimized out>, add_fts_doc_id_idx=<optimized out>) at /test/10.7_opt/include/span.h:66
#5  0x000055fafd53b7aa in ha_innobase::prepare_inplace_alter_table (this=<optimized out>, altered_table=<optimized out>, ha_alter_info=<optimized out>) at /test/10.7_opt/storage/innobase/handler/ha_innodb.h:699
#6  0x000055fafd0ade4c in mysql_inplace_alter_table (thd=0x14e6b8000c58, table_list=0x14e6b8010890, table=0x14e6b801bbf8, altered_table=0x14e708ad73b0, ha_alter_info=0x14e708ad72f0, ddl_log_state=0x14e708ad72d0, trigger_param=0x14e708ad7780, alter_ctx=0x14e708ad8790, target_mdl_request=<optimized out>) at /test/10.7_opt/sql/sql_table.cc:7328
#7  0x000055fafd0bd34c in mysql_alter_table (thd=thd@entry=0x14e6b8000c58, new_db=new_db@entry=0x14e6b80056a8, new_name=new_name@entry=0x14e6b8005ac0, create_info=create_info@entry=0x14e708ad9590, table_list=<optimized out>, table_list@entry=0x14e6b8010890, alter_info=alter_info@entry=0x14e708ad94a0, order_num=0, order=0x0, ignore=false, if_exists=false) at /test/10.7_opt/sql/sql_table.cc:10207
#8  0x000055fafd124e4d in Sql_cmd_alter_table::execute (this=<optimized out>, thd=0x14e6b8000c58) at /test/10.7_opt/sql/structs.h:568
#9  0x000055fafd00692e in mysql_execute_command (thd=0x14e6b8000c58, is_called_from_prepared_stmt=<optimized out>) at /test/10.7_opt/sql/sql_parse.cc:5993
#10 0x000055fafcff6d46 in mysql_parse (thd=0x14e6b8000c58, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at /test/10.7_opt/sql/sql_parse.cc:8026
#11 0x000055fafd002c35 in dispatch_command (command=COM_QUERY, thd=0x14e6b8000c58, packet=<optimized out>, packet_length=<optimized out>, blocking=<optimized out>) at /test/10.7_opt/sql/sql_class.h:1340
#12 0x000055fafd004b57 in do_command (thd=0x14e6b8000c58, blocking=blocking@entry=true) at /test/10.7_opt/sql/sql_parse.cc:1404
#13 0x000055fafd11ffe7 in do_handle_one_connection (connect=<optimized out>, put_in_cache=true) at /test/10.7_opt/sql/sql_connect.cc:1410
#14 0x000055fafd12034d in handle_one_connection (arg=arg@entry=0x55fb002d4dd8) at /test/10.7_opt/sql/sql_connect.cc:1312
#15 0x000055fafd4722d8 in pfs_spawn_thread (arg=0x55faffeaabe8) at /test/10.7_opt/storage/perfschema/pfs.cc:2201
#16 0x000014e70bb6e609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#17 0x000014e70b75c293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Bug confirmed present in:
MariaDB: 10.2.39 (dbg), 10.2.39 (opt), 10.3.30 (dbg), 10.3.30 (opt), 10.4.20 (dbg), 10.4.20 (opt), 10.5.11 (dbg), 10.5.11 (opt), 10.6.4 (dbg), 10.6.4 (opt), 10.7.0 (dbg), 10.7.0 (opt)

Bug (or feature/syntax) confirmed not present in:
MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.34 (dbg), 5.7.34 (opt), 8.0.24 (dbg), 8.0.24 (opt)

Comment by Adam Reece [ 2021-09-27 ]

We've hit this issue when NextCloud is upgraded from version 21 to 22 due to query ALTER TABLE oc_calendars ADD deleted_at INT UNSIGNED DEFAULT NULL from the "dav" component.

After the restart and crash recovery the column exists as expected.

2021-09-27 14:33:47 0x7f26cd751700  InnoDB: Assertion failure in file /build/mariadb-10.3-XTU5dn/mariadb-10.3-10.3.29/storage/innoba
se/dict/dict0mem.cc line 143
InnoDB: Failing assertion: dict_tf2_is_valid(flags, flags2)
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to https://jira.mariadb.org/
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: https://mariadb.com/kb/en/library/innodb-recovery-modes/
InnoDB: about forcing recovery.
210927 14:33:47 [ERROR] mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
 
To report this bug, see https://mariadb.com/kb/en/reporting-bugs
 
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.
 
Server version: 10.3.29-MariaDB-0+deb10u1-log
key_buffer_size=100663296
read_buffer_size=67108864
max_used_connections=25
max_threads=502
thread_count=31
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 34036775 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
 
Thread pointer: 0x7f2680002098
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...
stack_bottom = 0x7f26cd750da8 thread_stack 0x30000
/usr/sbin/mysqld(my_print_stacktrace+0x2e)[0x5601cd63a31e]
/usr/sbin/mysqld(handle_fatal_signal+0x54d)[0x5601cd16557d]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12730)[0x7f2818701730]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x10b)[0x7f28185657bb]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x121)[0x7f2818550535]
/usr/sbin/mysqld(+0x4e92f9)[0x5601ccea72f9]
/usr/sbin/mysqld(+0xaaf51b)[0x5601cd46d51b]
/usr/sbin/mysqld(+0x9361d2)[0x5601cd2f41d2]
/usr/sbin/mysqld(+0x93af49)[0x5601cd2f8f49]
/usr/sbin/mysqld(+0x6563c3)[0x5601cd0143c3]
/usr/sbin/mysqld(_Z17mysql_alter_tableP3THDPK25st_mysql_const_lex_stringS3_P14HA_CREATE_INFOP10TABLE_LISTP10Alter_infojP8st_orderb+$
x3ebb)[0x5601cd01ee8b]
/usr/sbin/mysqld(_ZN19Sql_cmd_alter_table7executeEP3THD+0x2b2)[0x5601cd06cc82]
/usr/sbin/mysqld(_Z21mysql_execute_commandP3THD+0x3241)[0x5601ccf8faf1]
/usr/sbin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_statebb+0x1c9)[0x5601ccf94219]
/usr/sbin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcjbb+0x111d)[0x5601ccf960ad]
/usr/sbin/mysqld(_Z10do_commandP3THD+0x122)[0x5601ccf97842]
/usr/sbin/mysqld(_Z24do_handle_one_connectionP7CONNECT+0x23a)[0x5601cd06a17a]
/usr/sbin/mysqld(handle_one_connection+0x3d)[0x5601cd06a2fd]
/usr/sbin/mysqld(+0xc067cb)[0x5601cd5c47cb]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x7fa3)[0x7f28186f6fa3]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x3f)[0x7f28186274cf]
 
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0x7f268000fb40): ALTER TABLE oc_calendars ADD deleted_at INT UNSIGNED DEFAULT NULL
 
Connection ID (thread ID): 64
Status: NOT_KILLED
 
Optimizer switch: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_inters$
ction=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=o$
,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,$
rr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,$
oin_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,con$
ition_pushdown_for_derived=on,split_materialized=on

Comment by Adam Reece [ 2021-09-27 ]

^ Strangely that was resolved by doing a mysqldump/mysql cycle to rebuild it.

Comment by Roel Van de Paar [ 2021-09-27 ]

adamreece.webbox Thank you. Can you please add {noformat} tags around the dump please? Please add the tag in a line above and below the output to format it correctly. (p.s. double {{ }} tags do not work for multi-line comments, only for inline items).

Comment by Adam Reece [ 2021-09-28 ]

@Roel Van de Parr thanks for the tip. I'd tried a few edits already to get the whole thing in a multiline preformatted block. I'll do that now,
Looks like mentions don't work with spaces, or is there some special syntax for that too?

Comment by Roel Van de Paar [ 2021-09-28 ]

adamreece.webbox Looking good! Yes start a mention with @ and select from the resulting list! Likely the mention to me did not work due to a slight misspelling

Comment by Marko Mäkelä [ 2021-10-20 ]

Here is a simpler test case:

--source include/have_innodb.inc
SET GLOBAL innodb_compression_level=0;
CREATE TABLE t(c INT) ENGINE=InnoDB page_compressed=1;

ROW_FORMAT=COMPRESSED is not affected, and with ROW_FORMAT=REDUNDANT it would fail like this (even with innodb_strict_mode=OFF):

10.2 1a54cf62f85044a7686dc3becfe39e6b52209484

mysqltest: At line 3: query 'CREATE TABLE t(c INT) ENGINE=InnoDB ROW_FORMAT=REDUNDANT page_compressed=1' failed: 1005: Can't create table `test`.`t` (errno: 140 "Wrong create options")

The immediate cause is the following in dict_tf_is_valid_not_redundant():

	switch (DICT_TF_GET_PAGE_COMPRESSION_LEVEL(flags)) {
	case 0:
		/* PAGE_COMPRESSION_LEVEL=0 should imply PAGE_COMPRESSED=NO */
		return(!DICT_TF_GET_PAGE_COMPRESSION(flags));

That check was originally added in MDEV-12873 to address a data dictionary incompatibility issue.

Comment by Manuel Arostegui [ 2022-02-09 ]

For what is worth, I am hitting this same error on 10.4.22 (debian bullseye):

mysql:root@localhost [frwiki]> show create table templatelinks\G
*************************** 1. row ***************************
       Table: templatelinks
Create Table: CREATE TABLE `templatelinks` (
  `tl_from` int(8) unsigned NOT NULL DEFAULT 0,
  `tl_namespace` int(11) NOT NULL DEFAULT 0,
  `tl_title` varbinary(255) NOT NULL DEFAULT '',
  `tl_from_namespace` int(11) NOT NULL DEFAULT 0,
  PRIMARY KEY (`tl_from`,`tl_namespace`,`tl_title`),
  KEY `tl_namespace` (`tl_namespace`,`tl_title`,`tl_from`),
  KEY `tl_backlinks_namespace` (`tl_from_namespace`,`tl_namespace`,`tl_title`,`tl_from`)
) ENGINE=InnoDB DEFAULT CHARSET=binary ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8
1 row in set (0.000 sec)
 
 
mysql:root@localhost [frwiki]> ALTER TABLE   templatelinks ADD  tl_target_id BIGINT UNSIGNED DEFAULT NULL;
ERROR 2013 (HY000): Lost connection to MySQL server during query

Checking logs:

Feb 09 06:15:38 db2076 mysqld[694365]: 2022-02-09 06:15:38 0x7f7c95f65700  InnoDB: Assertion failure in file /root/mariadb-10.4.22/storage/innobase/dict/dict0mem.cc line 152
Feb 09 06:15:38 db2076 mysqld[694365]: InnoDB: Failing assertion: dict_tf2_is_valid(flags, flags2)
Feb 09 06:15:38 db2076 mysqld[694365]: InnoDB: We intentionally generate a memory trap.
Feb 09 06:15:38 db2076 mysqld[694365]: InnoDB: Submit a detailed bug report to https://jira.mariadb.org/
Feb 09 06:15:38 db2076 mysqld[694365]: InnoDB: If you get repeated assertion failures or crashes, even
Feb 09 06:15:38 db2076 mysqld[694365]: InnoDB: immediately after the mysqld startup, there may be
Feb 09 06:15:38 db2076 mysqld[694365]: InnoDB: corruption in the InnoDB tablespace. Please refer to
Feb 09 06:15:38 db2076 mysqld[694365]: InnoDB: https://mariadb.com/kb/en/library/innodb-recovery-modes/
Feb 09 06:15:38 db2076 mysqld[694365]: InnoDB: about forcing recovery.
 
 
Feb 09 06:15:38 db2076 mysqld[694365]: stack_bottom = 0x7f7c95f64cb8 thread_stack 0x30000
Feb 09 06:15:39 db2076 mysqld[694365]: /opt/wmf-mariadb104/bin/mysqld(my_print_stacktrace+0x2e)[0x55618c0d1dbe]
Feb 09 06:15:39 db2076 mysqld[694365]: /opt/wmf-mariadb104/bin/mysqld(handle_fatal_signal+0x54d)[0x55618bb9388d]
Feb 09 06:15:39 db2076 mysqld[694365]: /lib/x86_64-linux-gnu/libpthread.so.0(+0x14140)[0x7fdd344af140]
Feb 09 06:15:39 db2076 mysqld[694365]: /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x141)[0x7fdd33ff8ce1]
Feb 09 06:15:39 db2076 mysqld[694365]: /lib/x86_64-linux-gnu/libc.so.6(abort+0x123)[0x7fdd33fe2537]
Feb 09 06:15:40 db2076 mysqld[694365]: /opt/wmf-mariadb104/bin/mysqld(+0x5b967a)[0x55618b85b67a]
Feb 09 06:15:40 db2076 mysqld[694365]: /opt/wmf-mariadb104/bin/mysqld(+0x5cc8c7)[0x55618b86e8c7]
Feb 09 06:15:40 db2076 mysqld[694365]: /opt/wmf-mariadb104/bin/mysqld(+0xad631f)[0x55618bd7831f]
Feb 09 06:15:40 db2076 mysqld[694365]: /opt/wmf-mariadb104/bin/mysqld(+0xad9f18)[0x55618bd7bf18]
Feb 09 06:15:40 db2076 mysqld[694365]: /opt/wmf-mariadb104/bin/mysqld(+0x7697e8)[0x55618ba0b7e8]
Feb 09 06:15:40 db2076 mysqld[694365]: /opt/wmf-mariadb104/bin/mysqld(_Z17mysql_alter_tableP3THDPK25st_mysql_const_lex_stringS3_P14HA_CREATE_INFOP10TABLE_LISTP10Alter_infojP8st_orderb+0x3e94)[0x55618ba18384]
Feb 09 06:15:40 db2076 mysqld[694365]: /opt/wmf-mariadb104/bin/mysqld(_ZN19Sql_cmd_alter_table7executeEP3THD+0x347)[0x55618ba718b7]
Feb 09 06:15:40 db2076 mysqld[694365]: /opt/wmf-mariadb104/bin/mysqld(_Z21mysql_execute_commandP3THD+0x631f)[0x55618b971e6f]
Feb 09 06:15:40 db2076 mysqld[694365]: /opt/wmf-mariadb104/bin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_statebb+0x223)[0x55618b973e13]
Feb 09 06:15:40 db2076 mysqld[694365]: /opt/wmf-mariadb104/bin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcjbb+0x126d)[0x55618b97644d]
Feb 09 06:15:40 db2076 mysqld[694365]: /opt/wmf-mariadb104/bin/mysqld(_Z10do_commandP3THD+0x13c)[0x55618b978b8c]
Feb 09 06:15:40 db2076 mysqld[694365]: /opt/wmf-mariadb104/bin/mysqld(_Z11tp_callbackP13TP_connection+0x88)[0x55618bb65608]
Feb 09 06:15:40 db2076 mysqld[694365]: /opt/wmf-mariadb104/bin/mysqld(+0xa9950d)[0x55618bd3b50d]
Feb 09 06:15:40 db2076 mysqld[694365]: /opt/wmf-mariadb104/bin/mysqld(+0xddf482)[0x55618c081482]
Feb 09 06:15:40 db2076 mysqld[694365]: /lib/x86_64-linux-gnu/libpthread.so.0(+0x8ea7)[0x7fdd344a3ea7]
Feb 09 06:15:40 db2076 mysqld[694365]: /lib/x86_64-linux-gnu/libc.so.6(clone+0x3f)[0x7fdd340badef]
Feb 09 06:15:40 db2076 mysqld[694365]: Trying to get some variables.
Feb 09 06:15:40 db2076 mysqld[694365]: Some pointers may be invalid and cause the dump to abort.
Feb 09 06:15:40 db2076 mysqld[694365]: Query (0x7f7c2c0125a0): ALTER TABLE   templatelinks ADD  tl_target_id BIGINT UNSIGNED DEFAULT NULL
Feb 09 06:15:40 db2076 mysqld[694365]: Connection ID (thread ID): 18
Feb 09 06:15:40 db2076 mysqld[694365]: Status: NOT_KILLED
Feb 09 06:15:40 db2076 mysqld[694365]: Optimizer switch: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_ke>
Feb 09 06:15:40 db2076 mysqld[694365]: The manual page at https://mariadb.com/kb/en/how-to-produce-a-full-stack-trace-for-mysqld/ contains
Feb 09 06:15:40 db2076 mysqld[694365]: information that should help you find out what is causing the crash.
Feb 09 06:15:40 db2076 mysqld[694365]: Writing a core file...
Feb 09 06:15:40 db2076 mysqld[694365]: Working directory at /srv/sqldata
Feb 09 06:15:40 db2076 mysqld[694365]: Resource Limits:
Feb 09 06:15:40 db2076 mysqld[694365]: Limit                     Soft Limit           Hard Limit           Units
Feb 09 06:15:40 db2076 mysqld[694365]: Max cpu time              unlimited            unlimited            seconds
Feb 09 06:15:40 db2076 mysqld[694365]: Max file size             unlimited            unlimited            bytes
Feb 09 06:15:40 db2076 mysqld[694365]: Max data size             unlimited            unlimited            bytes
Feb 09 06:15:40 db2076 mysqld[694365]: Max stack size            8388608              unlimited            bytes
Feb 09 06:15:40 db2076 mysqld[694365]: Max core file size        0                    0                    bytes
Feb 09 06:15:40 db2076 mysqld[694365]: Max resident set          unlimited            unlimited            bytes
Feb 09 06:15:40 db2076 mysqld[694365]: Max processes             2063462              2063462              processes
Feb 09 06:15:40 db2076 mysqld[694365]: Max open files            200001               200001               files
Feb 09 06:15:40 db2076 mysqld[694365]: Max locked memory         65536                65536                bytes
Feb 09 06:15:40 db2076 mysqld[694365]: Max address space         unlimited            unlimited            bytes
Feb 09 06:15:40 db2076 mysqld[694365]: Max file locks            unlimited            unlimited            locks
Feb 09 06:15:40 db2076 mysqld[694365]: Max pending signals       2063462              2063462              signals
Feb 09 06:15:40 db2076 mysqld[694365]: Max msgqueue size         819200               819200               bytes
Feb 09 06:15:40 db2076 mysqld[694365]: Max nice priority         0                    0
Feb 09 06:15:40 db2076 mysqld[694365]: Max realtime priority     0                    0
Feb 09 06:15:40 db2076 mysqld[694365]: Max realtime timeout      unlimited            unlimited            us
Feb 09 06:15:40 db2076 mysqld[694365]: Core pattern: /var/tmp/core/core.%h.%e.%p.%t

Comment by Marko Mäkelä [ 2022-02-09 ]

marostegui, please file a new bug for that, and please include the INFORMATION_SCHEMA.INNODB_SYS_TABLES record for that table. I was not able to repeat any crash on mariadb-10.4.22 with the CREATE TABLE and ALTER TABLE statements.

Comment by Manuel Arostegui [ 2022-02-15 ]

marko done https://jira.mariadb.org/browse/MDEV-27852 I am able to reproduce it simply by starting replication (as it comes from the master). Let's continue there.

Generated at Thu Feb 08 09:16:12 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.