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

Assertion `info->alias.str' failed in partition_info::check_partition_info instead of ER_VERS_WRONG_PARTS

Details

    Description

      --source include/have_partition.inc
       
      create table t1 (a int) with system versioning;
      --error ER_VERS_WRONG_PARTS
      alter table t1 partition by system_time partitions 1;
       
      # Cleanup
      drop table t1;
      

      10.5 dcc2eaeb

      mariadbd: /data/src/10.5/sql/partition_info.cc:1207: bool partition_info::check_partition_info(THD*, handlerton**, handler*, HA_CREATE_INFO*, partition_info*): Assertion `info->alias.str' failed.
      200407 14:59:47 [ERROR] mysqld got signal 6 ;
       
      #7  0x00007fa6db5fe102 in __GI___assert_fail (assertion=0x56450cb15b20 "info->alias.str", file=0x56450cb14640 "/data/src/10.5/sql/partition_info.cc", line=1207, function=0x56450cb16e00 <partition_info::check_partition_info(THD*, handlerton**, handler*, HA_CREATE_INFO*, partition_info*)::__PRETTY_FUNCTION__> "bool partition_info::check_partition_info(THD*, handlerton**, handler*, HA_CREATE_INFO*, partition_info*)") at assert.c:101
      #8  0x000056450ad87b02 in partition_info::check_partition_info (this=0x62b000038f88, thd=0x62b000069288, eng_type=0x7fa6d2c94d50, file=0x62b000039850, info=0x7fa6d2c98f30, add_or_reorg_part=0x0) at /data/src/10.5/sql/partition_info.cc:1207
      #9  0x000056450ac496d5 in mysql_create_frm_image (thd=0x62b000069288, db=..., table_name=..., create_info=0x7fa6d2c98f30, alter_info=0x7fa6d2c98e30, create_table_mode=-2, key_info=0x7fa6d2c96030, key_count=0x7fa6d2c95fb0, frm=0x7fa6d2c96170) at /data/src/10.5/sql/sql_table.cc:4791
      #10 0x000056450ac4c0a5 in create_table_impl (thd=0x62b000069288, orig_db=..., orig_table_name=..., db=..., table_name=..., path=0x7fa6d2c97c9d "./test/#sql-7e3e_4", options=..., create_info=0x7fa6d2c98f30, alter_info=0x7fa6d2c98e30, create_table_mode=-2, is_trans=0x0, key_info=0x7fa6d2c96030, key_count=0x7fa6d2c95fb0, frm=0x7fa6d2c96170) at /data/src/10.5/sql/sql_table.cc:5154
      #11 0x000056450ac7042b in mysql_alter_table (thd=0x62b000069288, new_db=0x62b00006db38, new_name=0x62b00006df40, create_info=0x7fa6d2c98f30, table_list=0x62b0000383f0, alter_info=0x7fa6d2c98e30, order_num=0, order=0x0, ignore=false, if_exists=false) at /data/src/10.5/sql/sql_table.cc:10298
      #12 0x000056450ae03370 in Sql_cmd_alter_table::execute (this=0x62b000038da0, thd=0x62b000069288) at /data/src/10.5/sql/sql_alter.cc:522
      #13 0x000056450a9e9950 in mysql_execute_command (thd=0x62b000069288) at /data/src/10.5/sql/sql_parse.cc:5908
      #14 0x000056450a9f7125 in mysql_parse (thd=0x62b000069288, rawbuf=0x62b0000382a8 "alter table t1 partition by system_time partitions 1", length=52, parser_state=0x7fa6d2c9aa50, is_com_multi=false, is_next_command=false) at /data/src/10.5/sql/sql_parse.cc:7953
      #15 0x000056450a9ccf15 in dispatch_command (command=COM_QUERY, thd=0x62b000069288, packet=0x629000249289 "alter table t1 partition by system_time partitions 1", packet_length=52, is_com_multi=false, is_next_command=false) at /data/src/10.5/sql/sql_parse.cc:1839
      #16 0x000056450a9c994a in do_command (thd=0x62b000069288) at /data/src/10.5/sql/sql_parse.cc:1358
      #17 0x000056450ade8a8b in do_handle_one_connection (connect=0x61100001fd88, put_in_cache=true) at /data/src/10.5/sql/sql_connect.cc:1422
      #18 0x000056450ade8326 in handle_one_connection (arg=0x61100001fc48) at /data/src/10.5/sql/sql_connect.cc:1319
      #19 0x000056450ba86bc6 in pfs_spawn_thread (arg=0x616000009108) at /data/src/10.5/storage/perfschema/pfs.cc:2201
      #20 0x00007fa6dbe78fa3 in start_thread (arg=<optimized out>) at pthread_create.c:486
      #21 0x00007fa6db6c74cf in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      No obvious problem on a non-debug build, it returns the expected error.
      Not reproducible on 10.4, it returns its own expected error ER_PARTITIONS_MUST_BE_DEFINED_ERROR.

      Attachments

        Activity

          elenst Elena Stepanova added a comment - - edited

          Test case for 10.3-10.4:

          --source include/have_partition.inc
           
          create or replace table t1 (a int) with system versioning;
          alter table t1 partition by system_time (partition pn current);
          

          10.4 db537a83

          mysqld: /data/src/10.4/sql/partition_info.cc:1259: bool partition_info::check_partition_info(THD*, handlerton**, handler*, HA_CREATE_INFO*, partition_info*): Assertion `info->alias.str' failed.
          200512 18:31:16 [ERROR] mysqld got signal 6 ;
           
          #7  0x00007f3286b3ef12 in __GI___assert_fail (assertion=0x565042db2349 "info->alias.str", file=0x565042db1c10 "/data/src/10.4/sql/partition_info.cc", line=1259, function=0x565042db34c0 <partition_info::check_partition_info(THD*, handlerton**, handler*, HA_CREATE_INFO*, partition_info*)::__PRETTY_FUNCTION__> "bool partition_info::check_partition_info(THD*, handlerton**, handler*, HA_CREATE_INFO*, partition_info*)") at assert.c:101
          #8  0x00005650421e25f4 in partition_info::check_partition_info (this=0x7f3270013ec0, thd=0x7f3270000af0, eng_type=0x7f3280ce4370, file=0x7f32700147d8, info=0x7f3280ce72f0, add_or_reorg_part=0x0) at /data/src/10.4/sql/partition_info.cc:1259
          #9  0x00005650421674db in mysql_create_frm_image (thd=0x7f3270000af0, db=..., table_name=..., create_info=0x7f3280ce72f0, alter_info=0x7f3280ce7230, create_table_mode=-2, key_info=0x7f3280ce4c98, key_count=0x7f3280ce4c68, frm=0x7f3280ce4d20) at /data/src/10.4/sql/sql_table.cc:4697
          #10 0x0000565042168615 in create_table_impl (thd=0x7f3270000af0, orig_db=..., orig_table_name=..., db=..., table_name=..., path=0x7f3280ce6f6d "./test/#sql-7bf9_4", options=..., create_info=0x7f3280ce72f0, alter_info=0x7f3280ce7230, create_table_mode=-2, is_trans=0x0, key_info=0x7f3280ce4c98, key_count=0x7f3280ce4c68, frm=0x7f3280ce4d20) at /data/src/10.4/sql/sql_table.cc:5053
          #11 0x000056504217660f in mysql_alter_table (thd=0x7f3270000af0, new_db=0x7f32700052b0, new_name=0x7f32700056b8, create_info=0x7f3280ce72f0, table_list=0x7f32700132c0, alter_info=0x7f3280ce7230, order_num=0, order=0x0, ignore=false) at /data/src/10.4/sql/sql_table.cc:10006
          #12 0x000056504220ea0b in Sql_cmd_alter_table::execute (this=0x7f3270013cf8, thd=0x7f3270000af0) at /data/src/10.4/sql/sql_alter.cc:520
          #13 0x000056504208d6a0 in mysql_execute_command (thd=0x7f3270000af0) at /data/src/10.4/sql/sql_parse.cc:6101
          #14 0x0000565042092b65 in mysql_parse (thd=0x7f3270000af0, rawbuf=0x7f3270013198 "alter table t1 partition by system_time (partition pn current)", length=62, parser_state=0x7f3280ce8570, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:7900
          #15 0x000056504207f115 in dispatch_command (command=COM_QUERY, thd=0x7f3270000af0, packet=0x7f3270136341 "alter table t1 partition by system_time (partition pn current)", packet_length=62, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1842
          #16 0x000056504207d8b7 in do_command (thd=0x7f3270000af0) at /data/src/10.4/sql/sql_parse.cc:1360
          #17 0x0000565042205426 in do_handle_one_connection (connect=0x565044e6ffe0) at /data/src/10.4/sql/sql_connect.cc:1412
          #18 0x0000565042205175 in handle_one_connection (arg=0x565044e6ffe0) at /data/src/10.4/sql/sql_connect.cc:1316
          #19 0x0000565042c051b1 in pfs_spawn_thread (arg=0x565044d818a0) at /data/src/10.4/storage/perfschema/pfs.cc:1869
          #20 0x00007f3288ac74a4 in start_thread (arg=0x7f3280ce9700) at pthread_create.c:456
          #21 0x00007f3286bfbd0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97
          

          Non-debug build doesn't crash, but the error it returns isn't very pretty:

          mysqltest: At line 4: query 'alter table t1 partition by system_time (partition pn current)' failed: 4128: Wrong partitions for `(null)`: must have at least one HISTORY and exactly one last CURRENT
          

          elenst Elena Stepanova added a comment - - edited Test case for 10.3-10.4: --source include/have_partition.inc   create or replace table t1 (a int ) with system versioning; alter table t1 partition by system_time (partition pn current ); 10.4 db537a83 mysqld: /data/src/10.4/sql/partition_info.cc:1259: bool partition_info::check_partition_info(THD*, handlerton**, handler*, HA_CREATE_INFO*, partition_info*): Assertion `info->alias.str' failed. 200512 18:31:16 [ERROR] mysqld got signal 6 ;   #7 0x00007f3286b3ef12 in __GI___assert_fail (assertion=0x565042db2349 "info->alias.str", file=0x565042db1c10 "/data/src/10.4/sql/partition_info.cc", line=1259, function=0x565042db34c0 <partition_info::check_partition_info(THD*, handlerton**, handler*, HA_CREATE_INFO*, partition_info*)::__PRETTY_FUNCTION__> "bool partition_info::check_partition_info(THD*, handlerton**, handler*, HA_CREATE_INFO*, partition_info*)") at assert.c:101 #8 0x00005650421e25f4 in partition_info::check_partition_info (this=0x7f3270013ec0, thd=0x7f3270000af0, eng_type=0x7f3280ce4370, file=0x7f32700147d8, info=0x7f3280ce72f0, add_or_reorg_part=0x0) at /data/src/10.4/sql/partition_info.cc:1259 #9 0x00005650421674db in mysql_create_frm_image (thd=0x7f3270000af0, db=..., table_name=..., create_info=0x7f3280ce72f0, alter_info=0x7f3280ce7230, create_table_mode=-2, key_info=0x7f3280ce4c98, key_count=0x7f3280ce4c68, frm=0x7f3280ce4d20) at /data/src/10.4/sql/sql_table.cc:4697 #10 0x0000565042168615 in create_table_impl (thd=0x7f3270000af0, orig_db=..., orig_table_name=..., db=..., table_name=..., path=0x7f3280ce6f6d "./test/#sql-7bf9_4", options=..., create_info=0x7f3280ce72f0, alter_info=0x7f3280ce7230, create_table_mode=-2, is_trans=0x0, key_info=0x7f3280ce4c98, key_count=0x7f3280ce4c68, frm=0x7f3280ce4d20) at /data/src/10.4/sql/sql_table.cc:5053 #11 0x000056504217660f in mysql_alter_table (thd=0x7f3270000af0, new_db=0x7f32700052b0, new_name=0x7f32700056b8, create_info=0x7f3280ce72f0, table_list=0x7f32700132c0, alter_info=0x7f3280ce7230, order_num=0, order=0x0, ignore=false) at /data/src/10.4/sql/sql_table.cc:10006 #12 0x000056504220ea0b in Sql_cmd_alter_table::execute (this=0x7f3270013cf8, thd=0x7f3270000af0) at /data/src/10.4/sql/sql_alter.cc:520 #13 0x000056504208d6a0 in mysql_execute_command (thd=0x7f3270000af0) at /data/src/10.4/sql/sql_parse.cc:6101 #14 0x0000565042092b65 in mysql_parse (thd=0x7f3270000af0, rawbuf=0x7f3270013198 "alter table t1 partition by system_time (partition pn current)", length=62, parser_state=0x7f3280ce8570, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:7900 #15 0x000056504207f115 in dispatch_command (command=COM_QUERY, thd=0x7f3270000af0, packet=0x7f3270136341 "alter table t1 partition by system_time (partition pn current)", packet_length=62, is_com_multi=false, is_next_command=false) at /data/src/10.4/sql/sql_parse.cc:1842 #16 0x000056504207d8b7 in do_command (thd=0x7f3270000af0) at /data/src/10.4/sql/sql_parse.cc:1360 #17 0x0000565042205426 in do_handle_one_connection (connect=0x565044e6ffe0) at /data/src/10.4/sql/sql_connect.cc:1412 #18 0x0000565042205175 in handle_one_connection (arg=0x565044e6ffe0) at /data/src/10.4/sql/sql_connect.cc:1316 #19 0x0000565042c051b1 in pfs_spawn_thread (arg=0x565044d818a0) at /data/src/10.4/storage/perfschema/pfs.cc:1869 #20 0x00007f3288ac74a4 in start_thread (arg=0x7f3280ce9700) at pthread_create.c:456 #21 0x00007f3286bfbd0f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:97 Non-debug build doesn't crash, but the error it returns isn't very pretty: mysqltest: At line 4: query 'alter table t1 partition by system_time (partition pn current)' failed: 4128: Wrong partitions for `(null)`: must have at least one HISTORY and exactly one last CURRENT
          midenok Aleksey Midenkov added a comment - https://github.com/MariaDB/server/commit/203da9f5fc4819006310e5a94450f15afae05a07

          OK to push after changing commit comment as we agreed.

          sanja Oleksandr Byelkin added a comment - OK to push after changing commit comment as we agreed.

          People

            midenok Aleksey Midenkov
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            5 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.