Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.11, 11.4, 11.8, 12.3, 13.1
-
None
Description
A Mroonga table in wrapper mode over InnoDB cannot be converted to plain InnoDB. Mroonga sets neither HA_FILE_BASED nor HA_REUSES_FILE_NAMES, so mysql_alter_table() sets engine_changed and does not rename the old table to a backup name. The wrapped InnoDB table keeps the name t1, and renaming the new InnoDB table from #sql-alter-... to t1 collides with it. MDEV-24422 added HA_REUSES_FILE_NAMES for CONNECT only.
--source include/have_innodb.inc
|
INSTALL SONAME 'ha_mroonga'; |
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=Mroonga COMMENT='ENGINE "InnoDB"'; |
INSERT INTO t1 VALUES (1); |
ALTER TABLE t1 ENGINE=InnoDB COMMENT=''; |
SHOW CREATE TABLE t1; |
DROP TABLE t1; |
UNINSTALL SONAME 'ha_mroonga'; |
10.11.20-MariaDB-asan-debug-log source revision: cec3fd8a95e04947bc8981878f8826c1d54fa6b6
|
mariadbd: /10.11/src/storage/innobase/row/row0mysql.cc:2689: dberr_t row_rename_table_for_mysql(const char*, const char*, trx_t*, rename_fk): Assertion `err != DB_DUPLICATE_KEY' failed.
|
 |
#11 0x0000733c2d22881b in __assert_fail_base (fmt=0x733c2d3d1208 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x56ef7b0cd4e0 "err != DB_DUPLICATE_KEY", file=file@entry=0x56ef7b0c59a0 "/10.11/src/storage/innobase/row/row0mysql.cc", line=line@entry=2689, function=function@entry=0x56ef7b0cd1c0 "dberr_t row_rename_table_for_mysql(const char*, const char*, trx_t*, rename_fk)") at ./assert/assert.c:96
|
#12 0x0000733c2d23b517 in __assert_fail (assertion=0x56ef7b0cd4e0 "err != DB_DUPLICATE_KEY", file=0x56ef7b0c59a0 "/10.11/src/storage/innobase/row/row0mysql.cc", line=2689, function=0x56ef7b0cd1c0 "dberr_t row_rename_table_for_mysql(const char*, const char*, trx_t*, rename_fk)") at ./assert/assert.c:105
|
#13 0x000056ef7a20dd3d in row_rename_table_for_mysql (old_name=<optimized out>, old_name@entry=0x6b3c137962a0 "test/#sql-alter-1c3259-4", new_name=new_name@entry=0x6b3c13796060 "test/t1", trx=trx@entry=0x733c234d1f40, fk=fk@entry=RENAME_ALTER_COPY) at /10.11/src/storage/innobase/row/row0mysql.cc:2689
|
#14 0x000056ef79e44e0d in innobase_rename_table (trx=trx@entry=0x733c234d1f40, from=from@entry=0x6b3c1385e140 "./test/#sql-alter-1c3259-4", to=to@entry=0x6b3c1385e380 "./test/t1", fk=fk@entry=RENAME_ALTER_COPY) at /10.11/src/storage/innobase/handler/ha_innodb.cc:14098
|
#15 0x000056ef79e67335 in ha_innobase::rename_table (this=<optimized out>, from=<optimized out>, to=<optimized out>) at /10.11/src/storage/innobase/handler/ha_innodb.cc:14555
|
#16 0x000056ef795ff403 in handler::ha_rename_table (this=this@entry=0x52d0000a3220, from=from@entry=0x6b3c1385e140 "./test/#sql-alter-1c3259-4", to=to@entry=0x6b3c1385e380 "./test/t1") at /10.11/src/sql/handler.cc:5623
|
#17 0x000056ef79055200 in mysql_rename_table (base=base@entry=0x515000002b18, old_db=old_db@entry=0x6b3c13ac1c50, old_name=old_name@entry=0x6b3c13ac1c80, new_db=new_db@entry=0x6b3c13ac1c50, new_name=new_name@entry=0x6b3c13ac1c70, id=id@entry=0x6b3c13ac1ca0, flags=<optimized out>) at /10.11/src/sql/sql_table.cc:5609
|
#18 0x000056ef79098567 in mysql_alter_table (thd=thd@entry=0x52c0001f0218, new_db=<optimized out>, new_name=new_name@entry=0x52c0001f5430, create_info=create_info@entry=0x6b3c1381e2c0, table_list=<optimized out>, table_list@entry=0x52d0000a0568, recreate_info=recreate_info@entry=0x6b3c1381e050, alter_info=<optimized out>, order_num=<optimized out>, order=<optimized out>, ignore=<optimized out>, if_exists=<optimized out>) at /10.11/src/sql/sql_table.cc:11983
|
#19 0x000056ef7922804f in Sql_cmd_alter_table::execute (this=<optimized out>, thd=0x52c0001f0218) at /10.11/src/sql/sql_alter.cc:688
|
#20 0x000056ef78e06466 in mysql_execute_command (thd=thd@entry=0x52c0001f0218, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /10.11/src/sql/sql_parse.cc:6199
|
#21 0x000056ef78e0807b in mysql_parse (thd=thd@entry=0x52c0001f0218, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x6b3c1391c150) at /10.11/src/sql/sql_parse.cc:8219
|
#22 0x000056ef78e0be4b in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x52c0001f0218, packet=packet@entry=0x52900028a219 "", packet_length=packet_length@entry=39, blocking=blocking@entry=true) at /10.11/src/sql/sql_parse.cc:1924
|
#23 0x000056ef78e10838 in do_command (thd=thd@entry=0x52c0001f0218, blocking=blocking@entry=true) at /10.11/src/sql/sql_parse.cc:1434
|
#24 0x000056ef7920e2f2 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x508000014938, put_in_cache=put_in_cache@entry=true) at /10.11/src/sql/sql_connect.cc:1501
|
#25 0x000056ef7920e7cb in handle_one_connection (arg=arg@entry=0x508000014938) at /10.11/src/sql/sql_connect.cc:1413
|
#26 0x000056ef79c71123 in pfs_spawn_thread (arg=arg@entry=0x517000008598) at /10.11/src/storage/perfschema/pfs.cc:2201
|
#27 0x0000733c2e25ea42 in asan_thread_start (arg=0x6b3c147fe000) at ../../../../src/libsanitizer/asan/asan_interceptors.cpp:234
|
#28 0x0000733c2d29cb84 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:447
|
On non-debug builds the ALTER fails and the table stays intact:
ALTER TABLE t1 ENGINE=InnoDB COMMENT='';
|
ERROR 1050 (42S01): Table './test/t1' already exists
|
SHOW WARNINGS;
|
Error 1050 Table './test/t1' already exists
|
Error 1025 Error on rename of './test/#sql-alter-1a81d7-8' to './test/t1' (errno: 168 "Unknown (generic) error from engine")
|
Attachments
Issue Links
- relates to
-
MDEV-24422 Server crashes in GetTypeID / ha_connect::GetRealType upon altering table engine
-
- Closed
-
-
MDEV-25119 Test case for former ER_TABLE_EXISTS_ERROR or Assertion `err != DB_DUPLICATE_KEY' upon ALTER with FK and partitioning
-
- Stalled
-
-
MDEV-30992 Assertion err != DB_DUPLICATE_KEY failure upon concurrent ALTER
-
- Open
-