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

Server crashes in mysql_alter_table upon adding a non-null date column under NO_ZERO_DATE with ALGORITHM=INPLACE

    XMLWordPrintable

Details

    Description

      CREATE TABLE t1 (i INT) ENGINE=MyISAM;
      SET SQL_MODE= 'NO_ZERO_DATE';
      ALTER TABLE t1 ADD COLUMN d DATE NOT NULL, ALGORITHM=INPLACE;
       
      # Cleanup
      DROP TABLE t1;
      

      10.2 0c2fc9b3da4

      #3  <signal handler called>
      #4  0x000055efbda4556e in mysql_alter_table (thd=0x7f29dc000b00, new_db=0x7f29dc0051c8, new_name=0x7f29dc005598, create_info=0x7f29eead04d0, table_list=0x7f29dc0150c0, alter_info=0x7f29eead0410, order_num=0, order=0x0, ignore=false) at /data/src/10.4/sql/sql_table.cc:10109
      #5  0x000055efbdace69b in Sql_cmd_alter_table::execute (this=0x7f29dc015820, thd=0x7f29dc000b00) at /data/src/10.4/sql/sql_alter.cc:497
      #6  0x000055efbd96b9b9 in mysql_execute_command (thd=0x7f29dc000b00) at /data/src/10.4/sql/sql_parse.cc:6302
      #7  0x000055efbd9708e4 in mysql_parse (thd=0x7f29dc000b00, rawbuf=0x7f29dc014f98 "ALTER TABLE t1 ADD COLUMN d DATE NOT NULL, ALGORITHM=INPLACE", length=60, parser_state=0x7f29eead1600, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:8104
      #8  0x000055efbd95db0e in dispatch_command (command=COM_QUERY, thd=0x7f29dc000b00, packet=0x7f29dc00b421 "ALTER TABLE t1 ADD COLUMN d DATE NOT NULL, ALGORITHM=INPLACE", packet_length=60, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1851
      #9  0x000055efbd95c532 in do_command (thd=0x7f29dc000b00) at /data/src/10.4/sql/sql_parse.cc:1396
      #10 0x000055efbdac86de in do_handle_one_connection (connect=0x55efc08f26a0) at /data/src/10.4/sql/sql_connect.cc:1402
      #11 0x000055efbdac8462 in handle_one_connection (arg=0x55efc08f26a0) at /data/src/10.4/sql/sql_connect.cc:1308
      #12 0x000055efbdf87338 in pfs_spawn_thread (arg=0x55efc0836960) at /data/src/10.4/storage/perfschema/pfs.cc:1862
      #13 0x00007f29f63fb494 in start_thread (arg=0x7f29eead2700) at pthread_create.c:333
      #14 0x00007f29f49fc93f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      Reproducible with at least MyISAM and Aria.
      Not reproducible with InnoDB.
      Not reproducible on 10.1, ALTER instead produces an error that ALGORITHM=INPLACE is not supported for this.

      All of debug, non-debug and ASAN builds are affected.

      Attachments

        Issue Links

          Activity

            People

              nikitamalyavin Nikita Malyavin
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              8 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.