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

Server crashes in key_copy upon INSERT into table with long unique multi-part key and auto-increment

    XMLWordPrintable

    Details

      Description

      CREATE TABLE t1 (a INT AUTO_INCREMENT, b VARCHAR(1024), UNIQUE (b,a)) ENGINE=MyISAM;
      INSERT INTO t1 () VALUES ();
       
      # Cleanup
      DROP TABLE t1;
      

      10.4 a17a327f

      #3  <signal handler called>
      #4  0x0000560f03088abe in key_copy (to_key=0x7fbae4a47ce9 "\230\202\003\017V", from_record=0x7fbad412a0f8 "\377", key_info=0x7fbad400bc88, key_length=1016, with_zerofill=false) at /data/src/10.4/sql/key.cc:150
      #5  0x0000560f036ed3e8 in ha_myisam::get_auto_increment (this=0x7fbad4132b78, offset=1, increment=1, nb_desired_values=1, first_value=0x7fbae4a48108, nb_reserved_values=0x7fbae4a48110) at /data/src/10.4/storage/myisam/ha_myisam.cc:2306
      #6  0x0000560f02f727d1 in handler::update_auto_increment (this=0x7fbad4132b78) at /data/src/10.4/sql/handler.cc:3377
      #7  0x0000560f036e8958 in ha_myisam::write_row (this=0x7fbad4132b78, buf=0x7fbad412a0f8 "\377") at /data/src/10.4/storage/myisam/ha_myisam.cc:946
      #8  0x0000560f02f7bdaa in handler::ha_write_row (this=0x7fbad4132b78, buf=0x7fbad412a0f8 "\377") at /data/src/10.4/sql/handler.cc:6675
      #9  0x0000560f02bc125c in write_record (thd=0x7fbad4000af0, table=0x7fbad400ae20, info=0x7fbae4a48490) at /data/src/10.4/sql/sql_insert.cc:2056
      #10 0x0000560f02bbe1c7 in mysql_insert (thd=0x7fbad4000af0, table_list=0x7fbad4013280, fields=..., values_list=..., update_fields=..., update_values=..., duplic=DUP_ERROR, ignore=false) at /data/src/10.4/sql/sql_insert.cc:1078
      #11 0x0000560f02c0c6dd in mysql_execute_command (thd=0x7fbad4000af0) at /data/src/10.4/sql/sql_parse.cc:4528
      #12 0x0000560f02c18e67 in mysql_parse (thd=0x7fbad4000af0, rawbuf=0x7fbad4013198 "INSERT INTO t1 () VALUES ()", length=27, parser_state=0x7fbae4a49160, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:7900
      #13 0x0000560f02c0404a in dispatch_command (command=COM_QUERY, thd=0x7fbad4000af0, packet=0x7fbad4136221 "INSERT INTO t1 () VALUES ()", packet_length=27, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1842
      #14 0x0000560f02c026d7 in do_command (thd=0x7fbad4000af0) at /data/src/10.4/sql/sql_parse.cc:1360
      #15 0x0000560f02d8b943 in do_handle_one_connection (connect=0x560f05898ce0) at /data/src/10.4/sql/sql_connect.cc:1412
      #16 0x0000560f02d8b692 in handle_one_connection (arg=0x560f05898ce0) at /data/src/10.4/sql/sql_connect.cc:1316
      #17 0x0000560f03792585 in pfs_spawn_thread (arg=0x560f058b4c80) at /data/src/10.4/storage/perfschema/pfs.cc:1869
      #18 0x00007fbaec8284a4 in start_thread (arg=0x7fbae4a4a700) at pthread_create.c:456
      #19 0x00007fbaea95cd0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
      

      Reproducible on 10.4, 10.5. Upd: Fixed in 10.5, but not in 10.4
      Reproducible on all of debug, ASAN, and non-debug with similarly looking stack traces. On non-debug build the crash is sporadic, though.

      The failure appeared in 10.4 tree with this commit:

      commit bd7f7b14163d0696aa92c90deeab16d63ae6bbd6
      Author: Sergei Golubchik
      Date:   Thu Feb 21 22:42:00 2019 +0100
       
          MDEV-371 Unique Index for long columns
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sanja Oleksandr Byelkin
              Reporter:
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:

                  Git Integration