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

Assertion `(0xFUL & mode) == LOCK_S || (0xFUL & mode) == LOCK_X' failed in lock_rec_lock

    XMLWordPrintable

    Details

      Description

      --source include/have_innodb.inc
       
      CREATE SEQUENCE s ENGINE=InnoDB;
      ALTER IGNORE TABLE s ADD CHECK (start_value < minimum_value);
      SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 's';
       
      # Cleanup
      DROP SEQUENCE s;
      

      10.5 a6946c55

      mysqld: /data/src/10.5/storage/innobase/lock/lock0lock.cc:1942: dberr_t lock_rec_lock(bool, ulint, const buf_block_t*, ulint, dict_index_t*, que_thr_t*): Assertion `(0xFUL & mode) == LOCK_S || (0xFUL & mode) == LOCK_X' failed.
      190707  0:37:28 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f2b73bc7f12 in __GI___assert_fail (assertion=0x55846971bfa8 "(0xFUL & mode) == LOCK_S || (0xFUL & mode) == LOCK_X", file=0x55846971b490 "/data/src/10.5/storage/innobase/lock/lock0lock.cc", line=1942, function=0x5584697202a0 <lock_rec_lock(bool, unsigned long, buf_block_t const*, unsigned long, dict_index_t*, que_thr_t*)::__PRETTY_FUNCTION__> "dberr_t lock_rec_lock(bool, ulint, const buf_block_t*, ulint, dict_index_t*, que_thr_t*)") at assert.c:101
      #8  0x0000558469014a73 in lock_rec_lock (impl=false, mode=5, block=0x7f2b6d260128, heap_no=1, index=0x7f2b1c141cc8, thr=0x7f2b1c058c88) at /data/src/10.5/storage/innobase/lock/lock0lock.cc:1942
      #9  0x0000558469020987 in lock_clust_rec_read_check_and_lock (flags=0, block=0x7f2b6d260128, rec=0x7f2b6d760070 "supremum", index=0x7f2b1c141cc8, offsets=0x7f2b6cf93d60, mode=LOCK_NONE, gap_mode=0, thr=0x7f2b1c058c88) at /data/src/10.5/storage/innobase/lock/lock0lock.cc:5852
      #10 0x00005584691239a9 in sel_set_rec_lock (pcur=0x7f2b1c058630, rec=0x7f2b6d760070 "supremum", index=0x7f2b1c141cc8, offsets=0x7f2b6cf93d60, mode=5, type=0, thr=0x7f2b1c058c88, mtr=0x7f2b6cf94680) at /data/src/10.5/storage/innobase/row/row0sel.cc:1262
      #11 0x000055846912bd85 in row_search_mvcc (buf=0x7f2b1c19fe70 '\245' <repeats 128 times>, "\070\377\031\034+\177", mode=PAGE_CUR_G, prebuilt=0x7f2b1c058468, match_mode=0, direction=0) at /data/src/10.5/storage/innobase/row/row0sel.cc:4670
      #12 0x0000558468f7e8bd in ha_innobase::index_read (this=0x7f2b1c1483d8, buf=0x7f2b1c19fe70 '\245' <repeats 128 times>, "\070\377\031\034+\177", key_ptr=0x0, key_len=0, find_flag=HA_READ_AFTER_KEY) at /data/src/10.5/storage/innobase/handler/ha_innodb.cc:9180
      #13 0x0000558468f7f6c8 in ha_innobase::index_first (this=0x7f2b1c1483d8, buf=0x7f2b1c19fe70 '\245' <repeats 128 times>, "\070\377\031\034+\177") at /data/src/10.5/storage/innobase/handler/ha_innodb.cc:9556
      #14 0x0000558468f7f8d3 in ha_innobase::rnd_next (this=0x7f2b1c1483d8, buf=0x7f2b1c19fe70 '\245' <repeats 128 times>, "\070\377\031\034+\177") at /data/src/10.5/storage/innobase/handler/ha_innodb.cc:9649
      #15 0x0000558468f1fb5b in ha_sequence::rnd_next (this=0x7f2b1c18b838, buf=0x7f2b1c19fe70 '\245' <repeats 128 times>, "\070\377\031\034+\177") at /data/src/10.5/sql/ha_sequence.h:111
      #16 0x0000558468bad165 in handler::ha_rnd_next (this=0x7f2b1c18b838, buf=0x7f2b1c19fe70 '\245' <repeats 128 times>, "\070\377\031\034+\177") at /data/src/10.5/sql/handler.cc:2794
      #17 0x0000558468baebc5 in handler::read_first_row (this=0x7f2b1c18b838, buf=0x7f2b1c19fe70 '\245' <repeats 128 times>, "\070\377\031\034+\177", primary_key=64) at /data/src/10.5/sql/handler.cc:3038
      #18 0x000055846891edfd in handler::ha_read_first_row (this=0x7f2b1c18b838, buf=0x7f2b1c19fe70 '\245' <repeats 128 times>, "\070\377\031\034+\177", primary_key=64) at /data/src/10.5/sql/sql_class.h:6580
      #19 0x0000558468acff30 in SEQUENCE::read_stored_values (this=0x7f2b1c1a02d8, table=0x7f2b1c147570) at /data/src/10.5/sql/sql_sequence.cc:514
      #20 0x0000558468acfd79 in SEQUENCE::read_initial_values (this=0x7f2b1c1a02d8, table=0x7f2b1c147570) at /data/src/10.5/sql/sql_sequence.cc:478
      #21 0x0000558468f1ea4e in ha_sequence::open (this=0x7f2b1c18b838, name=0x7f2b1c19fdc0 "./test/s", mode=2, flags=18) at /data/src/10.5/sql/ha_sequence.cc:114
      #22 0x0000558468bacab4 in handler::ha_open (this=0x7f2b1c18b838, table_arg=0x7f2b1c147570, name=0x7f2b1c19fdc0 "./test/s", mode=2, test_if_locked=18, mem_root=0x0, partitions_to_open=0x0) at /data/src/10.5/sql/handler.cc:2714
      #23 0x00005584689b96aa in open_table_from_share (thd=0x7f2b1c000b10, share=0x7f2b1c19f838, alias=0x7f2b1c050460, db_stat=33, prgflag=8, ha_open_flags=18, outparam=0x7f2b1c147570, is_create_table=false, partitions_to_open=0x0) at /data/src/10.5/sql/table.cc:3892
      #24 0x00005584687ebb78 in open_table (thd=0x7f2b1c000b10, table_list=0x7f2b1c050418, ot_ctx=0x7f2b6cf957a0) at /data/src/10.5/sql/sql_base.cc:2086
      #25 0x00005584687ef067 in open_and_process_table (thd=0x7f2b1c000b10, tables=0x7f2b1c050418, counter=0x7f2b6cf95864, flags=1090, prelocking_strategy=0x7f2b6cf95868, has_prelocking_list=false, ot_ctx=0x7f2b6cf957a0) at /data/src/10.5/sql/sql_base.cc:3841
      #26 0x00005584687f042c in open_tables (thd=0x7f2b1c000b10, options=..., start=0x7f2b6cf95850, counter=0x7f2b6cf95864, flags=1090, prelocking_strategy=0x7f2b6cf95868) at /data/src/10.5/sql/sql_base.cc:4341
      #27 0x00005584687e789b in open_tables (thd=0x7f2b1c000b10, tables=0x7f2b6cf95850, counter=0x7f2b6cf95864, flags=1090, prelocking_strategy=0x7f2b6cf95868) at /data/src/10.5/sql/sql_base.h:258
      #28 0x00005584687f2488 in open_normal_and_derived_tables (thd=0x7f2b1c000b10, tables=0x7f2b1c050418, flags=1090, dt_phases=35) at /data/src/10.5/sql/sql_base.cc:5288
      #29 0x00005584687f265c in open_tables_only_view_structure (thd=0x7f2b1c000b10, table_list=0x7f2b1c050418, can_deadlock=false) at /data/src/10.5/sql/sql_base.cc:5339
      #30 0x0000558468932d86 in fill_schema_table_by_open (thd=0x7f2b1c000b10, mem_root=0x7f2b6cf976c0, is_show_fields_or_keys=false, table=0x7f2b1c188498, schema_table=0x558469f39e60 <schema_tables+2048>, orig_db_name=0x7f2b1c04db80, orig_table_name=0x7f2b1c0192e8, open_tables_state_backup=0x7f2b6cf97710, can_deadlock=false) at /data/src/10.5/sql/sql_show.cc:4663
      #31 0x00005584689346b6 in get_all_tables (thd=0x7f2b1c000b10, tables=0x7f2b1c013a60, cond=0x7f2b1c0142f0) at /data/src/10.5/sql/sql_show.cc:5303
      #32 0x0000558468944bff in get_schema_tables_result (join=0x7f2b1c015980, executed_place=PROCESSED_BY_JOIN_EXEC) at /data/src/10.5/sql/sql_show.cc:8763
      #33 0x00005584688d929e in JOIN::exec_inner (this=0x7f2b1c015980) at /data/src/10.5/sql/sql_select.cc:4348
      #34 0x00005584688d872a in JOIN::exec (this=0x7f2b1c015980) at /data/src/10.5/sql/sql_select.cc:4173
      #35 0x00005584688d9dcf in mysql_select (thd=0x7f2b1c000b10, tables=0x7f2b1c013a60, wild_num=1, fields=..., conds=0x7f2b1c0142f0, og_num=0, order=0x0, group=0x0, having=0x0, proc_param=0x0, select_options=2684619520, result=0x7f2b1c015958, unit=0x7f2b1c004a38, select_lex=0x7f2b1c013468) at /data/src/10.5/sql/sql_select.cc:4605
      #36 0x00005584688ca3c6 in handle_select (thd=0x7f2b1c000b10, lex=0x7f2b1c004970, result=0x7f2b1c015958, setup_tables_done_option=0) at /data/src/10.5/sql/sql_select.cc:425
      #37 0x0000558468893df0 in execute_sqlcom_select (thd=0x7f2b1c000b10, all_tables=0x7f2b1c013a60) at /data/src/10.5/sql/sql_parse.cc:6319
      #38 0x0000558468889cee in mysql_execute_command (thd=0x7f2b1c000b10) at /data/src/10.5/sql/sql_parse.cc:3882
      #39 0x0000558468897b58 in mysql_parse (thd=0x7f2b1c000b10, rawbuf=0x7f2b1c013388 "SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 's'", length=62, parser_state=0x7f2b6cf99180, is_com_multi=false, is_next_command=false) at /data/src/10.5/sql/sql_parse.cc:7868
      #40 0x0000558468883ee5 in dispatch_command (command=COM_QUERY, thd=0x7f2b1c000b10, packet=0x7f2b1c138281 "SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 's'", packet_length=62, is_com_multi=false, is_next_command=false) at /data/src/10.5/sql/sql_parse.cc:1827
      #41 0x00005584688826a3 in do_command (thd=0x7f2b1c000b10) at /data/src/10.5/sql/sql_parse.cc:1360
      #42 0x0000558468a0f0e9 in do_handle_one_connection (connect=0x55846b3962f0, put_in_cache=true) at /data/src/10.5/sql/sql_connect.cc:1413
      #43 0x0000558468a0ee2d in handle_one_connection (arg=0x55846b3962f0) at /data/src/10.5/sql/sql_connect.cc:1309
      #44 0x0000558468f10309 in pfs_spawn_thread (arg=0x55846b2defa0) at /data/src/10.5/storage/perfschema/pfs.cc:1862
      #45 0x00007f2b7573c4a4 in start_thread (arg=0x7f2b6cf9a700) at pthread_create.c:456
      #46 0x00007f2b73c84d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
      

      10.4 and non-debug of 10.5 produce the error remarkably similar to MDEV-19320.

      10.5 a6946c55 non-debug

      CREATE SEQUENCE s ENGINE=InnoDB;
      ALTER IGNORE TABLE s ADD CHECK (start_value < minimum_value);
      Warnings:
      Warning	4025	CONSTRAINT `CONSTRAINT_1` failed for `test`.`s`
      SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 's';
      TABLE_CATALOG	TABLE_SCHEMA	TABLE_NAME	TABLE_TYPE	ENGINE	VERSION	ROW_FORMAT	TABLE_ROWS	AVG_ROW_LENGTH	DATA_LENGTH	MAX_DATA_LENGTH	INDEX_LENGTH	DATA_FREE	AUTO_INCREMENT	CREATE_TIME	UPDATE_TIME	CHECK_TIME	TABLE_COLLATION	CHECKSUM	CREATE_OPTIONS	TABLE_COMMENT	MAX_INDEX_LENGTH	TEMPORARY
      def	test	s	BASE TABLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	Can't find record in 's'	NULL	NULL
      Warnings:
      Warning	1032	Can't find record in 's'
      DROP SEQUENCE s;
      bug.3118 'innodb'                        [ fail ]  Found warnings/errors in server log file!
              Test ended at 2019-07-07 00:41:13
      line
      2019-07-07  0:41:13 9 [ERROR] mysqld: Can't find record in 's'
      ^ Found warnings in /data/bld/10.5-rel/mysql-test/var/log/mysqld.1.err
      ok
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              svoj Sergey Vojtovich
              Reporter:
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated: