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

Assertion in update_auto_increment() upon exotic LOAD

    Details

      Description

      Assertion `next_insert_id >= auto_inc_interval_for_cur_row.minimum()' failed in handler::update_auto_increment upon exotic LOAD using versioned partitioned table.

      Note: the assertion failure is the same as in MDEV-15800, but this test case doesn't explain any of the crashes mentioned there, so I'm filing it separately.

      --source include/have_partition.inc
       
      CREATE TABLE t1 ( 
        pk INT AUTO_INCREMENT,
        f1 TIMESTAMP,
        f2 VARCHAR(1024),
        f3 BIT(15),
        PRIMARY KEY(pk)
      );
       
      INSERT IGNORE INTO t1 (f1,f2,f3) VALUES
        ('1900-01-01 00:00:00','a',b'10000001010'),
        ('2035-01-14 08:29:54','b',b'001100'),
        ('2024-02-16 18:33:35','c',b'0'),
        ('1988-03-14 08:13:43',NULL,b'0'),
        ('1900-01-01 00:00:00','e',b'0001010'),
        ('2017-10-15 10:40:31','f',b'0');
       
      SELECT pk,f1,f2,f3 FROM t1 INTO OUTFILE 'load.data';
       
      CREATE TABLE t2 ( 
        pk INTEGER AUTO_INCREMENT,
        f1 TIMESTAMP,
        f2 VARCHAR(1024),
        f3 BIT(15) NOT NULL DEFAULT 0,
        PRIMARY KEY(pk),
        UNIQUE KEY(f3)
      ) WITH SYSTEM VERSIONING PARTITION BY system_time INTERVAL 2 DAY ( PARTITION p1 HISTORY, PARTITION pn CURRENT );
       
      --connect (con1,localhost,root,,test)
      DROP TABLE t1;
      ALTER TABLE t2 RENAME TO t1;
      LOAD DATA INFILE 'load.data' IGNORE INTO TABLE t1;
       
      # Cleanup
      DROP VIEW v1;
      DROP TABLE t1;
      

      10.3 85cdb63f774f2

      mysqld: /data/src/10.3/sql/handler.cc:3208: int handler::update_auto_increment(): Assertion `next_insert_id >= auto_inc_interval_for_cur_row.minimum()' failed.
      181001 17:42:02 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007fc55383dee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
      #8  0x00005646607c8a78 in handler::update_auto_increment (this=0x7fc53004f758) at /data/src/10.3/sql/handler.cc:3208
      #9  0x0000564660f27dc2 in ha_partition::write_row (this=0x7fc53004f758, buf=0x7fc5300441c8 "") at /data/src/10.3/sql/ha_partition.cc:4263
      #10 0x00005646607d0452 in handler::ha_write_row (this=0x7fc53004f758, buf=0x7fc5300441c8 "") at /data/src/10.3/sql/handler.cc:6235
      #11 0x000056466049692d in write_record (thd=0x7fc530000b00, table=0x7fc53004eb10, info=0x7fc54d998f00) at /data/src/10.3/sql/sql_insert.cc:2020
      #12 0x00005646604c36e8 in read_sep_field (thd=0x7fc530000b00, info=..., table_list=0x7fc530013ac8, fields_vars=..., set_fields=..., set_values=..., read_info=..., enclosed=..., skip_lines=0, ignore_check_option_errors=true) at /data/src/10.3/sql/sql_load.cc:1150
      #13 0x00005646604c1cbf in mysql_load (thd=0x7fc530000b00, ex=0x7fc530013a40, table_list=0x7fc530013ac8, fields_vars=..., set_fields=..., set_values=..., handle_duplicates=DUP_ERROR, ignore=true, read_file_from_client=false) at /data/src/10.3/sql/sql_load.cc:658
      #14 0x00005646604d681e in mysql_execute_command (thd=0x7fc530000b00) at /data/src/10.3/sql/sql_parse.cc:5127
      #15 0x00005646604dfc18 in mysql_parse (thd=0x7fc530000b00, rawbuf=0x7fc530013958 "LOAD DATA INFILE 'load.data' IGNORE INTO TABLE t1", length=49, parser_state=0x7fc54d99a5f0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:8089
      #16 0x00005646604ccece in dispatch_command (command=COM_QUERY, thd=0x7fc530000b00, packet=0x7fc53000b221 "LOAD DATA INFILE 'load.data' IGNORE INTO TABLE t1", packet_length=49, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1850
      #17 0x00005646604cb8f2 in do_command (thd=0x7fc530000b00) at /data/src/10.3/sql/sql_parse.cc:1395
      #18 0x000056466063278d in do_handle_one_connection (connect=0x564663b3de20) at /data/src/10.3/sql/sql_connect.cc:1402
      #19 0x0000564660632511 in handle_one_connection (arg=0x564663b3de20) at /data/src/10.3/sql/sql_connect.cc:1308
      #20 0x0000564660ac4ba7 in pfs_spawn_thread (arg=0x564663b51a70) at /data/src/10.3/storage/perfschema/pfs.cc:1862
      #21 0x00007fc555514494 in start_thread (arg=0x7fc54d99b700) at pthread_create.c:333
      #22 0x00007fc5538fa93f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                midenok Aleksey Midenkov
                Reporter:
                elenst Elena Stepanova
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: