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

Assertion `!auto_increment_field_not_null' failed in TABLE::init after unsuccessful attempt to add CHECK constraint on temporary table

    XMLWordPrintable

Details

    Description

      CREATE TEMPORARY TABLE t1 (
        id INT NOT NULL AUTO_INCREMENT,
        f INT NOT NULL DEFAULT 0,
        PRIMARY KEY (id)
      );
      INSERT INTO t1 () VALUES ();
      ALTER IGNORE TABLE t1 ADD CONSTRAINT CHECK (f > 0);
      ALTER TABLE t1;
      

      10.2 affdd79c6

      mysqld: /data/src/10.2/sql/table.cc:4514: void TABLE::init(THD*, TABLE_LIST*): Assertion `!auto_increment_field_not_null' failed.
      180805 21:27:27 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007fd836f2eee2 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6
      #8  0x000056238732a502 in TABLE::init (this=0x7fd820173290, thd=0x7fd820000b00, tl=0x7fd820012540) at /data/src/10.2/sql/table.cc:4514
      #9  0x00005623874161cf in THD::open_temporary_table (this=0x7fd820000b00, tl=0x7fd820012540) at /data/src/10.2/sql/temporary_tables.cc:402
      #10 0x00005623874162bf in THD::open_temporary_tables (this=0x7fd820000b00, tl=0x7fd820012540) at /data/src/10.2/sql/temporary_tables.cc:439
      #11 0x0000562387221842 in mysql_execute_command (thd=0x7fd820000b00) at /data/src/10.2/sql/sql_parse.cc:3394
      #12 0x000056238722fa96 in mysql_parse (thd=0x7fd820000b00, rawbuf=0x7fd820012478 "ALTER TABLE t1", length=14, parser_state=0x7fd83120a200, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:8009
      #13 0x000056238721d516 in dispatch_command (command=COM_QUERY, thd=0x7fd820000b00, packet=0x7fd82008cb51 "ALTER TABLE t1", packet_length=14, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1824
      #14 0x000056238721be79 in do_command (thd=0x7fd820000b00) at /data/src/10.2/sql/sql_parse.cc:1378
      #15 0x000056238736d678 in do_handle_one_connection (connect=0x5623896160f0) at /data/src/10.2/sql/sql_connect.cc:1335
      #16 0x000056238736d405 in handle_one_connection (arg=0x5623896160f0) at /data/src/10.2/sql/sql_connect.cc:1241
      #17 0x000056238778f79a in pfs_spawn_thread (arg=0x562389634940) at /data/src/10.2/storage/perfschema/pfs.cc:1862
      #18 0x00007fd838c05494 in start_thread (arg=0x7fd83120b700) at pthread_create.c:333
      #19 0x00007fd836feb93f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      Reproducible with at least InnoDB and MyISAM.
      No obvious effect on a non-debug build.

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              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.