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

Server crashes in row_make_new_pathname | ALTER TABLE ENGINE INNODB after DISCARD TABLESPACE

    XMLWordPrintable

    Details

      Description

      CREATE TABLE t (a INT) ENGINE=INNODB;
      ALTER TABLE t DISCARD TABLESPACE;
      ALTER TABLE t ENGINE INNODB;
      

      Leads to

      Exception thrown at 0x00007FF7F7C69C13 in mysqld.exe: 0xC0000005: Access violation reading location 0x0000000000000068.
      mysqld.exe!row_make_new_pathname(dict_table_t * table, const char * new_name) Line 4280 (d:\maria\server\storage\innobase\row\row0merge.cc:4280)
      mysqld.exe!row_merge_rename_tables_dict(dict_table_t * old_table, dict_table_t * new_table, const char * tmp_name, trx_t * trx) Line 4335 (d:\maria\server\storage\innobase\row\row0merge.cc:4335)
      mysqld.exe!commit_try_rebuild(Alter_inplace_info * ha_alter_info, ha_innobase_inplace_ctx * ctx, TABLE * altered_table, const TABLE * old_table, trx_t * trx, const char * table_name) Line 8508 (d:\maria\server\storage\innobase\handler\handler0alter.cc:8508)
      mysqld.exe!ha_innobase::commit_inplace_alter_table(TABLE * altered_table, Alter_inplace_info * ha_alter_info, bool commit) Line 9473 (d:\maria\server\storage\innobase\handler\handler0alter.cc:9473)
      mysqld.exe!handler::ha_commit_inplace_alter_table(TABLE * altered_table, Alter_inplace_info * ha_alter_info, bool commit) Line 4578 (d:\maria\server\sql\handler.cc:4578)
      mysqld.exe!mysql_inplace_alter_table(THD * thd, TABLE_LIST * table_list, TABLE * table, TABLE * altered_table, Alter_inplace_info * ha_alter_info, enum_alter_inplace_result inplace_supported, MDL_request * target_mdl_request, Alter_table_ctx * alter_ctx) Line 7678 (d:\maria\server\sql\sql_table.cc:7678)
      mysqld.exe!mysql_alter_table(THD * thd, const st_mysql_const_lex_string * new_db, const st_mysql_const_lex_string * new_name, HA_CREATE_INFO * create_info, TABLE_LIST * table_list, Alter_info * alter_info, unsigned int order_num, st_order * order, bool ignore) Line 9918 (d:\maria\server\sql\sql_table.cc:9918)
      mysqld.exe!Sql_cmd_alter_table::execute(THD * thd) Line 500 (d:\maria\server\sql\sql_alter.cc:500)
      mysqld.exe!mysql_execute_command(THD * thd) Line 6030 (d:\maria\server\sql\sql_parse.cc:6030)
      mysqld.exe!mysql_parse(THD * thd, char * rawbuf, unsigned int length, Parser_state * parser_state, bool is_com_multi, bool is_next_command) Line 7817 (d:\maria\server\sql\sql_parse.cc:7817)
      mysqld.exe!dispatch_command(enum_server_command command, THD * thd, char * packet, unsigned int packet_length, bool is_com_multi, bool is_next_command) Line 1858 (d:\maria\server\sql\sql_parse.cc:1858)
      mysqld.exe!do_command(THD * thd) Line 1401 (d:\maria\server\sql\sql_parse.cc:1401)
      mysqld.exe!threadpool_process_request(THD * thd) Line 359 (d:\maria\server\sql\threadpool_common.cc:359)
      mysqld.exe!tp_callback(TP_connection * c) Line 186 (d:\maria\server\sql\threadpool_common.cc:186)
      mysqld.exe!tp_callback(_TP_CALLBACK_INSTANCE * instance, void * context) Line 376 (d:\maria\server\sql\threadpool_win.cc:376)
      mysqld.exe!work_callback(_TP_CALLBACK_INSTANCE * instance, void * context, _TP_WORK * work) Line 450 (d:\maria\server\sql\threadpool_win.cc:450)
      ntdll.dll!00007ffc3c03081d() (Unknown Source:0)
      ntdll.dll!00007ffc3c0345b4() (Unknown Source:0)
      kernel32.dll!00007ffc3bd67bd4() (Unknown Source:0)
      ntdll.dll!00007ffc3c06ce51() (Unknown Source:0)
      

      In 10.3, 10.4, 10.5. Not found in 10.2.

      Result of above queries in 10.2:

      create table t(a INT) ENGINE = INNODB;
      Query OK, 0 rows affected (0.32 sec)
       
      mysql> ALTER TABLE t DISCARD TABLESPACE;
      Query OK, 0 rows affected (0.09 sec)
       
      ALTER TABLE t ENGINE INNODB;
      Query OK, 0 rows affected, 1 warning (0.33 sec)
      Records: 0  Duplicates: 0  Warnings: 1
       
      show warnings;
      +---------+------+---------------------------------------------+
      | Level   | Code | Message                                     |
      +---------+------+---------------------------------------------+
      | Warning | 1814 | Tablespace has been discarded for table `t` |
      +---------+------+---------------------------------------------+
       
      select * from t;
      ERROR 1814 (HY000): Tablespace has been discarded for table `t`
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              marko Marko Mäkelä
              Reporter:
              shihche Shihao Chen
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: