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

DESC keys: Data corruption or Assertion `index->n_core_null_bytes <= (((index->n_nullable) + 7) >> 3) || index->in_instant_init' failed

    XMLWordPrintable

Details

    Description

      --source include/have_innodb.inc
       
      CREATE TABLE t (id INT PRIMARY KEY, a CHAR(8), b INT, KEY(a DESC,b)) ENGINE=InnoDB;
      INSERT INTO t VALUES (1,'foo',10);
      ALTER TABLE t RENAME COLUMN b TO c;
       
      --source include/restart_mysqld.inc
       
      # Cleanup
      DROP TABLE t;
      

      preview-10.8-MDEV-13756-desc-indexes c10e10c6

      mariadbd: /data/src/preview-10.8-MDEV-13756-desc-indexes-clean/storage/innobase/rem/rem0rec.cc:619: void rec_init_offsets(const rec_t *, const dict_index_t *, ulint, rec_offs *): Assertion `index->n_core_null_bytes <= (((index->n_nullable) + 7) >> 3) || index->in_instant_init' failed.
      220124  2:45:09 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007ff515676662 in __GI___assert_fail (assertion=0x3f03940 <str> "index->n_core_null_bytes <= (((index->n_nullable) + 7) >> 3) || index->in_instant_init", file=0x3eff520 <str> "/data/src/preview-10.8-MDEV-13756-desc-indexes-clean/storage/innobase/rem/rem0rec.cc", line=619, function=0x3f039c0 <__PRETTY_FUNCTION__._ZL16rec_init_offsetsPKhPK12dict_index_tmPt> "void rec_init_offsets(const rec_t *, const dict_index_t *, ulint, rec_offs *)") at assert.c:101
      #8  0x0000000002b77c59 in rec_init_offsets (rec=0x7ff50ba2407e "\200", index=0x616000318120, n_core=5, offsets=0x7ff505cf0440) at /data/src/preview-10.8-MDEV-13756-desc-indexes-clean/storage/innobase/rem/rem0rec.cc:618
      #9  0x0000000002b74419 in rec_get_offsets_func (rec=0x7ff50ba2407e "\200", index=0x616000318120, offsets=0x7ff505cf0440, n_core=5, n_fields=1, file=0x3ed60c0 <str> "/data/src/preview-10.8-MDEV-13756-desc-indexes-clean/storage/innobase/page/page0cur.cc", line=453, heap=0x7ff505cf0420) at /data/src/preview-10.8-MDEV-13756-desc-indexes-clean/storage/innobase/rem/rem0rec.cc:948
      #10 0x0000000002ac4135 in page_cur_search_with_match (block=0x7ff50b561560, index=0x616000318120, tuple=0x61d00011fe30, mode=PAGE_CUR_LE, iup_matched_fields=0x7ff505cf0f60, ilow_matched_fields=0x7ff505cf0fa0, cursor=0x61f000001070, rtr_info=0x0) at /data/src/preview-10.8-MDEV-13756-desc-indexes-clean/storage/innobase/page/page0cur.cc:451
      #11 0x0000000002eded8d in btr_cur_search_to_nth_level_func (index=0x616000318120, level=0, tuple=0x61d00011fe30, mode=PAGE_CUR_LE, latch_mode=2, cursor=0x61f000001068, ahi_latch=0x0, mtr=0x7ff505cf3d60, autoinc=0) at /data/src/preview-10.8-MDEV-13756-desc-indexes-clean/storage/innobase/btr/btr0cur.cc:1973
      #12 0x0000000002cece21 in btr_pcur_open_low (index=0x616000318120, level=0, tuple=0x61d00011fe30, mode=PAGE_CUR_LE, latch_mode=2, cursor=0x61f000001068, autoinc=0, mtr=0x7ff505cf3d60) at /data/src/preview-10.8-MDEV-13756-desc-indexes-clean/storage/innobase/include/btr0pcur.ic:369
      #13 0x0000000002cec436 in row_search_on_row_ref (pcur=0x61f000001068, mode=2, table=0x618000020120, ref=0x61d00011fe30, mtr=0x7ff505cf3d60) at /data/src/preview-10.8-MDEV-13756-desc-indexes-clean/storage/innobase/row/row0row.cc:1215
      #14 0x0000000002cccc76 in row_purge_reposition_pcur (mode=2, node=0x61f000000fc8, mtr=0x7ff505cf3d60) at /data/src/preview-10.8-MDEV-13756-desc-indexes-clean/storage/innobase/row/row0purge.cc:81
      #15 0x0000000002cd2528 in row_purge_reset_trx_id (node=0x61f000000fc8, mtr=0x7ff505cf3d60) at /data/src/preview-10.8-MDEV-13756-desc-indexes-clean/storage/innobase/row/row0purge.cc:745
      #16 0x0000000002cd121e in row_purge_record_func (node=0x61f000000fc8, undo_rec=0x625000050368 "", thr=0x61f000000f20, updated_extern=false) at /data/src/preview-10.8-MDEV-13756-desc-indexes-clean/storage/innobase/row/row0purge.cc:1165
      #17 0x0000000002ccd7d6 in row_purge (node=0x61f000000fc8, undo_rec=0x625000050368 "", thr=0x61f000000f20) at /data/src/preview-10.8-MDEV-13756-desc-indexes-clean/storage/innobase/row/row0purge.cc:1209
      #18 0x0000000002ccd53f in row_purge_step (thr=0x61f000000f20) at /data/src/preview-10.8-MDEV-13756-desc-indexes-clean/storage/innobase/row/row0purge.cc:1258
      #19 0x0000000002b4ed5e in que_thr_step (thr=0x61f000000f20) at /data/src/preview-10.8-MDEV-13756-desc-indexes-clean/storage/innobase/que/que0que.cc:653
      #20 0x0000000002b4d7fb in que_run_threads_low (thr=0x61f000000f20) at /data/src/preview-10.8-MDEV-13756-desc-indexes-clean/storage/innobase/que/que0que.cc:709
      #21 0x0000000002b4d39c in que_run_threads (thr=0x61f000000f20) at /data/src/preview-10.8-MDEV-13756-desc-indexes-clean/storage/innobase/que/que0que.cc:729
      #22 0x0000000002d82d17 in srv_task_execute () at /data/src/preview-10.8-MDEV-13756-desc-indexes-clean/storage/innobase/srv/srv0srv.cc:1663
      #23 0x0000000002d7ea7e in purge_worker_callback () at /data/src/preview-10.8-MDEV-13756-desc-indexes-clean/storage/innobase/srv/srv0srv.cc:1907
      #24 0x00000000032a91e2 in tpool::task_group::execute (this=0x652bc60 <purge_task_group>, t=0x652bd20 <purge_worker_task>) at /data/src/preview-10.8-MDEV-13756-desc-indexes-clean/tpool/task_group.cc:55
      #25 0x00000000032aa078 in tpool::task::execute (this=0x652bd20 <purge_worker_task>) at /data/src/preview-10.8-MDEV-13756-desc-indexes-clean/tpool/task.cc:32
      #26 0x0000000003291393 in tpool::thread_pool_generic::worker_main (this=0x618000001080, thread_var=0x63000002f900) at /data/src/preview-10.8-MDEV-13756-desc-indexes-clean/tpool/tpool_generic.cc:549
      #27 0x00000000032a1b7c in std::__invoke_impl<void, void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*> (__f=@0x6040000021e8: (void (tpool::thread_pool_generic::*)(tpool::thread_pool_generic * const, tpool::worker_data *)) 0x3291130 <tpool::thread_pool_generic::worker_main(tpool::worker_data*)>, __t=@0x6040000021e0: 0x618000001080, __args=@0x6040000021d8: 0x63000002f900) at /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/invoke.h:73
      #28 0x00000000032a19a7 in std::__invoke<void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*> (__fn=@0x6040000021e8: (void (tpool::thread_pool_generic::*)(tpool::thread_pool_generic * const, tpool::worker_data *)) 0x3291130 <tpool::thread_pool_generic::worker_main(tpool::worker_data*)>, __args=@0x6040000021d8: 0x63000002f900, __args=@0x6040000021d8: 0x63000002f900) at /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/invoke.h:95
      #29 0x00000000032a194e in std::thread::_Invoker<std::tuple<void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*> >::_M_invoke<0ul, 1ul, 2ul> (this=0x6040000021d8) at /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/thread:264
      #30 0x00000000032a18e5 in std::thread::_Invoker<std::tuple<void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*> >::operator() (this=0x6040000021d8) at /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/thread:271
      #31 0x00000000032a15fe in std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*> > >::_M_run (this=0x6040000021d0) at /usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/thread:215
      #32 0x00007ff5158fced0 in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
      #33 0x00007ff515a09ea7 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #34 0x00007ff51573fdef in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Not reproducible with an ascending key.

      Non-debug build does not crash, but attempts to access the table data after restart fail:

      # restart
      SELECT * FROM t WHERE c = 10;
      bug.desc2 'innodb'                       [ fail ]
              Test ended at 2022-01-24 03:46:30
       
      CURRENT_TEST: bug.desc2
      mysqltest: At line 9: query 'SELECT * FROM t WHERE c = 10' failed: ER_GET_ERRNO (1030): Got error 1 "Operation not permitted" from storage engine InnoDB
       
      Warnings from just before the error:
      Warning 1082 InnoDB: Table test/t contains 1 indexes inside InnoDB, which is different from the number of indexes 2 defined in the MariaDB  
      Warning 1082 InnoDB: Table test/t contains 1 indexes inside InnoDB, which is different from the number of indexes 2 defined in the MariaDB
      

      Attachments

        Issue Links

          Activity

            People

              thiru Thirunarayanan Balathandayuthapani
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.