Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.3(EOL), 10.4(EOL)
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
- relates to
-
MDEV-21983 Sig 11 in row_make_new_pathname | RENAME TABLE after DISCARD TABLESPACE
-
- Closed
-
-
MDEV-23705 Assertion `table->data_dir_path || !space' failed in row_drop_table_for_mysql on TRUNCATE after DISCARD TABLESPACE
-
- Closed
-
Activity
Field | Original Value | New Value |
---|---|---|
Description |
{code}
CREATE TABLE t (a INT) ENGINE=INNODB; ALTER TABLE t DISCARD TABLESPACE; ALTER TABLE t ENGINE INNODB; {code} Leads to {code} 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) {code} In 10.3, 10.4, 10.5. Not found in 10.2. not found in 10.2. |
{code}
CREATE TABLE t (a INT) ENGINE=INNODB; ALTER TABLE t DISCARD TABLESPACE; ALTER TABLE t ENGINE INNODB; {code} Leads to {code} 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) {code} In 10.3, 10.4, 10.5. Not found in 10.2. |
Description |
{code}
CREATE TABLE t (a INT) ENGINE=INNODB; ALTER TABLE t DISCARD TABLESPACE; ALTER TABLE t ENGINE INNODB; {code} Leads to {code} 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) {code} In 10.3, 10.4, 10.5. Not found in 10.2. |
{code}
CREATE TABLE t (a INT) ENGINE=INNODB; ALTER TABLE t DISCARD TABLESPACE; ALTER TABLE t ENGINE INNODB; {code} Leads to {code} 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) {code} In 10.3, 10.4, 10.5. Not found in 10.2. Result of above queries in 10.2: {code} 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` {code} |
Fix Version/s | 10.3 [ 22126 ] | |
Fix Version/s | 10.4 [ 22408 ] | |
Fix Version/s | 10.5 [ 23123 ] |
Status | Open [ 1 ] | Confirmed [ 10101 ] |
Link |
This issue relates to |
Fix Version/s | 10.5 [ 23123 ] |
Affects Version/s | 10.5 [ 23123 ] |
Assignee | Marko Mäkelä [ marko ] |
Labels | corruption not-10.1 not-10.2 not-10.5 |
Priority | Major [ 3 ] | Critical [ 2 ] |
Link |
This issue relates to |
Status | Confirmed [ 10101 ] | In Progress [ 3 ] |
issue.field.resolutiondate | 2020-09-22 12:17:09.0 | 2020-09-22 12:17:09.511 |
Fix Version/s | 10.2.34 [ 24505 ] | |
Fix Version/s | 10.3.25 [ 24506 ] | |
Fix Version/s | 10.4.15 [ 24507 ] | |
Fix Version/s | 10.5.6 [ 24508 ] | |
Fix Version/s | 10.3 [ 22126 ] | |
Fix Version/s | 10.4 [ 22408 ] | |
Resolution | Fixed [ 1 ] | |
Status | In Progress [ 3 ] | Closed [ 6 ] |
Fix Version/s | 10.5.7 [ 25019 ] |
Fix Version/s | 10.5.6 [ 24508 ] |
Fix Version/s | 10.4.16 [ 25020 ] |
Fix Version/s | 10.4.15 [ 24507 ] |
Fix Version/s | 10.3.26 [ 25021 ] |
Fix Version/s | 10.3.25 [ 24506 ] |
Fix Version/s | 10.2.35 [ 25022 ] |
Fix Version/s | 10.2.34 [ 24505 ] |
Workflow | MariaDB v3 [ 110212 ] | MariaDB v4 [ 157985 ] |
in row_merge_rename_tables_dict@row0merge.cc:
/* Update SYS_TABLESPACES and SYS_DATAFILES if the old table being
renamed is a single-table tablespace, which must be implicitly
renamed along with the table. */
if (err == DB_SUCCESS
&& old_table->space_id) {
/* Make pathname to update SYS_DATAFILES. */
char* tmp_path = row_make_new_pathname(old_table, tmp_name);
old_table->space_id and old_table->space->chain.start->name are used in row_make_new_pathname but only old_table->space_id is checked.
Discarded tables seem to have non-zero space_id and NULL space. Are we missing a NULL check here?