Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-24796

Assertion `page_has_next(block->frame) || rec_is_alter_metadata(p, *index) || block->page.id().page_no() != index->page' failed in btr_pcur_store_position and other related asserts

Details

    Description

      Testcase is lightly sporadic. Works almost always first go.

      CREATE TABLE t (c INT KEY) ENGINE=InnoDB;
      INSERT INTO t VALUES(1),(2);
      SET GLOBAL innodb_limit_optimistic_insert_debug=2;
      ALTER TABLE t ADD COLUMN d INT;
      DELETE FROM t;
      SELECT * FROM t WHERE c<>1 ORDER BY c DESC;
      

      Leads to:

      10.6.0 3f871b339429441ad907ecf7dfabdc414797e664 (Debug)

      mysqld: /data/builds/10.6_dbg/storage/innobase/btr/btr0pcur.cc:177: void btr_pcur_store_position(btr_pcur_t*, mtr_t*): Assertion `page_has_next(block->frame) || rec_is_alter_metadata(p, *index) || block->page.id().page_no() != index->page' failed.
      

      10.6.0 3f871b339429441ad907ecf7dfabdc414797e664 (Debug)

      Core was generated by `/test/MD260121-mariadb-10.6.0-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:56
      [Current thread is 1 (Thread 0x1522a8797700 (LWP 3756089))]
      (gdb) bt
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
      #1  0x000055b12fe36210 in my_write_core (sig=sig@entry=6) at /data/builds/10.6_dbg/mysys/stacktrace.c:424
      #2  0x000055b12f5cb2d0 in handle_fatal_signal (sig=6) at /data/builds/10.6_dbg/sql/signal_handler.cc:330
      #3  <signal handler called>
      #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #5  0x00001522ab355859 in __GI_abort () at abort.c:79
      #6  0x00001522ab355729 in __assert_fail_base (fmt=0x1522ab4eb588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55b130257d70 "page_has_next(block->frame) || rec_is_alter_metadata(p, *index) || block->page.id().page_no() != index->page", file=0x55b130257a18 "/data/builds/10.6_dbg/storage/innobase/btr/btr0pcur.cc", line=177, function=<optimized out>) at assert.c:92
      #7  0x00001522ab366f36 in __GI___assert_fail (assertion=assertion@entry=0x55b130257d70 "page_has_next(block->frame) || rec_is_alter_metadata(p, *index) || block->page.id().page_no() != index->page", file=file@entry=0x55b130257a18 "/data/builds/10.6_dbg/storage/innobase/btr/btr0pcur.cc", line=line@entry=177, function=function@entry=0x55b130257bd0 "void btr_pcur_store_position(btr_pcur_t*, mtr_t*)") at assert.c:101
      #8  0x000055b12fc70abe in btr_pcur_store_position (cursor=cursor@entry=0x152264023f20, mtr=mtr@entry=0x1522a8794f70) at /data/builds/10.6_dbg/storage/innobase/include/buf0types.h:159
      #9  0x000055b12fb9961e in row_search_mvcc (buf=buf@entry=0x152264079498 "\377", mode=<optimized out>, prebuilt=0x152264023d58, match_mode=<optimized out>, direction=direction@entry=0) at /data/builds/10.6_dbg/storage/innobase/row/row0sel.cc:5715
      #10 0x000055b12f9d7067 in ha_innobase::index_read (this=this@entry=0x15226406b6b0, buf=buf@entry=0x152264079498 "\377", key_ptr=key_ptr@entry=0x0, key_len=key_len@entry=0, find_flag=find_flag@entry=HA_READ_BEFORE_KEY) at /data/builds/10.6_dbg/storage/innobase/handler/ha_innodb.cc:8545
      #11 0x000055b12f9d7424 in ha_innobase::index_last (this=0x15226406b6b0, buf=0x152264079498 "\377") at /data/builds/10.6_dbg/storage/innobase/handler/ha_innodb.cc:8930
      #12 0x000055b12f5d5ea1 in handler::ha_index_last (this=0x15226406b6b0, buf=0x152264079498 "\377") at /data/builds/10.6_dbg/sql/handler.cc:3237
      #13 0x000055b12f79b08a in QUICK_SELECT_DESC::get_next (this=0x15226407edf0) at /data/builds/10.6_dbg/sql/opt_range.cc:12562
      #14 0x000055b12f7a6a68 in rr_quick (info=0x152264016358) at /data/builds/10.6_dbg/sql/records.cc:403
      #15 0x000055b12f3694ac in READ_RECORD::read_record (this=0x152264016358) at /data/builds/10.6_dbg/sql/records.h:81
      #16 join_init_read_record (tab=0x152264016290) at /data/builds/10.6_dbg/sql/sql_select.cc:21577
      #17 0x000055b12f34feea in sub_select (join=0x152264014370, join_tab=0x152264016290, end_of_records=<optimized out>) at /data/builds/10.6_dbg/sql/sql_select.cc:20599
      #18 0x000055b12f388a22 in do_select (procedure=0x0, join=0x152264014370) at /data/builds/10.6_dbg/sql/sql_select.cc:20149
      #19 JOIN::exec_inner (this=this@entry=0x152264014370) at /data/builds/10.6_dbg/sql/sql_select.cc:4476
      #20 0x000055b12f388e92 in JOIN::exec (this=this@entry=0x152264014370) at /data/builds/10.6_dbg/sql/sql_select.cc:4256
      #21 0x000055b12f3870f2 in mysql_select (thd=thd@entry=0x152264000db8, tables=0x152264012d68, fields=@0x1522640128c8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x152264012d20, last = 0x152264014ba8, elements = 2}, <No data fields>}, conds=0x152264013638, og_num=1, order=0x1522640141e8, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x152264014348, unit=0x152264004f80, select_lex=0x152264012778) at /data/builds/10.6_dbg/sql/sql_select.cc:4672
      #22 0x000055b12f3873b8 in handle_select (thd=thd@entry=0x152264000db8, lex=lex@entry=0x152264004eb8, result=result@entry=0x152264014348, setup_tables_done_option=setup_tables_done_option@entry=0) at /data/builds/10.6_dbg/sql/sql_select.cc:417
      #23 0x000055b12f2fa1f4 in execute_sqlcom_select (thd=thd@entry=0x152264000db8, all_tables=0x152264012d68) at /data/builds/10.6_dbg/sql/sql_parse.cc:6133
      #24 0x000055b12f306cec in mysql_execute_command (thd=thd@entry=0x152264000db8) at /data/builds/10.6_dbg/sql/sql_parse.cc:3829
      #25 0x000055b12f2f315e in mysql_parse (thd=thd@entry=0x152264000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1522a87963d0) at /data/builds/10.6_dbg/sql/sql_parse.cc:7901
      #26 0x000055b12f30124f in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x152264000db8, packet=packet@entry=0x15226401aac9 "", packet_length=packet_length@entry=42) at /data/builds/10.6_dbg/sql/sql_class.h:1294
      #27 0x000055b12f304581 in do_command (thd=0x152264000db8) at /data/builds/10.6_dbg/sql/sql_parse.cc:1365
      #28 0x000055b12f460079 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55b1322bd128, put_in_cache=put_in_cache@entry=true) at /data/builds/10.6_dbg/sql/sql_connect.cc:1410
      #29 0x000055b12f46077d in handle_one_connection (arg=arg@entry=0x55b1322bd128) at /data/builds/10.6_dbg/sql/sql_connect.cc:1312
      #30 0x000055b12f91343f in pfs_spawn_thread (arg=0x55b1321f2138) at /data/builds/10.6_dbg/storage/perfschema/pfs.cc:2201
      #31 0x00001522ab863609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #32 0x00001522ab452293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      10.5.9 927a882341eb1087e71d64de4e8cd89ab520de89 (Debug)

      mysqld: /data/builds/10.5_dbg/storage/innobase/btr/btr0pcur.cc:177: void btr_pcur_store_position(btr_pcur_t*, mtr_t*): Assertion `page_has_next(block->frame) || rec_is_alter_metadata(p, *index) || block->page.id().page_no() != index->page' failed.
      

      10.5.9 927a882341eb1087e71d64de4e8cd89ab520de89 (Debug)

      Core was generated by `/test/MD260121-mariadb-10.5.9-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:56
      [Current thread is 1 (Thread 0x14abc4073700 (LWP 3766451))]
      (gdb) bt
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
      #1  0x0000559d699cc64e in my_write_core (sig=sig@entry=6) at /data/builds/10.5_dbg/mysys/stacktrace.c:424
      #2  0x0000559d691211a8 in handle_fatal_signal (sig=6) at /data/builds/10.5_dbg/sql/signal_handler.cc:330
      #3  <signal handler called>
      #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #5  0x000014abc5c4d859 in __GI_abort () at abort.c:79
      #6  0x000014abc5c4d729 in __assert_fail_base (fmt=0x14abc5de3588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x559d69df2a30 "page_has_next(block->frame) || rec_is_alter_metadata(p, *index) || block->page.id().page_no() != index->page", file=0x559d69df2858 "/data/builds/10.5_dbg/storage/innobase/btr/btr0pcur.cc", line=177, function=<optimized out>) at assert.c:92
      #7  0x000014abc5c5ef36 in __GI___assert_fail (assertion=assertion@entry=0x559d69df2a30 "page_has_next(block->frame) || rec_is_alter_metadata(p, *index) || block->page.id().page_no() != index->page", file=file@entry=0x559d69df2858 "/data/builds/10.5_dbg/storage/innobase/btr/btr0pcur.cc", line=line@entry=177, function=function@entry=0x559d69df2890 "void btr_pcur_store_position(btr_pcur_t*, mtr_t*)") at assert.c:101
      #8  0x0000559d697ea63a in btr_pcur_store_position (cursor=cursor@entry=0x14ab80026c60, mtr=mtr@entry=0x14abc4070f50) at /data/builds/10.5_dbg/storage/innobase/include/buf0types.h:161
      #9  0x0000559d696fec72 in row_search_mvcc (buf=buf@entry=0x14ab800751b8 "\377", mode=<optimized out>, prebuilt=0x14ab80026a98, match_mode=<optimized out>, direction=direction@entry=0) at /data/builds/10.5_dbg/storage/innobase/row/row0sel.cc:5644
      #10 0x0000559d695294e3 in ha_innobase::index_read (this=this@entry=0x14ab80024910, buf=buf@entry=0x14ab800751b8 "\377", key_ptr=key_ptr@entry=0x0, key_len=key_len@entry=0, find_flag=find_flag@entry=HA_READ_BEFORE_KEY) at /data/builds/10.5_dbg/storage/innobase/handler/ha_innodb.cc:8757
      #11 0x0000559d695298a0 in ha_innobase::index_last (this=0x14ab80024910, buf=0x14ab800751b8 "\377") at /data/builds/10.5_dbg/storage/innobase/handler/ha_innodb.cc:9142
      #12 0x0000559d6912bd79 in handler::ha_index_last (this=0x14ab80024910, buf=0x14ab800751b8 "\377") at /data/builds/10.5_dbg/sql/handler.cc:3237
      #13 0x0000559d692f0f6e in QUICK_SELECT_DESC::get_next (this=0x14ab80027a20) at /data/builds/10.5_dbg/sql/opt_range.cc:12562
      #14 0x0000559d692fc94c in rr_quick (info=0x14ab800165b0) at /data/builds/10.5_dbg/sql/records.cc:403
      #15 0x0000559d68ebf1b1 in READ_RECORD::read_record (this=0x14ab800165b0) at /data/builds/10.5_dbg/sql/records.h:80
      #16 join_init_read_record (tab=0x14ab800164e8) at /data/builds/10.5_dbg/sql/sql_select.cc:21576
      #17 0x0000559d68ea5b88 in sub_select (join=0x14ab800145d0, join_tab=0x14ab800164e8, end_of_records=<optimized out>) at /data/builds/10.5_dbg/sql/sql_select.cc:20628
      #18 0x0000559d68ede6fc in do_select (procedure=0x0, join=0x14ab800145d0) at /data/builds/10.5_dbg/sql/sql_select.cc:20165
      #19 JOIN::exec_inner (this=this@entry=0x14ab800145d0) at /data/builds/10.5_dbg/sql/sql_select.cc:4466
      #20 0x0000559d68edeb6c in JOIN::exec (this=this@entry=0x14ab800145d0) at /data/builds/10.5_dbg/sql/sql_select.cc:4246
      #21 0x0000559d68edcdcc in mysql_select (thd=thd@entry=0x14ab80000db8, tables=0x14ab80012fc8, fields=@0x14ab80012b28: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14ab80012f80, last = 0x14ab80014e08, elements = 2}, <No data fields>}, conds=0x14ab80013898, og_num=1, order=0x14ab80014448, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x14ab800145a8, unit=0x14ab80004f58, select_lex=0x14ab800129d8) at /data/builds/10.5_dbg/sql/sql_select.cc:4662
      #22 0x0000559d68edd092 in handle_select (thd=thd@entry=0x14ab80000db8, lex=lex@entry=0x14ab80004e90, result=result@entry=0x14ab800145a8, setup_tables_done_option=setup_tables_done_option@entry=0) at /data/builds/10.5_dbg/sql/sql_select.cc:417
      #23 0x0000559d68e4f99f in execute_sqlcom_select (thd=thd@entry=0x14ab80000db8, all_tables=0x14ab80012fc8) at /data/builds/10.5_dbg/sql/sql_parse.cc:6281
      #24 0x0000559d68e5caa1 in mysql_execute_command (thd=thd@entry=0x14ab80000db8) at /data/builds/10.5_dbg/sql/sql_parse.cc:3977
      #25 0x0000559d68e488d8 in mysql_parse (thd=thd@entry=0x14ab80000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14abc40723d0, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/builds/10.5_dbg/sql/sql_parse.cc:8062
      #26 0x0000559d68e56be2 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14ab80000db8, packet=packet@entry=0x14ab8001ad29 "", packet_length=packet_length@entry=42, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/builds/10.5_dbg/sql/sql_class.h:1256
      #27 0x0000559d68e5a32f in do_command (thd=0x14ab80000db8) at /data/builds/10.5_dbg/sql/sql_parse.cc:1370
      #28 0x0000559d68fb5c83 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x559d6d412318, put_in_cache=put_in_cache@entry=true) at /data/builds/10.5_dbg/sql/sql_connect.cc:1410
      #29 0x0000559d68fb6387 in handle_one_connection (arg=arg@entry=0x559d6d412318) at /data/builds/10.5_dbg/sql/sql_connect.cc:1312
      #30 0x0000559d6946a79d in pfs_spawn_thread (arg=0x559d6d347f28) at /data/builds/10.5_dbg/storage/perfschema/pfs.cc:2201
      #31 0x000014abc615b609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #32 0x000014abc5d4a293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      10.4.18 e626f511f9dc4faee9ae98fb5a8c8c6ddd06679b (Debug)

      mysqld: /data/builds/10.4_dbg/storage/innobase/btr/btr0pcur.cc:172: void btr_pcur_store_position(btr_pcur_t*, mtr_t*): Assertion `page_has_next(block->frame) || rec_is_alter_metadata(p, *index) || block->page.id.page_no() != index->page' failed.
      

      10.4.18 e626f511f9dc4faee9ae98fb5a8c8c6ddd06679b (Debug)

      Core was generated by `/test/MD260121-mariadb-10.4.18-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:56
      [Current thread is 1 (Thread 0x14c61c04e700 (LWP 30292))]
      (gdb) bt
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
      #1  0x000055967c2ce077 in my_write_core (sig=sig@entry=6) at /data/builds/10.4_dbg/mysys/stacktrace.c:386
      #2  0x000055967b9e2437 in handle_fatal_signal (sig=6) at /data/builds/10.4_dbg/sql/signal_handler.cc:343
      #3  <signal handler called>
      #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #5  0x000014c61ed8f859 in __GI_abort () at abort.c:79
      #6  0x000014c61ed8f729 in __assert_fail_base (fmt=0x14c61ef25588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55967c5d8450 "page_has_next(block->frame) || rec_is_alter_metadata(p, *index) || block->page.id.page_no() != index->page", file=0x55967c5d8258 "/data/builds/10.4_dbg/storage/innobase/btr/btr0pcur.cc", line=172, function=<optimized out>) at assert.c:92
      #7  0x000014c61eda0f36 in __GI___assert_fail (assertion=assertion@entry=0x55967c5d8450 "page_has_next(block->frame) || rec_is_alter_metadata(p, *index) || block->page.id.page_no() != index->page", file=file@entry=0x55967c5d8258 "/data/builds/10.4_dbg/storage/innobase/btr/btr0pcur.cc", line=line@entry=172, function=function@entry=0x55967c5d8290 "void btr_pcur_store_position(btr_pcur_t*, mtr_t*)") at assert.c:101
      #8  0x000055967bf24226 in btr_pcur_store_position (cursor=cursor@entry=0x14c5c007cb80, mtr=mtr@entry=0x14c61c04acf0) at /data/builds/10.4_dbg/storage/innobase/include/buf0types.h:172
      #9  0x000055967be35329 in row_search_mvcc (buf=buf@entry=0x14c5c006a690 "\377", mode=<optimized out>, mode@entry=PAGE_CUR_L, prebuilt=0x14c5c007c9b0, match_mode=match_mode@entry=0, direction=direction@entry=0) at /data/builds/10.4_dbg/storage/innobase/row/row0sel.cc:5682
      #10 0x000055967bc52586 in ha_innobase::index_read (this=this@entry=0x14c5c0024b88, buf=buf@entry=0x14c5c006a690 "\377", key_ptr=key_ptr@entry=0x0, key_len=key_len@entry=0, find_flag=find_flag@entry=HA_READ_BEFORE_KEY) at /data/builds/10.4_dbg/storage/innobase/handler/ha_innodb.cc:9245
      #11 0x000055967bc529ca in ha_innobase::index_last (this=0x14c5c0024b88, buf=0x14c5c006a690 "\377") at /data/builds/10.4_dbg/storage/innobase/handler/ha_innodb.cc:9642
      #12 0x000055967b9ec2e5 in handler::ha_index_last (this=0x14c5c0024b88, buf=0x14c5c006a690 "\377") at /data/builds/10.4_dbg/sql/handler.cc:3033
      #13 0x000055967bba1dca in QUICK_SELECT_DESC::get_next (this=0x14c5c001fc50) at /data/builds/10.4_dbg/sql/opt_range.cc:12541
      #14 0x000055967bbad48f in rr_quick (info=0x14c5c0015a50) at /data/builds/10.4_dbg/sql/records.cc:369
      #15 0x000055967b7774cd in READ_RECORD::read_record (this=0x14c5c0015a50) at /data/builds/10.4_dbg/sql/records.h:70
      #16 join_init_read_record (tab=0x14c5c0015988) at /data/builds/10.4_dbg/sql/sql_select.cc:21347
      #17 0x000055967b75e647 in sub_select (join=0x14c5c0013ae8, join_tab=0x14c5c0015988, end_of_records=<optimized out>) at /data/builds/10.4_dbg/sql/sql_select.cc:20402
      #18 0x000055967b793120 in do_select (procedure=0x0, join=0x14c5c0013ae8) at /data/builds/10.4_dbg/sql/sql_select.cc:19943
      #19 JOIN::exec_inner (this=this@entry=0x14c5c0013ae8) at /data/builds/10.4_dbg/sql/sql_select.cc:4486
      #20 0x000055967b79358a in JOIN::exec (this=this@entry=0x14c5c0013ae8) at /data/builds/10.4_dbg/sql/sql_select.cc:4268
      #21 0x000055967b79183c in mysql_select (thd=thd@entry=0x14c5c0000d90, tables=0x14c5c0012570, wild_num=1, fields=@0x14c5c00120f8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14c5c0012528, last = 0x14c5c00142b8, elements = 2}, <No data fields>}, conds=0x14c5c0012df8, og_num=1, order=0x14c5c0013968, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x14c5c0013ac0, unit=0x14c5c0004cc0, select_lex=0x14c5c0011fb0) at /data/builds/10.4_dbg/sql/sql_select.cc:4703
      #22 0x000055967b791b65 in handle_select (thd=thd@entry=0x14c5c0000d90, lex=lex@entry=0x14c5c0004c00, result=result@entry=0x14c5c0013ac0, setup_tables_done_option=setup_tables_done_option@entry=0) at /data/builds/10.4_dbg/sql/sql_select.cc:410
      #23 0x000055967b7031a4 in execute_sqlcom_select (thd=thd@entry=0x14c5c0000d90, all_tables=0x14c5c0012570) at /data/builds/10.4_dbg/sql/sql_parse.cc:6417
      #24 0x000055967b70e69e in mysql_execute_command (thd=thd@entry=0x14c5c0000d90) at /data/builds/10.4_dbg/sql/sql_parse.cc:3936
      #25 0x000055967b719024 in mysql_parse (thd=thd@entry=0x14c5c0000d90, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14c61c04d490, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/builds/10.4_dbg/sql/sql_parse.cc:7958
      #26 0x000055967b71b87a in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14c5c0000d90, packet=packet@entry=0x14c5c001a331 "", packet_length=packet_length@entry=42, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/builds/10.4_dbg/sql/sql_class.h:1170
      #27 0x000055967b71f0d0 in do_command (thd=0x14c5c0000d90) at /data/builds/10.4_dbg/sql/sql_parse.cc:1373
      #28 0x000055967b857e04 in do_handle_one_connection (connect=connect@entry=0x55967fda1c10) at /data/builds/10.4_dbg/sql/sql_connect.cc:1412
      #29 0x000055967b857f23 in handle_one_connection (arg=0x55967fda1c10) at /data/builds/10.4_dbg/sql/sql_connect.cc:1316
      #30 0x000014c61f34c609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #31 0x000014c61ee8c293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      10.3.28 75538f94ca06915ddc22458b82b8e148e51dd0db (Debug)

      mysqld: /data/builds/10.3_dbg/storage/innobase/btr/btr0pcur.cc:172: void btr_pcur_store_position(btr_pcur_t*, mtr_t*): Assertion `page_has_next(block->frame) || block->page.id.page_no() != index->page' failed.
      

      10.3.28 75538f94ca06915ddc22458b82b8e148e51dd0db (Debug)

      Core was generated by `/test/MD260121-mariadb-10.3.28-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:56
      [Current thread is 1 (Thread 0x1470c410a700 (LWP 3771269))]
      (gdb) bt
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
      #1  0x000055d1f35e8bf5 in my_write_core (sig=sig@entry=6) at /data/builds/10.3_dbg/mysys/stacktrace.c:386
      #2  0x000055d1f2da533a in handle_fatal_signal (sig=6) at /data/builds/10.3_dbg/sql/signal_handler.cc:343
      #3  <signal handler called>
      #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #5  0x00001470da18a859 in __GI_abort () at abort.c:79
      #6  0x00001470da18a729 in __assert_fail_base (fmt=0x1470da320588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55d1f38a36d8 "page_has_next(block->frame) || block->page.id.page_no() != index->page", file=0x55d1f38a3548 "/data/builds/10.3_dbg/storage/innobase/btr/btr0pcur.cc", line=172, function=<optimized out>) at assert.c:92
      #7  0x00001470da19bf36 in __GI___assert_fail (assertion=assertion@entry=0x55d1f38a36d8 "page_has_next(block->frame) || block->page.id.page_no() != index->page", file=file@entry=0x55d1f38a3548 "/data/builds/10.3_dbg/storage/innobase/btr/btr0pcur.cc", line=line@entry=172, function=function@entry=0x55d1f38a3580 "void btr_pcur_store_position(btr_pcur_t*, mtr_t*)") at assert.c:101
      #8  0x000055d1f32a7cd7 in btr_pcur_store_position (cursor=cursor@entry=0x147070028618, mtr=mtr@entry=0x1470c4106ed0) at /data/builds/10.3_dbg/storage/innobase/include/buf0types.h:163
      #9  0x000055d1f31ac018 in row_search_mvcc (buf=buf@entry=0x14707001f4a0 "\377", mode=<optimized out>, mode@entry=PAGE_CUR_L, prebuilt=0x147070028450, match_mode=match_mode@entry=0, direction=direction@entry=0) at /data/builds/10.3_dbg/storage/innobase/row/row0sel.cc:5677
      #10 0x000055d1f2fdccb0 in ha_innobase::index_read (this=0x147070027268, buf=0x14707001f4a0 "\377", key_ptr=<optimized out>, key_len=<optimized out>, find_flag=<optimized out>) at /data/builds/10.3_dbg/storage/innobase/handler/ha_innodb.cc:9268
      #11 0x000055d1f2fbe6e4 in ha_innobase::index_last (this=0x147070027268, buf=0x14707001f4a0 "\377") at /data/builds/10.3_dbg/storage/innobase/handler/ha_innodb.cc:9665
      #12 0x000055d1f2daedf9 in handler::ha_index_last (this=0x147070027268, buf=0x14707001f4a0 "\377") at /data/builds/10.3_dbg/sql/handler.cc:3015
      #13 0x000055d1f2f384b6 in QUICK_SELECT_DESC::get_next (this=0x147070011150) at /data/builds/10.3_dbg/sql/opt_range.cc:11842
      #14 0x000055d1f2f4311f in rr_quick (info=0x147070014210) at /data/builds/10.3_dbg/sql/records.cc:369
      #15 0x000055d1f2b7a961 in READ_RECORD::read_record (this=0x147070014210) at /data/builds/10.3_dbg/sql/records.h:70
      #16 join_init_read_record (tab=0x147070014148) at /data/builds/10.3_dbg/sql/sql_select.cc:20647
      #17 0x000055d1f2b62193 in sub_select (join=0x147070012350, join_tab=0x147070014148, end_of_records=<optimized out>) at /data/builds/10.3_dbg/sql/sql_select.cc:19708
      #18 0x000055d1f2b93327 in do_select (procedure=<optimized out>, join=0x147070012350) at /data/builds/10.3_dbg/sql/sql_select.cc:19251
      #19 JOIN::exec_inner (this=this@entry=0x147070012350) at /data/builds/10.3_dbg/sql/sql_select.cc:4124
      #20 0x000055d1f2b93716 in JOIN::exec (this=this@entry=0x147070012350) at /data/builds/10.3_dbg/sql/sql_select.cc:3918
      #21 0x000055d1f2b9413d in mysql_select (thd=thd@entry=0x147070000d90, tables=0x147070011778, wild_num=1, fields=@0x147070005508: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x147070011730, last = 0x147070012b18, elements = 2}, <No data fields>}, conds=0x147070011f98, og_num=1, order=0x147070012210, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x147070012328, unit=0x147070004c58, select_lex=0x1470700053e0) at /data/builds/10.3_dbg/sql/sql_select.cc:4323
      #22 0x000055d1f2b943ec in handle_select (thd=thd@entry=0x147070000d90, lex=lex@entry=0x147070004b98, result=result@entry=0x147070012328, setup_tables_done_option=setup_tables_done_option@entry=0) at /data/builds/10.3_dbg/sql/sql_select.cc:370
      #23 0x000055d1f2b0c575 in execute_sqlcom_select (thd=thd@entry=0x147070000d90, all_tables=0x147070011778) at /data/builds/10.3_dbg/sql/sql_parse.cc:6316
      #24 0x000055d1f2b17238 in mysql_execute_command (thd=thd@entry=0x147070000d90) at /data/builds/10.3_dbg/sql/sql_parse.cc:3847
      #25 0x000055d1f2b21435 in mysql_parse (thd=thd@entry=0x147070000d90, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1470c4109540, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/builds/10.3_dbg/sql/sql_parse.cc:7840
      #26 0x000055d1f2b23ba6 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x147070000d90, packet=packet@entry=0x147070019991 "", packet_length=packet_length@entry=42, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/builds/10.3_dbg/sql/sql_class.h:1139
      #27 0x000055d1f2b26d32 in do_command (thd=0x147070000d90) at /data/builds/10.3_dbg/sql/sql_parse.cc:1398
      #28 0x000055d1f2c4d187 in do_handle_one_connection (connect=connect@entry=0x55d1f6783260) at /data/builds/10.3_dbg/sql/sql_connect.cc:1403
      #29 0x000055d1f2c4d3be in handle_one_connection (arg=0x55d1f6783260) at /data/builds/10.3_dbg/sql/sql_connect.cc:1308
      #30 0x00001470da690609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #31 0x00001470da287293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.3.28 (dbg), 10.4.18 (dbg), 10.5.9 (dbg), 10.6.0 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.2.37 (dbg), 10.2.37 (opt), 10.3.28 (opt), 10.4.18 (opt), 10.5.9 (opt), 10.6.0 (opt)
      MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.33 (dbg), 5.7.33 (opt), 8.0.23 (dbg), 8.0.23 (opt)

      Attachments

        Issue Links

          Activity

            Interesting, an earlier build (on 1/1/21) of 10.6 shows a different assert because the assert message has changed since.

            10.6.0 9118fd360a3da0bba521caf2a35c424968235ac4 (Debug)

            mysqld: /test/10.6_dbg/storage/innobase/btr/btr0pcur.cc:175: void btr_pcur_store_position(btr_pcur_t*, mtr_t*): Assertion `page_has_next(block->frame) || rec_is_alter_metadata(p, *index)' failed.
            

            10.6.0 9118fd360a3da0bba521caf2a35c424968235ac4 (Debug)

            Core was generated by `/test/MD010121-mariadb-10.6.0-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:56
            [Current thread is 1 (Thread 0x151f5c5fa700 (LWP 546825))]
            (gdb) bt
            #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
            #1  0x0000563ff47d10d7 in my_write_core (sig=sig@entry=6) at /test/10.6_dbg/mysys/stacktrace.c:424
            #2  0x0000563ff3f65ab1 in handle_fatal_signal (sig=6) at /test/10.6_dbg/sql/signal_handler.cc:330
            #3  <signal handler called>
            #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
            #5  0x0000151f71467859 in __GI_abort () at abort.c:79
            #6  0x0000151f71467729 in __assert_fail_base (fmt=0x151f715fd588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x563ff4bea740 "page_has_next(block->frame) || rec_is_alter_metadata(p, *index)", file=0x563ff4bea438 "/test/10.6_dbg/storage/innobase/btr/btr0pcur.cc", line=175, function=<optimized out>) at assert.c:92
            #7  0x0000151f71478f36 in __GI___assert_fail (assertion=assertion@entry=0x563ff4bea740 "page_has_next(block->frame) || rec_is_alter_metadata(p, *index)", file=file@entry=0x563ff4bea438 "/test/10.6_dbg/storage/innobase/btr/btr0pcur.cc", line=line@entry=175, function=function@entry=0x563ff4bea5e8 "void btr_pcur_store_position(btr_pcur_t*, mtr_t*)") at assert.c:101
            #8  0x0000563ff460a581 in btr_pcur_store_position (cursor=cursor@entry=0x151f2006d110, mtr=mtr@entry=0x151f5c5f7f70) at /test/10.6_dbg/storage/innobase/include/page0page.h:712
            #9  0x0000563ff453479b in row_search_mvcc (buf=buf@entry=0x151f2007a488 "\377", mode=<optimized out>, prebuilt=0x151f2006cf48, match_mode=<optimized out>, direction=direction@entry=0) at /test/10.6_dbg/storage/innobase/row/row0sel.cc:5634
            #10 0x0000563ff4374ecc in ha_innobase::index_read (this=this@entry=0x151f2007db30, buf=buf@entry=0x151f2007a488 "\377", key_ptr=key_ptr@entry=0x0, key_len=key_len@entry=0, find_flag=find_flag@entry=HA_READ_BEFORE_KEY) at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:8561
            #11 0x0000563ff437528a in ha_innobase::index_last (this=0x151f2007db30, buf=0x151f2007a488 "\377") at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:8946
            #12 0x0000563ff3f70745 in handler::ha_index_last (this=0x151f2007db30, buf=0x151f2007a488 "\377") at /test/10.6_dbg/sql/handler.cc:3237
            #13 0x0000563ff413688a in QUICK_SELECT_DESC::get_next (this=0x151f20081310) at /test/10.6_dbg/sql/opt_range.cc:12538
            #14 0x0000563ff414235d in rr_quick (info=0x151f20016360) at /test/10.6_dbg/sql/records.cc:403
            #15 0x0000563ff3d03a02 in READ_RECORD::read_record (this=0x151f20016360) at /test/10.6_dbg/sql/records.h:81
            #16 join_init_read_record (tab=0x151f20016298) at /test/10.6_dbg/sql/sql_select.cc:21573
            #17 0x0000563ff3cea3a5 in sub_select (join=0x151f20014378, join_tab=0x151f20016298, end_of_records=<optimized out>) at /test/10.6_dbg/sql/sql_select.cc:20595
            #18 0x0000563ff3d2333b in do_select (procedure=0x0, join=0x151f20014378) at /test/10.6_dbg/sql/sql_select.cc:20145
            #19 JOIN::exec_inner (this=this@entry=0x151f20014378) at /test/10.6_dbg/sql/sql_select.cc:4472
            #20 0x0000563ff3d237ad in JOIN::exec (this=this@entry=0x151f20014378) at /test/10.6_dbg/sql/sql_select.cc:4252
            #21 0x0000563ff3d21a09 in mysql_select (thd=thd@entry=0x151f20000db8, tables=0x151f20012d70, fields=@0x151f200128d0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x151f20012d28, last = 0x151f20014bb0, elements = 2}, <No data fields>}, conds=0x151f20013640, og_num=1, order=0x151f200141f0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x151f20014350, unit=0x151f20004f80, select_lex=0x151f20012780) at /test/10.6_dbg/sql/sql_select.cc:4668
            #22 0x0000563ff3d21cd0 in handle_select (thd=thd@entry=0x151f20000db8, lex=lex@entry=0x151f20004eb8, result=result@entry=0x151f20014350, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.6_dbg/sql/sql_select.cc:417
            #23 0x0000563ff3c9419d in execute_sqlcom_select (thd=thd@entry=0x151f20000db8, all_tables=0x151f20012d70) at /test/10.6_dbg/sql/sql_parse.cc:6116
            #24 0x0000563ff3ca0c7c in mysql_execute_command (thd=thd@entry=0x151f20000db8) at /test/10.6_dbg/sql/sql_parse.cc:3820
            #25 0x0000563ff3c8d072 in mysql_parse (thd=thd@entry=0x151f20000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x151f5c5f93d0) at /test/10.6_dbg/sql/sql_parse.cc:7881
            #26 0x0000563ff3c9b1ec in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x151f20000db8, packet=packet@entry=0x151f20008d39 "", packet_length=packet_length@entry=42) at /test/10.6_dbg/sql/sql_class.h:1293
            #27 0x0000563ff3c9e52d in do_command (thd=0x151f20000db8) at /test/10.6_dbg/sql/sql_parse.cc:1348
            #28 0x0000563ff3dfa7fc in do_handle_one_connection (connect=<optimized out>, connect@entry=0x563ff777dfe8, put_in_cache=put_in_cache@entry=true) at /test/10.6_dbg/sql/sql_connect.cc:1410
            #29 0x0000563ff3dfaf03 in handle_one_connection (arg=arg@entry=0x563ff777dfe8) at /test/10.6_dbg/sql/sql_connect.cc:1312
            #30 0x0000563ff42b088f in pfs_spawn_thread (arg=0x563ff76b89e8) at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
            #31 0x0000151f71975609 in start_thread (arg=<optimized out>) at pthread_create.c:477
            #32 0x0000151f71564293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            

            Roel Roel Van de Paar added a comment - Interesting, an earlier build (on 1/1/21) of 10.6 shows a different assert because the assert message has changed since. 10.6.0 9118fd360a3da0bba521caf2a35c424968235ac4 (Debug) mysqld: /test/10.6_dbg/storage/innobase/btr/btr0pcur.cc:175: void btr_pcur_store_position(btr_pcur_t*, mtr_t*): Assertion `page_has_next(block->frame) || rec_is_alter_metadata(p, *index)' failed. 10.6.0 9118fd360a3da0bba521caf2a35c424968235ac4 (Debug) Core was generated by `/test/MD010121-mariadb-10.6.0-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:56 [Current thread is 1 (Thread 0x151f5c5fa700 (LWP 546825))] (gdb) bt #0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56 #1 0x0000563ff47d10d7 in my_write_core (sig=sig@entry=6) at /test/10.6_dbg/mysys/stacktrace.c:424 #2 0x0000563ff3f65ab1 in handle_fatal_signal (sig=6) at /test/10.6_dbg/sql/signal_handler.cc:330 #3 <signal handler called> #4 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 #5 0x0000151f71467859 in __GI_abort () at abort.c:79 #6 0x0000151f71467729 in __assert_fail_base (fmt=0x151f715fd588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x563ff4bea740 "page_has_next(block->frame) || rec_is_alter_metadata(p, *index)", file=0x563ff4bea438 "/test/10.6_dbg/storage/innobase/btr/btr0pcur.cc", line=175, function=<optimized out>) at assert.c:92 #7 0x0000151f71478f36 in __GI___assert_fail (assertion=assertion@entry=0x563ff4bea740 "page_has_next(block->frame) || rec_is_alter_metadata(p, *index)", file=file@entry=0x563ff4bea438 "/test/10.6_dbg/storage/innobase/btr/btr0pcur.cc", line=line@entry=175, function=function@entry=0x563ff4bea5e8 "void btr_pcur_store_position(btr_pcur_t*, mtr_t*)") at assert.c:101 #8 0x0000563ff460a581 in btr_pcur_store_position (cursor=cursor@entry=0x151f2006d110, mtr=mtr@entry=0x151f5c5f7f70) at /test/10.6_dbg/storage/innobase/include/page0page.h:712 #9 0x0000563ff453479b in row_search_mvcc (buf=buf@entry=0x151f2007a488 "\377", mode=<optimized out>, prebuilt=0x151f2006cf48, match_mode=<optimized out>, direction=direction@entry=0) at /test/10.6_dbg/storage/innobase/row/row0sel.cc:5634 #10 0x0000563ff4374ecc in ha_innobase::index_read (this=this@entry=0x151f2007db30, buf=buf@entry=0x151f2007a488 "\377", key_ptr=key_ptr@entry=0x0, key_len=key_len@entry=0, find_flag=find_flag@entry=HA_READ_BEFORE_KEY) at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:8561 #11 0x0000563ff437528a in ha_innobase::index_last (this=0x151f2007db30, buf=0x151f2007a488 "\377") at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:8946 #12 0x0000563ff3f70745 in handler::ha_index_last (this=0x151f2007db30, buf=0x151f2007a488 "\377") at /test/10.6_dbg/sql/handler.cc:3237 #13 0x0000563ff413688a in QUICK_SELECT_DESC::get_next (this=0x151f20081310) at /test/10.6_dbg/sql/opt_range.cc:12538 #14 0x0000563ff414235d in rr_quick (info=0x151f20016360) at /test/10.6_dbg/sql/records.cc:403 #15 0x0000563ff3d03a02 in READ_RECORD::read_record (this=0x151f20016360) at /test/10.6_dbg/sql/records.h:81 #16 join_init_read_record (tab=0x151f20016298) at /test/10.6_dbg/sql/sql_select.cc:21573 #17 0x0000563ff3cea3a5 in sub_select (join=0x151f20014378, join_tab=0x151f20016298, end_of_records=<optimized out>) at /test/10.6_dbg/sql/sql_select.cc:20595 #18 0x0000563ff3d2333b in do_select (procedure=0x0, join=0x151f20014378) at /test/10.6_dbg/sql/sql_select.cc:20145 #19 JOIN::exec_inner (this=this@entry=0x151f20014378) at /test/10.6_dbg/sql/sql_select.cc:4472 #20 0x0000563ff3d237ad in JOIN::exec (this=this@entry=0x151f20014378) at /test/10.6_dbg/sql/sql_select.cc:4252 #21 0x0000563ff3d21a09 in mysql_select (thd=thd@entry=0x151f20000db8, tables=0x151f20012d70, fields=@0x151f200128d0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x151f20012d28, last = 0x151f20014bb0, elements = 2}, <No data fields>}, conds=0x151f20013640, og_num=1, order=0x151f200141f0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x151f20014350, unit=0x151f20004f80, select_lex=0x151f20012780) at /test/10.6_dbg/sql/sql_select.cc:4668 #22 0x0000563ff3d21cd0 in handle_select (thd=thd@entry=0x151f20000db8, lex=lex@entry=0x151f20004eb8, result=result@entry=0x151f20014350, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.6_dbg/sql/sql_select.cc:417 #23 0x0000563ff3c9419d in execute_sqlcom_select (thd=thd@entry=0x151f20000db8, all_tables=0x151f20012d70) at /test/10.6_dbg/sql/sql_parse.cc:6116 #24 0x0000563ff3ca0c7c in mysql_execute_command (thd=thd@entry=0x151f20000db8) at /test/10.6_dbg/sql/sql_parse.cc:3820 #25 0x0000563ff3c8d072 in mysql_parse (thd=thd@entry=0x151f20000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x151f5c5f93d0) at /test/10.6_dbg/sql/sql_parse.cc:7881 #26 0x0000563ff3c9b1ec in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x151f20000db8, packet=packet@entry=0x151f20008d39 "", packet_length=packet_length@entry=42) at /test/10.6_dbg/sql/sql_class.h:1293 #27 0x0000563ff3c9e52d in do_command (thd=0x151f20000db8) at /test/10.6_dbg/sql/sql_parse.cc:1348 #28 0x0000563ff3dfa7fc in do_handle_one_connection (connect=<optimized out>, connect@entry=0x563ff777dfe8, put_in_cache=put_in_cache@entry=true) at /test/10.6_dbg/sql/sql_connect.cc:1410 #29 0x0000563ff3dfaf03 in handle_one_connection (arg=arg@entry=0x563ff777dfe8) at /test/10.6_dbg/sql/sql_connect.cc:1312 #30 0x0000563ff42b088f in pfs_spawn_thread (arg=0x563ff76b89e8) at /test/10.6_dbg/storage/perfschema/pfs.cc:2201 #31 0x0000151f71975609 in start_thread (arg=<optimized out>) at pthread_create.c:477 #32 0x0000151f71564293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            Roel Roel Van de Paar added a comment - - edited

            UniqueID's seen thus far

            page_has_next(block->frame) || rec_is_alter_metadata(p, *index)|SIGABRT|btr_pcur_store_position|row_search_mvcc|ha_innobase::index_read|ha_innobase::index_last
            page_has_next(block->frame) || block->page.id.page_no() != index->page|SIGABRT|btr_pcur_store_position|row_search_mvcc|ha_innobase::index_read|ha_innobase::index_last
            page_has_next(block->frame) || rec_is_alter_metadata(p, *index) || block->page.id().page_no() != index->page|SIGABRT|btr_pcur_store_position|row_search_mvcc|ha_innobase::index_read|ha_innobase::index_last
            page_has_next(block->frame) || rec_is_alter_metadata(p, *index) || block->page.id.page_no() != index->page|SIGABRT|btr_pcur_store_position|row_search_mvcc|ha_innobase::index_read|ha_innobase::index_last
            page_has_next(block->frame) || block->page.id.page_no() != index->page|SIGABRT|btr_pcur_store_position|row_search_mvcc|ha_innobase::index_read|handler::index_read_map
            page_has_next(block->frame) || rec_is_alter_metadata(p, *index) || block->page.id.page_no() != index->page|SIGABRT|btr_pcur_store_position|row_search_mvcc|ha_innobase::index_read|handler::index_read_map
            page_has_next(block->frame) || rec_is_alter_metadata(p, *index) || block->page.id().page_no() != index->page|SIGABRT|btr_pcur_store_position|row_search_mvcc|ha_innobase::index_read|handler::index_read_map
            page_has_next(block->frame) || rec_is_alter_metadata(p, *index)|SIGABRT|btr_pcur_store_position|row_search_mvcc|ha_innobase::index_read|handler::index_read_map
            

            Roel Roel Van de Paar added a comment - - edited UniqueID's seen thus far page_has_next(block->frame) || rec_is_alter_metadata(p, *index)|SIGABRT|btr_pcur_store_position|row_search_mvcc|ha_innobase::index_read|ha_innobase::index_last page_has_next(block->frame) || block->page.id.page_no() != index->page|SIGABRT|btr_pcur_store_position|row_search_mvcc|ha_innobase::index_read|ha_innobase::index_last page_has_next(block->frame) || rec_is_alter_metadata(p, *index) || block->page.id().page_no() != index->page|SIGABRT|btr_pcur_store_position|row_search_mvcc|ha_innobase::index_read|ha_innobase::index_last page_has_next(block->frame) || rec_is_alter_metadata(p, *index) || block->page.id.page_no() != index->page|SIGABRT|btr_pcur_store_position|row_search_mvcc|ha_innobase::index_read|ha_innobase::index_last page_has_next(block->frame) || block->page.id.page_no() != index->page|SIGABRT|btr_pcur_store_position|row_search_mvcc|ha_innobase::index_read|handler::index_read_map page_has_next(block->frame) || rec_is_alter_metadata(p, *index) || block->page.id.page_no() != index->page|SIGABRT|btr_pcur_store_position|row_search_mvcc|ha_innobase::index_read|handler::index_read_map page_has_next(block->frame) || rec_is_alter_metadata(p, *index) || block->page.id().page_no() != index->page|SIGABRT|btr_pcur_store_position|row_search_mvcc|ha_innobase::index_read|handler::index_read_map page_has_next(block->frame) || rec_is_alter_metadata(p, *index)|SIGABRT|btr_pcur_store_position|row_search_mvcc|ha_innobase::index_read|handler::index_read_map

            MDEV-24653 fixed this assertion in one case. There seem to be more cases where the table is empty, the only leaf page contains the metadata record, but the only leaf page is not the root page.

            marko Marko Mäkelä added a comment - MDEV-24653 fixed this assertion in one case. There seem to be more cases where the table is empty, the only leaf page contains the metadata record, but the only leaf page is not the root page.
            Roel Roel Van de Paar added a comment - - edited

            Found another testcase with a slightly different stack

            SET sql_mode='';
            SET GLOBAL innodb_limit_optimistic_insert_debug=4;
            CREATE TABLE t (c INT NOT NULL UNIQUE KEY);
            INSERT INTO t VALUES(1),(2);
            ALTER TABLE t ADD COLUMN c2 INT;
            INSERT INTO t VALUES(3,0),(4,0);
            DELETE FROM t;
            SELECT * FROM t WHERE c<0 ORDER BY c DESC;
            

            Leads to:

            10.6.0 bfb4761ca04704d68dba51f76d7c9967f880a6ee (Debug)

            mysqld: /test/10.6_dbg/storage/innobase/btr/btr0pcur.cc:177: void btr_pcur_store_position(btr_pcur_t*, mtr_t*): Assertion `page_has_next(block->frame) || rec_is_alter_metadata(p, *index) || block->page.id().page_no() != index->page' failed.
            

            10.6.0 bfb4761ca04704d68dba51f76d7c9967f880a6ee (Debug)

            Core was generated by `/test/MD110221-mariadb-10.6.0-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:56
            [Current thread is 1 (Thread 0x14ab2054d700 (LWP 3118353))]
            (gdb) bt
            #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
            #1  0x000055907b39d55c in my_write_core (sig=sig@entry=6) at /test/10.6_dbg/mysys/stacktrace.c:424
            #2  0x000055907ab354de in handle_fatal_signal (sig=6) at /test/10.6_dbg/sql/signal_handler.cc:330
            #3  <signal handler called>
            #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
            #5  0x000014ab2410b859 in __GI_abort () at abort.c:79
            #6  0x000014ab2410b729 in __assert_fail_base (fmt=0x14ab242a1588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55907b7bcad8 "page_has_next(block->frame) || rec_is_alter_metadata(p, *index) || block->page.id().page_no() != index->page", file=0x55907b7bc788 "/test/10.6_dbg/storage/innobase/btr/btr0pcur.cc", line=177, function=<optimized out>) at assert.c:92
            #7  0x000014ab2411cf36 in __GI___assert_fail (assertion=assertion@entry=0x55907b7bcad8 "page_has_next(block->frame) || rec_is_alter_metadata(p, *index) || block->page.id().page_no() != index->page", file=file@entry=0x55907b7bc788 "/test/10.6_dbg/storage/innobase/btr/btr0pcur.cc", line=line@entry=177, function=function@entry=0x55907b7bc938 "void btr_pcur_store_position(btr_pcur_t*, mtr_t*)") at assert.c:101
            #8  0x000055907b1d8ed4 in btr_pcur_store_position (cursor=cursor@entry=0x14aadc027620, mtr=mtr@entry=0x14ab2054af60) at /test/10.6_dbg/storage/innobase/include/buf0types.h:159
            #9  0x000055907b103211 in row_search_mvcc (buf=buf@entry=0x14aadc06c878 "\377", mode=<optimized out>, prebuilt=0x14aadc027458, match_mode=<optimized out>, direction=direction@entry=0) at /test/10.6_dbg/storage/innobase/row/row0sel.cc:5711
            #10 0x000055907af418b9 in ha_innobase::index_read (this=0x14aadc028ff0, buf=0x14aadc06c878 "\377", key_ptr=0x14aadc086d28 "", key_len=4, find_flag=HA_READ_BEFORE_KEY) at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:8568
            #11 0x000055907ab50a7b in handler::index_read_map (this=0x14aadc028ff0, buf=0x14aadc06c878 "\377", key=0x14aadc086d28 "", keypart_map=<optimized out>, find_flag=HA_READ_BEFORE_KEY) at /test/10.6_dbg/sql/handler.h:3798
            #12 0x000055907ab3e441 in handler::ha_index_read_map (this=0x14aadc028ff0, buf=0x14aadc06c878 "\377", key=0x14aadc086d28 "", keypart_map=1, find_flag=HA_READ_BEFORE_KEY) at /test/10.6_dbg/sql/handler.cc:3123
            #13 0x000055907ad05bb2 in QUICK_SELECT_DESC::get_next (this=0x14aadc083a10) at /test/10.6_dbg/sql/opt_range.cc:12903
            #14 0x000055907ad115bc in rr_quick (info=0x14aadc016350) at /test/10.6_dbg/sql/records.cc:403
            #15 0x000055907a8d3668 in READ_RECORD::read_record (this=0x14aadc016350) at /test/10.6_dbg/sql/records.h:81
            #16 join_init_read_record (tab=0x14aadc016288) at /test/10.6_dbg/sql/sql_select.cc:21634
            #17 0x000055907a8ba0a6 in sub_select (join=0x14aadc014368, join_tab=0x14aadc016288, end_of_records=<optimized out>) at /test/10.6_dbg/sql/sql_select.cc:20656
            #18 0x000055907a8f2b4c in do_select (procedure=0x0, join=0x14aadc014368) at /test/10.6_dbg/sql/sql_select.cc:20206
            #19 JOIN::exec_inner (this=this@entry=0x14aadc014368) at /test/10.6_dbg/sql/sql_select.cc:4476
            #20 0x000055907a8f2fbc in JOIN::exec (this=this@entry=0x14aadc014368) at /test/10.6_dbg/sql/sql_select.cc:4256
            #21 0x000055907a8f121c in mysql_select (thd=thd@entry=0x14aadc000db8, tables=0x14aadc012d60, fields=@0x14aadc0128c0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14aadc012d18, last = 0x14aadc014ba0, elements = 2}, <No data fields>}, conds=0x14aadc013630, og_num=1, order=0x14aadc0141e0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x14aadc014340, unit=0x14aadc004f88, select_lex=0x14aadc012770) at /test/10.6_dbg/sql/sql_select.cc:4729
            #22 0x000055907a8f14e2 in handle_select (thd=thd@entry=0x14aadc000db8, lex=lex@entry=0x14aadc004ec0, result=result@entry=0x14aadc014340, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.6_dbg/sql/sql_select.cc:417
            #23 0x000055907a8642b0 in execute_sqlcom_select (thd=thd@entry=0x14aadc000db8, all_tables=0x14aadc012d60) at /test/10.6_dbg/sql/sql_parse.cc:6138
            #24 0x000055907a870de6 in mysql_execute_command (thd=thd@entry=0x14aadc000db8) at /test/10.6_dbg/sql/sql_parse.cc:3834
            #25 0x000055907a85d21a in mysql_parse (thd=thd@entry=0x14aadc000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14ab2054c3d0) at /test/10.6_dbg/sql/sql_parse.cc:7906
            #26 0x000055907a86b30b in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14aadc000db8, packet=packet@entry=0x14aadc01aac9 "", packet_length=packet_length@entry=41) at /test/10.6_dbg/sql/sql_class.h:1295
            #27 0x000055907a86e63d in do_command (thd=0x14aadc000db8) at /test/10.6_dbg/sql/sql_parse.cc:1365
            #28 0x000055907a9ca1ab in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55907d7a2de8, put_in_cache=put_in_cache@entry=true) at /test/10.6_dbg/sql/sql_connect.cc:1410
            #29 0x000055907a9ca8af in handle_one_connection (arg=arg@entry=0x55907d7a2de8) at /test/10.6_dbg/sql/sql_connect.cc:1312
            #30 0x000055907ae7e27d in pfs_spawn_thread (arg=0x55907d6d71f8) at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
            #31 0x000014ab24619609 in start_thread (arg=<optimized out>) at pthread_create.c:477
            #32 0x000014ab24208293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            

            10.3.28 75538f94ca06915ddc22458b82b8e148e51dd0db (Debug)

            mysqld: /data/builds/10.3_dbg/storage/innobase/btr/btr0pcur.cc:172: void btr_pcur_store_position(btr_pcur_t*, mtr_t*): Assertion `page_has_next(block->frame) || block->page.id.page_no() != index->page' failed.
            

            10.3.28 75538f94ca06915ddc22458b82b8e148e51dd0db (Debug)

            Core was generated by `/test/MD260121-mariadb-10.3.28-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:56
            [Current thread is 1 (Thread 0x14ae0bbb2700 (LWP 3139731))]
            (gdb) bt
            #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
            #1  0x0000555acca28bf5 in my_write_core (sig=sig@entry=6) at /data/builds/10.3_dbg/mysys/stacktrace.c:386
            #2  0x0000555acc1e533a in handle_fatal_signal (sig=6) at /data/builds/10.3_dbg/sql/signal_handler.cc:343
            #3  <signal handler called>
            #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
            #5  0x000014ae56443859 in __GI_abort () at abort.c:79
            #6  0x000014ae56443729 in __assert_fail_base (fmt=0x14ae565d9588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x555accce36d8 "page_has_next(block->frame) || block->page.id.page_no() != index->page", file=0x555accce3548 "/data/builds/10.3_dbg/storage/innobase/btr/btr0pcur.cc", line=172, function=<optimized out>) at assert.c:92
            #7  0x000014ae56454f36 in __GI___assert_fail (assertion=assertion@entry=0x555accce36d8 "page_has_next(block->frame) || block->page.id.page_no() != index->page", file=file@entry=0x555accce3548 "/data/builds/10.3_dbg/storage/innobase/btr/btr0pcur.cc", line=line@entry=172, function=function@entry=0x555accce3580 "void btr_pcur_store_position(btr_pcur_t*, mtr_t*)") at assert.c:101
            #8  0x0000555acc6e7cd7 in btr_pcur_store_position (cursor=cursor@entry=0x14adec027138, mtr=mtr@entry=0x14ae0bbaeeb0) at /data/builds/10.3_dbg/storage/innobase/include/buf0types.h:163
            #9  0x0000555acc5ec018 in row_search_mvcc (buf=buf@entry=0x14adec02c740 "\377", mode=<optimized out>, mode@entry=PAGE_CUR_L, prebuilt=0x14adec026f70, match_mode=match_mode@entry=0, direction=direction@entry=0) at /data/builds/10.3_dbg/storage/innobase/row/row0sel.cc:5677
            #10 0x0000555acc41ccb0 in ha_innobase::index_read (this=0x14adec0267c8, buf=0x14adec02c740 "\377", key_ptr=<optimized out>, key_len=<optimized out>, find_flag=<optimized out>) at /data/builds/10.3_dbg/storage/innobase/handler/ha_innodb.cc:9268
            #11 0x0000555acc1fa511 in handler::index_read_map (this=0x14adec0267c8, buf=0x14adec02c740 "\377", key=0x14adec038050 "", keypart_map=<optimized out>, find_flag=HA_READ_BEFORE_KEY) at /data/builds/10.3_dbg/sql/handler.h:3475
            #12 0x0000555acc1ed742 in handler::ha_index_read_map (this=0x14adec0267c8, buf=0x14adec02c740 "\377", key=0x14adec038050 "", keypart_map=1, find_flag=HA_READ_BEFORE_KEY) at /data/builds/10.3_dbg/sql/handler.cc:2904
            #13 0x0000555acc378498 in QUICK_SELECT_DESC::get_next (this=0x14adec011150) at /data/builds/10.3_dbg/sql/opt_range.cc:11864
            #14 0x0000555acc38311f in rr_quick (info=0x14adec014208) at /data/builds/10.3_dbg/sql/records.cc:369
            #15 0x0000555acbfba961 in READ_RECORD::read_record (this=0x14adec014208) at /data/builds/10.3_dbg/sql/records.h:70
            #16 join_init_read_record (tab=0x14adec014140) at /data/builds/10.3_dbg/sql/sql_select.cc:20647
            #17 0x0000555acbfa2193 in sub_select (join=0x14adec012348, join_tab=0x14adec014140, end_of_records=<optimized out>) at /data/builds/10.3_dbg/sql/sql_select.cc:19708
            #18 0x0000555acbfd3327 in do_select (procedure=<optimized out>, join=0x14adec012348) at /data/builds/10.3_dbg/sql/sql_select.cc:19251
            #19 JOIN::exec_inner (this=this@entry=0x14adec012348) at /data/builds/10.3_dbg/sql/sql_select.cc:4124
            #20 0x0000555acbfd3716 in JOIN::exec (this=this@entry=0x14adec012348) at /data/builds/10.3_dbg/sql/sql_select.cc:3918
            #21 0x0000555acbfd413d in mysql_select (thd=thd@entry=0x14adec000d90, tables=0x14adec011770, wild_num=1, fields=@0x14adec005508: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14adec011728, last = 0x14adec012b10, elements = 2}, <No data fields>}, conds=0x14adec011f90, og_num=1, order=0x14adec012208, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x14adec012320, unit=0x14adec004c58, select_lex=0x14adec0053e0) at /data/builds/10.3_dbg/sql/sql_select.cc:4323
            #22 0x0000555acbfd43ec in handle_select (thd=thd@entry=0x14adec000d90, lex=lex@entry=0x14adec004b98, result=result@entry=0x14adec012320, setup_tables_done_option=setup_tables_done_option@entry=0) at /data/builds/10.3_dbg/sql/sql_select.cc:370
            #23 0x0000555acbf4c575 in execute_sqlcom_select (thd=thd@entry=0x14adec000d90, all_tables=0x14adec011770) at /data/builds/10.3_dbg/sql/sql_parse.cc:6316
            #24 0x0000555acbf57238 in mysql_execute_command (thd=thd@entry=0x14adec000d90) at /data/builds/10.3_dbg/sql/sql_parse.cc:3847
            #25 0x0000555acbf61435 in mysql_parse (thd=thd@entry=0x14adec000d90, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14ae0bbb1540, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/builds/10.3_dbg/sql/sql_parse.cc:7840
            #26 0x0000555acbf63ba6 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14adec000d90, packet=packet@entry=0x14adec019991 "", packet_length=packet_length@entry=41, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/builds/10.3_dbg/sql/sql_class.h:1139
            #27 0x0000555acbf66d32 in do_command (thd=0x14adec000d90) at /data/builds/10.3_dbg/sql/sql_parse.cc:1398
            #28 0x0000555acc08d187 in do_handle_one_connection (connect=connect@entry=0x555acf7f4200) at /data/builds/10.3_dbg/sql/sql_connect.cc:1403
            #29 0x0000555acc08d3be in handle_one_connection (arg=0x555acf7f4200) at /data/builds/10.3_dbg/sql/sql_connect.cc:1308
            #30 0x000014ae56949609 in start_thread (arg=<optimized out>) at pthread_create.c:477
            #31 0x000014ae56540293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            

            10.4.18 e626f511f9dc4faee9ae98fb5a8c8c6ddd06679b (Debug)

            mysqld: /data/builds/10.4_dbg/storage/innobase/btr/btr0pcur.cc:172: void btr_pcur_store_position(btr_pcur_t*, mtr_t*): Assertion `page_has_next(block->frame) || rec_is_alter_metadata(p, *index) || block->page.id.page_no() != index->page' failed.
            

            10.4.18 e626f511f9dc4faee9ae98fb5a8c8c6ddd06679b (Debug)

            Core was generated by `/test/MD260121-mariadb-10.4.18-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:56
            [Current thread is 1 (Thread 0x146f0808c700 (LWP 3245988))]
            (gdb) bt
            #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
            #1  0x000055d281544077 in my_write_core (sig=sig@entry=6) at /data/builds/10.4_dbg/mysys/stacktrace.c:386
            #2  0x000055d280c58437 in handle_fatal_signal (sig=6) at /data/builds/10.4_dbg/sql/signal_handler.cc:343
            #3  <signal handler called>
            #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
            #5  0x0000146f1f545859 in __GI_abort () at abort.c:79
            #6  0x0000146f1f545729 in __assert_fail_base (fmt=0x146f1f6db588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55d28184e450 "page_has_next(block->frame) || rec_is_alter_metadata(p, *index) || block->page.id.page_no() != index->page", file=0x55d28184e258 "/data/builds/10.4_dbg/storage/innobase/btr/btr0pcur.cc", line=172, function=<optimized out>) at assert.c:92
            #7  0x0000146f1f556f36 in __GI___assert_fail (assertion=assertion@entry=0x55d28184e450 "page_has_next(block->frame) || rec_is_alter_metadata(p, *index) || block->page.id.page_no() != index->page", file=file@entry=0x55d28184e258 "/data/builds/10.4_dbg/storage/innobase/btr/btr0pcur.cc", line=line@entry=172, function=function@entry=0x55d28184e290 "void btr_pcur_store_position(btr_pcur_t*, mtr_t*)") at assert.c:101
            #8  0x000055d28119a226 in btr_pcur_store_position (cursor=cursor@entry=0x146ec007a220, mtr=mtr@entry=0x146f08088cd0) at /data/builds/10.4_dbg/storage/innobase/include/buf0types.h:172
            #9  0x000055d2810ab329 in row_search_mvcc (buf=buf@entry=0x146ec0023a10 "\377", mode=<optimized out>, mode@entry=PAGE_CUR_L, prebuilt=0x146ec007a050, match_mode=match_mode@entry=0, direction=direction@entry=0) at /data/builds/10.4_dbg/storage/innobase/row/row0sel.cc:5682
            #10 0x000055d280ec8586 in ha_innobase::index_read (this=0x146ec0027448, buf=0x146ec0023a10 "\377", key_ptr=<optimized out>, key_len=<optimized out>, find_flag=<optimized out>) at /data/builds/10.4_dbg/storage/innobase/handler/ha_innodb.cc:9245
            #11 0x000055d280c71bf1 in handler::index_read_map (this=0x146ec0027448, buf=0x146ec0023a10 "\377", key=0x146ec007b890 "", keypart_map=<optimized out>, find_flag=HA_READ_BEFORE_KEY) at /data/builds/10.4_dbg/sql/handler.h:3628
            #12 0x000055d280c60c12 in handler::ha_index_read_map (this=0x146ec0027448, buf=0x146ec0023a10 "\377", key=0x146ec007b890 "", keypart_map=1, find_flag=HA_READ_BEFORE_KEY) at /data/builds/10.4_dbg/sql/handler.cc:2922
            #13 0x000055d280e17dac in QUICK_SELECT_DESC::get_next (this=0x146ec0021e00) at /data/builds/10.4_dbg/sql/opt_range.cc:12563
            #14 0x000055d280e2348f in rr_quick (info=0x146ec0015a48) at /data/builds/10.4_dbg/sql/records.cc:369
            #15 0x000055d2809ed4cd in READ_RECORD::read_record (this=0x146ec0015a48) at /data/builds/10.4_dbg/sql/records.h:70
            #16 join_init_read_record (tab=0x146ec0015980) at /data/builds/10.4_dbg/sql/sql_select.cc:21347
            #17 0x000055d2809d4647 in sub_select (join=0x146ec0013ae0, join_tab=0x146ec0015980, end_of_records=<optimized out>) at /data/builds/10.4_dbg/sql/sql_select.cc:20402
            #18 0x000055d280a09120 in do_select (procedure=0x0, join=0x146ec0013ae0) at /data/builds/10.4_dbg/sql/sql_select.cc:19943
            #19 JOIN::exec_inner (this=this@entry=0x146ec0013ae0) at /data/builds/10.4_dbg/sql/sql_select.cc:4486
            #20 0x000055d280a0958a in JOIN::exec (this=this@entry=0x146ec0013ae0) at /data/builds/10.4_dbg/sql/sql_select.cc:4268
            #21 0x000055d280a0783c in mysql_select (thd=thd@entry=0x146ec0000d90, tables=0x146ec0012568, wild_num=1, fields=@0x146ec00120f0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x146ec0012520, last = 0x146ec00142b0, elements = 2}, <No data fields>}, conds=0x146ec0012df0, og_num=1, order=0x146ec0013960, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x146ec0013ab8, unit=0x146ec0004cc0, select_lex=0x146ec0011fa8) at /data/builds/10.4_dbg/sql/sql_select.cc:4703
            #22 0x000055d280a07b65 in handle_select (thd=thd@entry=0x146ec0000d90, lex=lex@entry=0x146ec0004c00, result=result@entry=0x146ec0013ab8, setup_tables_done_option=setup_tables_done_option@entry=0) at /data/builds/10.4_dbg/sql/sql_select.cc:410
            #23 0x000055d2809791a4 in execute_sqlcom_select (thd=thd@entry=0x146ec0000d90, all_tables=0x146ec0012568) at /data/builds/10.4_dbg/sql/sql_parse.cc:6417
            #24 0x000055d28098469e in mysql_execute_command (thd=thd@entry=0x146ec0000d90) at /data/builds/10.4_dbg/sql/sql_parse.cc:3936
            #25 0x000055d28098f024 in mysql_parse (thd=thd@entry=0x146ec0000d90, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x146f0808b490, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/builds/10.4_dbg/sql/sql_parse.cc:7958
            #26 0x000055d28099187a in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x146ec0000d90, packet=packet@entry=0x146ec001a331 "", packet_length=packet_length@entry=41, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/builds/10.4_dbg/sql/sql_class.h:1170
            #27 0x000055d2809950d0 in do_command (thd=0x146ec0000d90) at /data/builds/10.4_dbg/sql/sql_parse.cc:1373
            #28 0x000055d280acde04 in do_handle_one_connection (connect=connect@entry=0x55d284ccfc30) at /data/builds/10.4_dbg/sql/sql_connect.cc:1412
            #29 0x000055d280acdf23 in handle_one_connection (arg=0x55d284ccfc30) at /data/builds/10.4_dbg/sql/sql_connect.cc:1316
            #30 0x0000146f1fb02609 in start_thread (arg=<optimized out>) at pthread_create.c:477
            #31 0x0000146f1f642293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            

            Bug confirmed present in:
            MariaDB: 10.3.28 (dbg), 10.4.18 (dbg), 10.5.9 (dbg), 10.6.0 (dbg)

            Bug (or feature/syntax) confirmed not present in:
            MariaDB: 10.2.37 (dbg), 10.2.37 (opt), 10.3.28 (opt), 10.4.18 (opt), 10.5.9 (opt), 10.6.0 (opt)
            MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.33 (dbg), 5.7.33 (opt), 8.0.23 (dbg), 8.0.23 (opt)

            Roel Roel Van de Paar added a comment - - edited Found another testcase with a slightly different stack SET sql_mode=''; SET GLOBAL innodb_limit_optimistic_insert_debug=4; CREATE TABLE t (c INT NOT NULL UNIQUE KEY); INSERT INTO t VALUES(1),(2); ALTER TABLE t ADD COLUMN c2 INT; INSERT INTO t VALUES(3,0),(4,0); DELETE FROM t; SELECT * FROM t WHERE c<0 ORDER BY c DESC; Leads to: 10.6.0 bfb4761ca04704d68dba51f76d7c9967f880a6ee (Debug) mysqld: /test/10.6_dbg/storage/innobase/btr/btr0pcur.cc:177: void btr_pcur_store_position(btr_pcur_t*, mtr_t*): Assertion `page_has_next(block->frame) || rec_is_alter_metadata(p, *index) || block->page.id().page_no() != index->page' failed. 10.6.0 bfb4761ca04704d68dba51f76d7c9967f880a6ee (Debug) Core was generated by `/test/MD110221-mariadb-10.6.0-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:56 [Current thread is 1 (Thread 0x14ab2054d700 (LWP 3118353))] (gdb) bt #0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56 #1 0x000055907b39d55c in my_write_core (sig=sig@entry=6) at /test/10.6_dbg/mysys/stacktrace.c:424 #2 0x000055907ab354de in handle_fatal_signal (sig=6) at /test/10.6_dbg/sql/signal_handler.cc:330 #3 <signal handler called> #4 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 #5 0x000014ab2410b859 in __GI_abort () at abort.c:79 #6 0x000014ab2410b729 in __assert_fail_base (fmt=0x14ab242a1588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55907b7bcad8 "page_has_next(block->frame) || rec_is_alter_metadata(p, *index) || block->page.id().page_no() != index->page", file=0x55907b7bc788 "/test/10.6_dbg/storage/innobase/btr/btr0pcur.cc", line=177, function=<optimized out>) at assert.c:92 #7 0x000014ab2411cf36 in __GI___assert_fail (assertion=assertion@entry=0x55907b7bcad8 "page_has_next(block->frame) || rec_is_alter_metadata(p, *index) || block->page.id().page_no() != index->page", file=file@entry=0x55907b7bc788 "/test/10.6_dbg/storage/innobase/btr/btr0pcur.cc", line=line@entry=177, function=function@entry=0x55907b7bc938 "void btr_pcur_store_position(btr_pcur_t*, mtr_t*)") at assert.c:101 #8 0x000055907b1d8ed4 in btr_pcur_store_position (cursor=cursor@entry=0x14aadc027620, mtr=mtr@entry=0x14ab2054af60) at /test/10.6_dbg/storage/innobase/include/buf0types.h:159 #9 0x000055907b103211 in row_search_mvcc (buf=buf@entry=0x14aadc06c878 "\377", mode=<optimized out>, prebuilt=0x14aadc027458, match_mode=<optimized out>, direction=direction@entry=0) at /test/10.6_dbg/storage/innobase/row/row0sel.cc:5711 #10 0x000055907af418b9 in ha_innobase::index_read (this=0x14aadc028ff0, buf=0x14aadc06c878 "\377", key_ptr=0x14aadc086d28 "", key_len=4, find_flag=HA_READ_BEFORE_KEY) at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:8568 #11 0x000055907ab50a7b in handler::index_read_map (this=0x14aadc028ff0, buf=0x14aadc06c878 "\377", key=0x14aadc086d28 "", keypart_map=<optimized out>, find_flag=HA_READ_BEFORE_KEY) at /test/10.6_dbg/sql/handler.h:3798 #12 0x000055907ab3e441 in handler::ha_index_read_map (this=0x14aadc028ff0, buf=0x14aadc06c878 "\377", key=0x14aadc086d28 "", keypart_map=1, find_flag=HA_READ_BEFORE_KEY) at /test/10.6_dbg/sql/handler.cc:3123 #13 0x000055907ad05bb2 in QUICK_SELECT_DESC::get_next (this=0x14aadc083a10) at /test/10.6_dbg/sql/opt_range.cc:12903 #14 0x000055907ad115bc in rr_quick (info=0x14aadc016350) at /test/10.6_dbg/sql/records.cc:403 #15 0x000055907a8d3668 in READ_RECORD::read_record (this=0x14aadc016350) at /test/10.6_dbg/sql/records.h:81 #16 join_init_read_record (tab=0x14aadc016288) at /test/10.6_dbg/sql/sql_select.cc:21634 #17 0x000055907a8ba0a6 in sub_select (join=0x14aadc014368, join_tab=0x14aadc016288, end_of_records=<optimized out>) at /test/10.6_dbg/sql/sql_select.cc:20656 #18 0x000055907a8f2b4c in do_select (procedure=0x0, join=0x14aadc014368) at /test/10.6_dbg/sql/sql_select.cc:20206 #19 JOIN::exec_inner (this=this@entry=0x14aadc014368) at /test/10.6_dbg/sql/sql_select.cc:4476 #20 0x000055907a8f2fbc in JOIN::exec (this=this@entry=0x14aadc014368) at /test/10.6_dbg/sql/sql_select.cc:4256 #21 0x000055907a8f121c in mysql_select (thd=thd@entry=0x14aadc000db8, tables=0x14aadc012d60, fields=@0x14aadc0128c0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14aadc012d18, last = 0x14aadc014ba0, elements = 2}, <No data fields>}, conds=0x14aadc013630, og_num=1, order=0x14aadc0141e0, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x14aadc014340, unit=0x14aadc004f88, select_lex=0x14aadc012770) at /test/10.6_dbg/sql/sql_select.cc:4729 #22 0x000055907a8f14e2 in handle_select (thd=thd@entry=0x14aadc000db8, lex=lex@entry=0x14aadc004ec0, result=result@entry=0x14aadc014340, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.6_dbg/sql/sql_select.cc:417 #23 0x000055907a8642b0 in execute_sqlcom_select (thd=thd@entry=0x14aadc000db8, all_tables=0x14aadc012d60) at /test/10.6_dbg/sql/sql_parse.cc:6138 #24 0x000055907a870de6 in mysql_execute_command (thd=thd@entry=0x14aadc000db8) at /test/10.6_dbg/sql/sql_parse.cc:3834 #25 0x000055907a85d21a in mysql_parse (thd=thd@entry=0x14aadc000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14ab2054c3d0) at /test/10.6_dbg/sql/sql_parse.cc:7906 #26 0x000055907a86b30b in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14aadc000db8, packet=packet@entry=0x14aadc01aac9 "", packet_length=packet_length@entry=41) at /test/10.6_dbg/sql/sql_class.h:1295 #27 0x000055907a86e63d in do_command (thd=0x14aadc000db8) at /test/10.6_dbg/sql/sql_parse.cc:1365 #28 0x000055907a9ca1ab in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55907d7a2de8, put_in_cache=put_in_cache@entry=true) at /test/10.6_dbg/sql/sql_connect.cc:1410 #29 0x000055907a9ca8af in handle_one_connection (arg=arg@entry=0x55907d7a2de8) at /test/10.6_dbg/sql/sql_connect.cc:1312 #30 0x000055907ae7e27d in pfs_spawn_thread (arg=0x55907d6d71f8) at /test/10.6_dbg/storage/perfschema/pfs.cc:2201 #31 0x000014ab24619609 in start_thread (arg=<optimized out>) at pthread_create.c:477 #32 0x000014ab24208293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 10.3.28 75538f94ca06915ddc22458b82b8e148e51dd0db (Debug) mysqld: /data/builds/10.3_dbg/storage/innobase/btr/btr0pcur.cc:172: void btr_pcur_store_position(btr_pcur_t*, mtr_t*): Assertion `page_has_next(block->frame) || block->page.id.page_no() != index->page' failed. 10.3.28 75538f94ca06915ddc22458b82b8e148e51dd0db (Debug) Core was generated by `/test/MD260121-mariadb-10.3.28-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:56 [Current thread is 1 (Thread 0x14ae0bbb2700 (LWP 3139731))] (gdb) bt #0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56 #1 0x0000555acca28bf5 in my_write_core (sig=sig@entry=6) at /data/builds/10.3_dbg/mysys/stacktrace.c:386 #2 0x0000555acc1e533a in handle_fatal_signal (sig=6) at /data/builds/10.3_dbg/sql/signal_handler.cc:343 #3 <signal handler called> #4 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 #5 0x000014ae56443859 in __GI_abort () at abort.c:79 #6 0x000014ae56443729 in __assert_fail_base (fmt=0x14ae565d9588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x555accce36d8 "page_has_next(block->frame) || block->page.id.page_no() != index->page", file=0x555accce3548 "/data/builds/10.3_dbg/storage/innobase/btr/btr0pcur.cc", line=172, function=<optimized out>) at assert.c:92 #7 0x000014ae56454f36 in __GI___assert_fail (assertion=assertion@entry=0x555accce36d8 "page_has_next(block->frame) || block->page.id.page_no() != index->page", file=file@entry=0x555accce3548 "/data/builds/10.3_dbg/storage/innobase/btr/btr0pcur.cc", line=line@entry=172, function=function@entry=0x555accce3580 "void btr_pcur_store_position(btr_pcur_t*, mtr_t*)") at assert.c:101 #8 0x0000555acc6e7cd7 in btr_pcur_store_position (cursor=cursor@entry=0x14adec027138, mtr=mtr@entry=0x14ae0bbaeeb0) at /data/builds/10.3_dbg/storage/innobase/include/buf0types.h:163 #9 0x0000555acc5ec018 in row_search_mvcc (buf=buf@entry=0x14adec02c740 "\377", mode=<optimized out>, mode@entry=PAGE_CUR_L, prebuilt=0x14adec026f70, match_mode=match_mode@entry=0, direction=direction@entry=0) at /data/builds/10.3_dbg/storage/innobase/row/row0sel.cc:5677 #10 0x0000555acc41ccb0 in ha_innobase::index_read (this=0x14adec0267c8, buf=0x14adec02c740 "\377", key_ptr=<optimized out>, key_len=<optimized out>, find_flag=<optimized out>) at /data/builds/10.3_dbg/storage/innobase/handler/ha_innodb.cc:9268 #11 0x0000555acc1fa511 in handler::index_read_map (this=0x14adec0267c8, buf=0x14adec02c740 "\377", key=0x14adec038050 "", keypart_map=<optimized out>, find_flag=HA_READ_BEFORE_KEY) at /data/builds/10.3_dbg/sql/handler.h:3475 #12 0x0000555acc1ed742 in handler::ha_index_read_map (this=0x14adec0267c8, buf=0x14adec02c740 "\377", key=0x14adec038050 "", keypart_map=1, find_flag=HA_READ_BEFORE_KEY) at /data/builds/10.3_dbg/sql/handler.cc:2904 #13 0x0000555acc378498 in QUICK_SELECT_DESC::get_next (this=0x14adec011150) at /data/builds/10.3_dbg/sql/opt_range.cc:11864 #14 0x0000555acc38311f in rr_quick (info=0x14adec014208) at /data/builds/10.3_dbg/sql/records.cc:369 #15 0x0000555acbfba961 in READ_RECORD::read_record (this=0x14adec014208) at /data/builds/10.3_dbg/sql/records.h:70 #16 join_init_read_record (tab=0x14adec014140) at /data/builds/10.3_dbg/sql/sql_select.cc:20647 #17 0x0000555acbfa2193 in sub_select (join=0x14adec012348, join_tab=0x14adec014140, end_of_records=<optimized out>) at /data/builds/10.3_dbg/sql/sql_select.cc:19708 #18 0x0000555acbfd3327 in do_select (procedure=<optimized out>, join=0x14adec012348) at /data/builds/10.3_dbg/sql/sql_select.cc:19251 #19 JOIN::exec_inner (this=this@entry=0x14adec012348) at /data/builds/10.3_dbg/sql/sql_select.cc:4124 #20 0x0000555acbfd3716 in JOIN::exec (this=this@entry=0x14adec012348) at /data/builds/10.3_dbg/sql/sql_select.cc:3918 #21 0x0000555acbfd413d in mysql_select (thd=thd@entry=0x14adec000d90, tables=0x14adec011770, wild_num=1, fields=@0x14adec005508: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14adec011728, last = 0x14adec012b10, elements = 2}, <No data fields>}, conds=0x14adec011f90, og_num=1, order=0x14adec012208, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x14adec012320, unit=0x14adec004c58, select_lex=0x14adec0053e0) at /data/builds/10.3_dbg/sql/sql_select.cc:4323 #22 0x0000555acbfd43ec in handle_select (thd=thd@entry=0x14adec000d90, lex=lex@entry=0x14adec004b98, result=result@entry=0x14adec012320, setup_tables_done_option=setup_tables_done_option@entry=0) at /data/builds/10.3_dbg/sql/sql_select.cc:370 #23 0x0000555acbf4c575 in execute_sqlcom_select (thd=thd@entry=0x14adec000d90, all_tables=0x14adec011770) at /data/builds/10.3_dbg/sql/sql_parse.cc:6316 #24 0x0000555acbf57238 in mysql_execute_command (thd=thd@entry=0x14adec000d90) at /data/builds/10.3_dbg/sql/sql_parse.cc:3847 #25 0x0000555acbf61435 in mysql_parse (thd=thd@entry=0x14adec000d90, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14ae0bbb1540, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/builds/10.3_dbg/sql/sql_parse.cc:7840 #26 0x0000555acbf63ba6 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14adec000d90, packet=packet@entry=0x14adec019991 "", packet_length=packet_length@entry=41, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/builds/10.3_dbg/sql/sql_class.h:1139 #27 0x0000555acbf66d32 in do_command (thd=0x14adec000d90) at /data/builds/10.3_dbg/sql/sql_parse.cc:1398 #28 0x0000555acc08d187 in do_handle_one_connection (connect=connect@entry=0x555acf7f4200) at /data/builds/10.3_dbg/sql/sql_connect.cc:1403 #29 0x0000555acc08d3be in handle_one_connection (arg=0x555acf7f4200) at /data/builds/10.3_dbg/sql/sql_connect.cc:1308 #30 0x000014ae56949609 in start_thread (arg=<optimized out>) at pthread_create.c:477 #31 0x000014ae56540293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 10.4.18 e626f511f9dc4faee9ae98fb5a8c8c6ddd06679b (Debug) mysqld: /data/builds/10.4_dbg/storage/innobase/btr/btr0pcur.cc:172: void btr_pcur_store_position(btr_pcur_t*, mtr_t*): Assertion `page_has_next(block->frame) || rec_is_alter_metadata(p, *index) || block->page.id.page_no() != index->page' failed. 10.4.18 e626f511f9dc4faee9ae98fb5a8c8c6ddd06679b (Debug) Core was generated by `/test/MD260121-mariadb-10.4.18-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:56 [Current thread is 1 (Thread 0x146f0808c700 (LWP 3245988))] (gdb) bt #0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56 #1 0x000055d281544077 in my_write_core (sig=sig@entry=6) at /data/builds/10.4_dbg/mysys/stacktrace.c:386 #2 0x000055d280c58437 in handle_fatal_signal (sig=6) at /data/builds/10.4_dbg/sql/signal_handler.cc:343 #3 <signal handler called> #4 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 #5 0x0000146f1f545859 in __GI_abort () at abort.c:79 #6 0x0000146f1f545729 in __assert_fail_base (fmt=0x146f1f6db588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55d28184e450 "page_has_next(block->frame) || rec_is_alter_metadata(p, *index) || block->page.id.page_no() != index->page", file=0x55d28184e258 "/data/builds/10.4_dbg/storage/innobase/btr/btr0pcur.cc", line=172, function=<optimized out>) at assert.c:92 #7 0x0000146f1f556f36 in __GI___assert_fail (assertion=assertion@entry=0x55d28184e450 "page_has_next(block->frame) || rec_is_alter_metadata(p, *index) || block->page.id.page_no() != index->page", file=file@entry=0x55d28184e258 "/data/builds/10.4_dbg/storage/innobase/btr/btr0pcur.cc", line=line@entry=172, function=function@entry=0x55d28184e290 "void btr_pcur_store_position(btr_pcur_t*, mtr_t*)") at assert.c:101 #8 0x000055d28119a226 in btr_pcur_store_position (cursor=cursor@entry=0x146ec007a220, mtr=mtr@entry=0x146f08088cd0) at /data/builds/10.4_dbg/storage/innobase/include/buf0types.h:172 #9 0x000055d2810ab329 in row_search_mvcc (buf=buf@entry=0x146ec0023a10 "\377", mode=<optimized out>, mode@entry=PAGE_CUR_L, prebuilt=0x146ec007a050, match_mode=match_mode@entry=0, direction=direction@entry=0) at /data/builds/10.4_dbg/storage/innobase/row/row0sel.cc:5682 #10 0x000055d280ec8586 in ha_innobase::index_read (this=0x146ec0027448, buf=0x146ec0023a10 "\377", key_ptr=<optimized out>, key_len=<optimized out>, find_flag=<optimized out>) at /data/builds/10.4_dbg/storage/innobase/handler/ha_innodb.cc:9245 #11 0x000055d280c71bf1 in handler::index_read_map (this=0x146ec0027448, buf=0x146ec0023a10 "\377", key=0x146ec007b890 "", keypart_map=<optimized out>, find_flag=HA_READ_BEFORE_KEY) at /data/builds/10.4_dbg/sql/handler.h:3628 #12 0x000055d280c60c12 in handler::ha_index_read_map (this=0x146ec0027448, buf=0x146ec0023a10 "\377", key=0x146ec007b890 "", keypart_map=1, find_flag=HA_READ_BEFORE_KEY) at /data/builds/10.4_dbg/sql/handler.cc:2922 #13 0x000055d280e17dac in QUICK_SELECT_DESC::get_next (this=0x146ec0021e00) at /data/builds/10.4_dbg/sql/opt_range.cc:12563 #14 0x000055d280e2348f in rr_quick (info=0x146ec0015a48) at /data/builds/10.4_dbg/sql/records.cc:369 #15 0x000055d2809ed4cd in READ_RECORD::read_record (this=0x146ec0015a48) at /data/builds/10.4_dbg/sql/records.h:70 #16 join_init_read_record (tab=0x146ec0015980) at /data/builds/10.4_dbg/sql/sql_select.cc:21347 #17 0x000055d2809d4647 in sub_select (join=0x146ec0013ae0, join_tab=0x146ec0015980, end_of_records=<optimized out>) at /data/builds/10.4_dbg/sql/sql_select.cc:20402 #18 0x000055d280a09120 in do_select (procedure=0x0, join=0x146ec0013ae0) at /data/builds/10.4_dbg/sql/sql_select.cc:19943 #19 JOIN::exec_inner (this=this@entry=0x146ec0013ae0) at /data/builds/10.4_dbg/sql/sql_select.cc:4486 #20 0x000055d280a0958a in JOIN::exec (this=this@entry=0x146ec0013ae0) at /data/builds/10.4_dbg/sql/sql_select.cc:4268 #21 0x000055d280a0783c in mysql_select (thd=thd@entry=0x146ec0000d90, tables=0x146ec0012568, wild_num=1, fields=@0x146ec00120f0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x146ec0012520, last = 0x146ec00142b0, elements = 2}, <No data fields>}, conds=0x146ec0012df0, og_num=1, order=0x146ec0013960, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x146ec0013ab8, unit=0x146ec0004cc0, select_lex=0x146ec0011fa8) at /data/builds/10.4_dbg/sql/sql_select.cc:4703 #22 0x000055d280a07b65 in handle_select (thd=thd@entry=0x146ec0000d90, lex=lex@entry=0x146ec0004c00, result=result@entry=0x146ec0013ab8, setup_tables_done_option=setup_tables_done_option@entry=0) at /data/builds/10.4_dbg/sql/sql_select.cc:410 #23 0x000055d2809791a4 in execute_sqlcom_select (thd=thd@entry=0x146ec0000d90, all_tables=0x146ec0012568) at /data/builds/10.4_dbg/sql/sql_parse.cc:6417 #24 0x000055d28098469e in mysql_execute_command (thd=thd@entry=0x146ec0000d90) at /data/builds/10.4_dbg/sql/sql_parse.cc:3936 #25 0x000055d28098f024 in mysql_parse (thd=thd@entry=0x146ec0000d90, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x146f0808b490, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/builds/10.4_dbg/sql/sql_parse.cc:7958 #26 0x000055d28099187a in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x146ec0000d90, packet=packet@entry=0x146ec001a331 "", packet_length=packet_length@entry=41, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /data/builds/10.4_dbg/sql/sql_class.h:1170 #27 0x000055d2809950d0 in do_command (thd=0x146ec0000d90) at /data/builds/10.4_dbg/sql/sql_parse.cc:1373 #28 0x000055d280acde04 in do_handle_one_connection (connect=connect@entry=0x55d284ccfc30) at /data/builds/10.4_dbg/sql/sql_connect.cc:1412 #29 0x000055d280acdf23 in handle_one_connection (arg=0x55d284ccfc30) at /data/builds/10.4_dbg/sql/sql_connect.cc:1316 #30 0x0000146f1fb02609 in start_thread (arg=<optimized out>) at pthread_create.c:477 #31 0x0000146f1f642293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 Bug confirmed present in: MariaDB: 10.3.28 (dbg), 10.4.18 (dbg), 10.5.9 (dbg), 10.6.0 (dbg) Bug (or feature/syntax) confirmed not present in: MariaDB: 10.2.37 (dbg), 10.2.37 (opt), 10.3.28 (opt), 10.4.18 (opt), 10.5.9 (opt), 10.6.0 (opt) MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.33 (dbg), 5.7.33 (opt), 8.0.23 (dbg), 8.0.23 (opt)
            Roel Roel Van de Paar added a comment - - edited

            Also, on a slightly older build (1/1/21) that last testcase gives a different assert:

            10.6.0 9118fd360a3da0bba521caf2a35c424968235ac4 (Debug)

            mysqld: /test/10.6_dbg/storage/innobase/btr/btr0pcur.cc:175: void btr_pcur_store_position(btr_pcur_t*, mtr_t*): Assertion `page_has_next(block->frame) || rec_is_alter_metadata(p, *index)' failed.
            

            10.6.0 9118fd360a3da0bba521caf2a35c424968235ac4 (Debug)

            Core was generated by `/test/MD010121-mariadb-10.6.0-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:56
            [Current thread is 1 (Thread 0x14d5f95cb700 (LWP 989570))]
            (gdb) bt
            #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
            #1  0x000055d5645af0d7 in my_write_core (sig=sig@entry=6) at /test/10.6_dbg/mysys/stacktrace.c:424
            #2  0x000055d563d43ab1 in handle_fatal_signal (sig=6) at /test/10.6_dbg/sql/signal_handler.cc:330
            #3  <signal handler called>
            #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
            #5  0x000014d61044a859 in __GI_abort () at abort.c:79
            #6  0x000014d61044a729 in __assert_fail_base (fmt=0x14d6105e0588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55d5649c8740 "page_has_next(block->frame) || rec_is_alter_metadata(p, *index)", file=0x55d5649c8438 "/test/10.6_dbg/storage/innobase/btr/btr0pcur.cc", line=175, function=<optimized out>) at assert.c:92
            #7  0x000014d61045bf36 in __GI___assert_fail (assertion=assertion@entry=0x55d5649c8740 "page_has_next(block->frame) || rec_is_alter_metadata(p, *index)", file=file@entry=0x55d5649c8438 "/test/10.6_dbg/storage/innobase/btr/btr0pcur.cc", line=line@entry=175, function=function@entry=0x55d5649c85e8 "void btr_pcur_store_position(btr_pcur_t*, mtr_t*)") at assert.c:101
            #8  0x000055d5643e8581 in btr_pcur_store_position (cursor=cursor@entry=0x14d5c0070d60, mtr=mtr@entry=0x14d5f95c8f60) at /test/10.6_dbg/storage/innobase/include/page0page.h:712
            #9  0x000055d56431279b in row_search_mvcc (buf=buf@entry=0x14d5c007e0d8 "\377", mode=<optimized out>, prebuilt=0x14d5c0070b98, match_mode=<optimized out>, direction=direction@entry=0) at /test/10.6_dbg/storage/innobase/row/row0sel.cc:5634
            #10 0x000055d564152ecc in ha_innobase::index_read (this=0x14d5c0027340, buf=0x14d5c007e0d8 "\377", key_ptr=0x14d5c0087f48 "", key_len=4, find_flag=HA_READ_BEFORE_KEY) at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:8561
            #11 0x000055d563d5f0d5 in handler::index_read_map (this=0x14d5c0027340, buf=0x14d5c007e0d8 "\377", key=0x14d5c0087f48 "", keypart_map=<optimized out>, find_flag=HA_READ_BEFORE_KEY) at /test/10.6_dbg/sql/handler.h:3797
            #12 0x000055d563d4caaf in handler::ha_index_read_map (this=0x14d5c0027340, buf=0x14d5c007e0d8 "\377", key=0x14d5c0087f48 "", keypart_map=1, find_flag=HA_READ_BEFORE_KEY) at /test/10.6_dbg/sql/handler.cc:3123
            #13 0x000055d563f1486c in QUICK_SELECT_DESC::get_next (this=0x14d5c0086af0) at /test/10.6_dbg/sql/opt_range.cc:12560
            #14 0x000055d563f2035d in rr_quick (info=0x14d5c0016358) at /test/10.6_dbg/sql/records.cc:403
            #15 0x000055d563ae1a02 in READ_RECORD::read_record (this=0x14d5c0016358) at /test/10.6_dbg/sql/records.h:81
            #16 join_init_read_record (tab=0x14d5c0016290) at /test/10.6_dbg/sql/sql_select.cc:21573
            #17 0x000055d563ac83a5 in sub_select (join=0x14d5c0014370, join_tab=0x14d5c0016290, end_of_records=<optimized out>) at /test/10.6_dbg/sql/sql_select.cc:20595
            #18 0x000055d563b0133b in do_select (procedure=0x0, join=0x14d5c0014370) at /test/10.6_dbg/sql/sql_select.cc:20145
            #19 JOIN::exec_inner (this=this@entry=0x14d5c0014370) at /test/10.6_dbg/sql/sql_select.cc:4472
            #20 0x000055d563b017ad in JOIN::exec (this=this@entry=0x14d5c0014370) at /test/10.6_dbg/sql/sql_select.cc:4252
            #21 0x000055d563affa09 in mysql_select (thd=thd@entry=0x14d5c0000db8, tables=0x14d5c0012d68, fields=@0x14d5c00128c8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14d5c0012d20, last = 0x14d5c0014ba8, elements = 2}, <No data fields>}, conds=0x14d5c0013638, og_num=1, order=0x14d5c00141e8, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x14d5c0014348, unit=0x14d5c0004f80, select_lex=0x14d5c0012778) at /test/10.6_dbg/sql/sql_select.cc:4668
            #22 0x000055d563affcd0 in handle_select (thd=thd@entry=0x14d5c0000db8, lex=lex@entry=0x14d5c0004eb8, result=result@entry=0x14d5c0014348, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.6_dbg/sql/sql_select.cc:417
            #23 0x000055d563a7219d in execute_sqlcom_select (thd=thd@entry=0x14d5c0000db8, all_tables=0x14d5c0012d68) at /test/10.6_dbg/sql/sql_parse.cc:6116
            #24 0x000055d563a7ec7c in mysql_execute_command (thd=thd@entry=0x14d5c0000db8) at /test/10.6_dbg/sql/sql_parse.cc:3820
            #25 0x000055d563a6b072 in mysql_parse (thd=thd@entry=0x14d5c0000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d5f95ca3d0) at /test/10.6_dbg/sql/sql_parse.cc:7881
            #26 0x000055d563a791ec in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14d5c0000db8, packet=packet@entry=0x14d5c0008d39 "", packet_length=packet_length@entry=41) at /test/10.6_dbg/sql/sql_class.h:1293
            #27 0x000055d563a7c52d in do_command (thd=0x14d5c0000db8) at /test/10.6_dbg/sql/sql_parse.cc:1348
            #28 0x000055d563bd87fc in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55d5676b26f8, put_in_cache=put_in_cache@entry=true) at /test/10.6_dbg/sql/sql_connect.cc:1410
            #29 0x000055d563bd8f03 in handle_one_connection (arg=arg@entry=0x55d5676b26f8) at /test/10.6_dbg/sql/sql_connect.cc:1312
            #30 0x000055d56408e88f in pfs_spawn_thread (arg=0x55d5675fe898) at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
            #31 0x000014d610958609 in start_thread (arg=<optimized out>) at pthread_create.c:477
            #32 0x000014d610547293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
            

            Roel Roel Van de Paar added a comment - - edited Also, on a slightly older build (1/1/21) that last testcase gives a different assert: 10.6.0 9118fd360a3da0bba521caf2a35c424968235ac4 (Debug) mysqld: /test/10.6_dbg/storage/innobase/btr/btr0pcur.cc:175: void btr_pcur_store_position(btr_pcur_t*, mtr_t*): Assertion `page_has_next(block->frame) || rec_is_alter_metadata(p, *index)' failed. 10.6.0 9118fd360a3da0bba521caf2a35c424968235ac4 (Debug) Core was generated by `/test/MD010121-mariadb-10.6.0-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:56 [Current thread is 1 (Thread 0x14d5f95cb700 (LWP 989570))] (gdb) bt #0 __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56 #1 0x000055d5645af0d7 in my_write_core (sig=sig@entry=6) at /test/10.6_dbg/mysys/stacktrace.c:424 #2 0x000055d563d43ab1 in handle_fatal_signal (sig=6) at /test/10.6_dbg/sql/signal_handler.cc:330 #3 <signal handler called> #4 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 #5 0x000014d61044a859 in __GI_abort () at abort.c:79 #6 0x000014d61044a729 in __assert_fail_base (fmt=0x14d6105e0588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55d5649c8740 "page_has_next(block->frame) || rec_is_alter_metadata(p, *index)", file=0x55d5649c8438 "/test/10.6_dbg/storage/innobase/btr/btr0pcur.cc", line=175, function=<optimized out>) at assert.c:92 #7 0x000014d61045bf36 in __GI___assert_fail (assertion=assertion@entry=0x55d5649c8740 "page_has_next(block->frame) || rec_is_alter_metadata(p, *index)", file=file@entry=0x55d5649c8438 "/test/10.6_dbg/storage/innobase/btr/btr0pcur.cc", line=line@entry=175, function=function@entry=0x55d5649c85e8 "void btr_pcur_store_position(btr_pcur_t*, mtr_t*)") at assert.c:101 #8 0x000055d5643e8581 in btr_pcur_store_position (cursor=cursor@entry=0x14d5c0070d60, mtr=mtr@entry=0x14d5f95c8f60) at /test/10.6_dbg/storage/innobase/include/page0page.h:712 #9 0x000055d56431279b in row_search_mvcc (buf=buf@entry=0x14d5c007e0d8 "\377", mode=<optimized out>, prebuilt=0x14d5c0070b98, match_mode=<optimized out>, direction=direction@entry=0) at /test/10.6_dbg/storage/innobase/row/row0sel.cc:5634 #10 0x000055d564152ecc in ha_innobase::index_read (this=0x14d5c0027340, buf=0x14d5c007e0d8 "\377", key_ptr=0x14d5c0087f48 "", key_len=4, find_flag=HA_READ_BEFORE_KEY) at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:8561 #11 0x000055d563d5f0d5 in handler::index_read_map (this=0x14d5c0027340, buf=0x14d5c007e0d8 "\377", key=0x14d5c0087f48 "", keypart_map=<optimized out>, find_flag=HA_READ_BEFORE_KEY) at /test/10.6_dbg/sql/handler.h:3797 #12 0x000055d563d4caaf in handler::ha_index_read_map (this=0x14d5c0027340, buf=0x14d5c007e0d8 "\377", key=0x14d5c0087f48 "", keypart_map=1, find_flag=HA_READ_BEFORE_KEY) at /test/10.6_dbg/sql/handler.cc:3123 #13 0x000055d563f1486c in QUICK_SELECT_DESC::get_next (this=0x14d5c0086af0) at /test/10.6_dbg/sql/opt_range.cc:12560 #14 0x000055d563f2035d in rr_quick (info=0x14d5c0016358) at /test/10.6_dbg/sql/records.cc:403 #15 0x000055d563ae1a02 in READ_RECORD::read_record (this=0x14d5c0016358) at /test/10.6_dbg/sql/records.h:81 #16 join_init_read_record (tab=0x14d5c0016290) at /test/10.6_dbg/sql/sql_select.cc:21573 #17 0x000055d563ac83a5 in sub_select (join=0x14d5c0014370, join_tab=0x14d5c0016290, end_of_records=<optimized out>) at /test/10.6_dbg/sql/sql_select.cc:20595 #18 0x000055d563b0133b in do_select (procedure=0x0, join=0x14d5c0014370) at /test/10.6_dbg/sql/sql_select.cc:20145 #19 JOIN::exec_inner (this=this@entry=0x14d5c0014370) at /test/10.6_dbg/sql/sql_select.cc:4472 #20 0x000055d563b017ad in JOIN::exec (this=this@entry=0x14d5c0014370) at /test/10.6_dbg/sql/sql_select.cc:4252 #21 0x000055d563affa09 in mysql_select (thd=thd@entry=0x14d5c0000db8, tables=0x14d5c0012d68, fields=@0x14d5c00128c8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14d5c0012d20, last = 0x14d5c0014ba8, elements = 2}, <No data fields>}, conds=0x14d5c0013638, og_num=1, order=0x14d5c00141e8, group=0x0, having=0x0, proc_param=0x0, select_options=2147748608, result=0x14d5c0014348, unit=0x14d5c0004f80, select_lex=0x14d5c0012778) at /test/10.6_dbg/sql/sql_select.cc:4668 #22 0x000055d563affcd0 in handle_select (thd=thd@entry=0x14d5c0000db8, lex=lex@entry=0x14d5c0004eb8, result=result@entry=0x14d5c0014348, setup_tables_done_option=setup_tables_done_option@entry=0) at /test/10.6_dbg/sql/sql_select.cc:417 #23 0x000055d563a7219d in execute_sqlcom_select (thd=thd@entry=0x14d5c0000db8, all_tables=0x14d5c0012d68) at /test/10.6_dbg/sql/sql_parse.cc:6116 #24 0x000055d563a7ec7c in mysql_execute_command (thd=thd@entry=0x14d5c0000db8) at /test/10.6_dbg/sql/sql_parse.cc:3820 #25 0x000055d563a6b072 in mysql_parse (thd=thd@entry=0x14d5c0000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d5f95ca3d0) at /test/10.6_dbg/sql/sql_parse.cc:7881 #26 0x000055d563a791ec in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14d5c0000db8, packet=packet@entry=0x14d5c0008d39 "", packet_length=packet_length@entry=41) at /test/10.6_dbg/sql/sql_class.h:1293 #27 0x000055d563a7c52d in do_command (thd=0x14d5c0000db8) at /test/10.6_dbg/sql/sql_parse.cc:1348 #28 0x000055d563bd87fc in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55d5676b26f8, put_in_cache=put_in_cache@entry=true) at /test/10.6_dbg/sql/sql_connect.cc:1410 #29 0x000055d563bd8f03 in handle_one_connection (arg=arg@entry=0x55d5676b26f8) at /test/10.6_dbg/sql/sql_connect.cc:1312 #30 0x000055d56408e88f in pfs_spawn_thread (arg=0x55d5675fe898) at /test/10.6_dbg/storage/perfschema/pfs.cc:2201 #31 0x000014d610958609 in start_thread (arg=<optimized out>) at pthread_create.c:477 #32 0x000014d610547293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

            The following test case should be deterministic. The trick is to wait for purge. Without that wait, the test would not crash for me in ./mtr --rr.

            --source include/have_innodb.inc
            --source include/have_debug.inc
            SET @save_limit=@@GLOBAL.innodb_limit_optimistic_insert_debug;
            SET @save_freq=@@GLOBAL.innodb_purge_rseg_truncate_frequency;
            SET GLOBAL innodb_purge_rseg_truncate_frequency=1;
             
            CREATE TABLE t (c INT KEY) ENGINE=InnoDB;
            INSERT INTO t VALUES(1),(2);
            SET GLOBAL innodb_limit_optimistic_insert_debug=2;
            ALTER TABLE t ADD COLUMN d INT;
            DELETE FROM t;
            --source include/wait_all_purged.inc
            SELECT * FROM t WHERE c<>1 ORDER BY c DESC;
            DROP TABLE t;
             
            SET GLOBAL innodb_limit_optimistic_insert_debug = @save_limit;
            SET GLOBAL innodb_purge_rseg_truncate_frequency = @save_freq;
            

            marko Marko Mäkelä added a comment - The following test case should be deterministic. The trick is to wait for purge. Without that wait, the test would not crash for me in ./mtr --rr . --source include/have_innodb.inc --source include/have_debug.inc SET @save_limit=@@ GLOBAL .innodb_limit_optimistic_insert_debug; SET @save_freq=@@ GLOBAL .innodb_purge_rseg_truncate_frequency; SET GLOBAL innodb_purge_rseg_truncate_frequency=1;   CREATE TABLE t (c INT KEY ) ENGINE=InnoDB; INSERT INTO t VALUES (1),(2); SET GLOBAL innodb_limit_optimistic_insert_debug=2; ALTER TABLE t ADD COLUMN d INT ; DELETE FROM t; --source include/wait_all_purged.inc SELECT * FROM t WHERE c<>1 ORDER BY c DESC ; DROP TABLE t;   SET GLOBAL innodb_limit_optimistic_insert_debug = @save_limit; SET GLOBAL innodb_purge_rseg_truncate_frequency = @save_freq;

            MDEV-24653 introduced a bogus assertion that is only present in debug builds. I was thinking whether we could relax the assertion in any way, but in the end I removed it. We might restore it later as part of fixing MDEV-24673.

            marko Marko Mäkelä added a comment - MDEV-24653 introduced a bogus assertion that is only present in debug builds. I was thinking whether we could relax the assertion in any way, but in the end I removed it. We might restore it later as part of fixing MDEV-24673 .

            People

              marko Marko Mäkelä
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.