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

Assertion `table_share->tmp_table != NO_TMP_TABLE || m_lock_type != 2' failed in handler::ha_index_read_map upon INSERT into partitioned table

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.4(EOL), 10.5(EOL), 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL), 10.11, 11.0(EOL), 11.4, 11.8
    • 10.11, 11.4, 11.8
    • Partitioning
    • None

    Description

      --source include/have_partition.inc
       
      CREATE TABLE t1 (
        a INT NOT NULL AUTO_INCREMENT,
        UNIQUE (a) USING HASH
      ) ENGINE=MyISAM
      PARTITION BY LIST (a) (
        PARTITION p0 VALUES IN (1,3),
        PARTITION p1 VALUES IN (8,4,2)
      );
       
      INSERT INTO t1 PARTITION (p1) (a) VALUES (8),(4);
       
      # Cleanup
      DROP TABLE t1;
      

      10.4 debug 542d769e

      mysqld: /data/src/10.4/sql/handler.cc:2918: int handler::ha_index_read_map(uchar*, const uchar*, key_part_map, ha_rkey_function): Assertion `table_share->tmp_table != NO_TMP_TABLE || m_lock_type != 2' failed.
      210208 20:44:55 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007f8baf45cf36 in __GI___assert_fail (assertion=0x556e58df10d8 "table_share->tmp_table != NO_TMP_TABLE || m_lock_type != 2", file=0x556e58defb01 "/data/src/10.4/sql/handler.cc", line=2918, function=0x556e58df1180 "int handler::ha_index_read_map(uchar*, const uchar*, key_part_map, ha_rkey_function)") at assert.c:101
      #8  0x0000556e582c2549 in handler::ha_index_read_map (this=0x7f8b98042308, buf=0x7f8b981259c8 "\377\b", key=0x7f8ba942b71f "d\r", keypart_map=18446744073709551615, find_flag=HA_READ_KEY_EXACT) at /data/src/10.4/sql/handler.cc:2918
      #9  0x0000556e58b284c8 in ha_partition::handle_unordered_scan_next_partition (this=0x7f8b981a8338, buf=0x7f8b981259c8 "\377\b") at /data/src/10.4/sql/ha_partition.cc:7457
      #10 0x0000556e58b22e20 in ha_partition::common_index_read (this=0x7f8b981a8338, buf=0x7f8b981259c8 "\377\b", have_start_key=true) at /data/src/10.4/sql/ha_partition.cc:5713
      #11 0x0000556e58b2298e in ha_partition::index_read_map (this=0x7f8b981a8338, buf=0x7f8b981259c8 "\377\b", key=0x7f8ba942b71f "d\r", keypart_map=18446744073709551615, find_flag=HA_READ_KEY_EXACT) at /data/src/10.4/sql/ha_partition.cc:5580
      #12 0x0000556e582c26ba in handler::ha_index_read_map (this=0x7f8b981a8338, buf=0x7f8b981259c8 "\377\b", key=0x7f8ba942b71f "d\r", keypart_map=18446744073709551615, find_flag=HA_READ_KEY_EXACT) at /data/src/10.4/sql/handler.cc:2922
      #13 0x0000556e582cd3ba in check_duplicate_long_entry_key (table=0x7f8b980414a0, h=0x7f8b981a8338, new_rec=0x7f8b981259c8 "\377\b", key_no=0) at /data/src/10.4/sql/handler.cc:6598
      #14 0x0000556e582cda87 in check_duplicate_long_entries (table=0x7f8b980414a0, h=0x7f8b981a8338, new_rec=0x7f8b981259c8 "\377\b") at /data/src/10.4/sql/handler.cc:6670
      #15 0x0000556e582cddd6 in handler::ha_write_row (this=0x7f8b981a8338, buf=0x7f8b981259c8 "\377\b") at /data/src/10.4/sql/handler.cc:6750
      #16 0x0000556e57f06c0b in write_record (thd=0x7f8b98000d90, table=0x7f8b980414a0, info=0x7f8ba942ba70) at /data/src/10.4/sql/sql_insert.cc:2060
      #17 0x0000556e57f03a75 in mysql_insert (thd=0x7f8b98000d90, table_list=0x7f8b980135b0, fields=..., values_list=..., update_fields=..., update_values=..., duplic=DUP_ERROR, ignore=false) at /data/src/10.4/sql/sql_insert.cc:1078
      #18 0x0000556e57f52672 in mysql_execute_command (thd=0x7f8b98000d90) at /data/src/10.4/sql/sql_parse.cc:4571
      #19 0x0000556e57f5e0ab in mysql_parse (thd=0x7f8b98000d90, rawbuf=0x7f8b98013458 "INSERT INTO t1 PARTITION (p1) (a) VALUES (8),(4)", length=48, parser_state=0x7f8ba942c550, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:7958
      #20 0x0000556e57f4a3d3 in dispatch_command (command=COM_QUERY, thd=0x7f8b98000d90, packet=0x7f8b980087b1 "INSERT INTO t1 PARTITION (p1) (a) VALUES (8),(4)", packet_length=48, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1855
      #21 0x0000556e57f48c3b in do_command (thd=0x7f8b98000d90) at /data/src/10.4/sql/sql_parse.cc:1373
      #22 0x0000556e580d804b in do_handle_one_connection (connect=0x556e5a65fab0) at /data/src/10.4/sql/sql_connect.cc:1412
      #23 0x0000556e580d7d94 in handle_one_connection (arg=0x556e5a65fab0) at /data/src/10.4/sql/sql_connect.cc:1316
      #24 0x0000556e58af958c in pfs_spawn_thread (arg=0x556e5a5b24e0) at /data/src/10.4/storage/perfschema/pfs.cc:1869
      #25 0x00007f8bafcdd609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #26 0x00007f8baf548293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Reproducible on 10.4-10.6 with at least InnoDB, MyISAM, Aria.
      Not reproducible on 10.3.
      No obvious immediate problem on a non-debug build.

      Attachments

        Activity

          People

            ycp Yuchen Pei
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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