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

Assertion or ER_WARN_DATA_OUT_OF_RANGE upon ALTER on previously versioned table

    XMLWordPrintable

    Details

      Description

      Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' failed or ER_WARN_DATA_OUT_OF_RANGE upon ALTER on previously versioned table

      CREATE TABLE t1 (a INT) WITH SYSTEM VERSIONING;
      INSERT INTO t1 VALUES (128);
      DELETE FROM t1;
      SET STATEMENT system_versioning_alter_history=KEEP FOR ALTER TABLE t1 DROP SYSTEM VERSIONING, MODIFY COLUMN a TINYINT;
       
      # Cleanup
      DROP TABLE t1;
      

      10.3 fafb35ee

      mysqld: /data/src/10.3/sql/sql_error.cc:335: void Diagnostics_area::set_ok_status(ulonglong, ulonglong, const char*): Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' failed.
       
      #7  0x00007f91ce7e8f12 in __GI___assert_fail (assertion=0x55f87a718168 "!is_set() || (m_status == DA_OK_BULK && is_bulk_op())", file=0x55f87a7180b0 "/data/src/10.3/sql/sql_error.cc", line=335, function=0x55f87a718460 <Diagnostics_area::set_ok_status(unsigned long long, unsigned long long, char const*)::__PRETTY_FUNCTION__> "void Diagnostics_area::set_ok_status(ulonglong, ulonglong, const char*)") at assert.c:101
      #8  0x000055f879a78326 in Diagnostics_area::set_ok_status (this=0x7f91b8006080, affected_rows=0, last_insert_id=0, message=0x7f91c89e5970 "Records: 0  Duplicates: 0  Warnings: 1") at /data/src/10.3/sql/sql_error.cc:335
      #9  0x000055f879a234e2 in my_ok (thd=0x7f91b8000af0, affected_rows_arg=0, id=0, message=0x7f91c89e5970 "Records: 0  Duplicates: 0  Warnings: 1") at /data/src/10.3/sql/sql_class.h:4892
      #10 0x000055f879bac85f in mysql_alter_table (thd=0x7f91b8000af0, new_db=0x7f91b80051d8, new_name=0x7f91b8005598, create_info=0x7f91c89e64e0, table_list=0x7f91b8012bc8, alter_info=0x7f91c89e6420, order_num=0, order=0x0, ignore=false) at /data/src/10.3/sql/sql_table.cc:10224
      #11 0x000055f879c39c61 in Sql_cmd_alter_table::execute (this=0x7f91b8013340, thd=0x7f91b8000af0) at /data/src/10.3/sql/sql_alter.cc:500
      #12 0x000055f879acb5e0 in mysql_execute_command (thd=0x7f91b8000af0) at /data/src/10.3/sql/sql_parse.cc:6031
      #13 0x000055f879ad0d41 in mysql_parse (thd=0x7f91b8000af0, rawbuf=0x7f91b8012818 "SET STATEMENT system_versioning_alter_history=KEEP FOR ALTER TABLE t1 DROP SYSTEM VERSIONING, MODIFY COLUMN a TINYINT", length=117, parser_state=0x7f91c89e75e0, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:7818
      #14 0x000055f879abd8b5 in dispatch_command (command=COM_QUERY, thd=0x7f91b8000af0, packet=0x7f91b8008c71 "SET STATEMENT system_versioning_alter_history=KEEP FOR ALTER TABLE t1 DROP SYSTEM VERSIONING, MODIFY COLUMN a TINYINT", packet_length=117, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1856
      #15 0x000055f879abc1fd in do_command (thd=0x7f91b8000af0) at /data/src/10.3/sql/sql_parse.cc:1401
      #16 0x000055f879c33d62 in do_handle_one_connection (connect=0x55f87bf26c90) at /data/src/10.3/sql/sql_connect.cc:1403
      #17 0x000055f879c33ac4 in handle_one_connection (arg=0x55f87bf26c90) at /data/src/10.3/sql/sql_connect.cc:1308
      #18 0x000055f87a5e4a6e in pfs_spawn_thread (arg=0x55f87bf41d40) at /data/src/10.3/storage/perfschema/pfs.cc:1869
      #19 0x00007f91d07714a4 in start_thread (arg=0x7f91c89e8700) at pthread_create.c:456
      #20 0x00007f91ce8a5d0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
      

      Reproducible on 10.3-10.5 with at least MyISAM and InnoDB.

      Non-debug build doesn't crash, but it produces an error which, judging from the position of common sense, should not be happening (although I can imagine why it happens from technical perspective):

      mysqltest: At line 4: query 'SET STATEMENT system_versioning_alter_history=KEEP FOR ALTER TABLE t1 DROP SYSTEM VERSIONING, MODIFY COLUMN a TINYINT' failed: 1264: Out of range value for column 'a' at row 1
      

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: