|
--source include/have_innodb.inc
|
--source include/have_binlog_format_mixed.inc
|
CREATE TABLE t1 (a tinyBLOB) ENGINE=InnoDB;
|
SET SESSION pseudo_slave_mode=ON;
|
SET default_storage_engine=InnoDB,default_storage_engine='HEAP',GLOBAL default_storage_engine='MERGE';
|
XA START 'a';
|
INSERT INTO t1 VALUES (1);
|
XA END 'a';
|
XA PREPARE 'a';
|
ALTER TABLE t1 ENGINE=MERGE UNION (t_not_exists,t2);
|
DROP TABLE t1;
|
CREATE TABLE t1 (c1 SMALLINT,c2 INT,c3 BINARY (1));
|
ALTER TABLE t1 ENGINE=InnoDB;
|
Leads to:
|
10.6.16 6f091434f313996436b4f01d7e7d62a9f3786958 (Debug)
|
mariadbd: /test/10.6_dbg/storage/innobase/row/row0mysql.cc:2695: dberr_t row_rename_table_for_mysql(const char*, const char*, trx_t*, bool): Assertion `err != DB_DUPLICATE_KEY' failed.
|
|
10.6.16 6f091434f313996436b4f01d7e7d62a9f3786958 (Debug)
|
Core was generated by `/test/MD311023-mariadb-10.6.16-linux-x86_64-dbg/bin/mariadbd --no-defaults --co'.
|
Program terminated with signal SIGABRT, Aborted.
|
#0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=22694742533696)
|
at ./nptl/pthread_kill.c:44
|
[Current thread is 1 (Thread 0x14a408112640 (LWP 3954235))]
|
(gdb) bt
|
#0 __pthread_kill_implementation (no_tid=0, signo=6, threadid=22694742533696) at ./nptl/pthread_kill.c:44
|
#1 __pthread_kill_internal (signo=6, threadid=22694742533696) at ./nptl/pthread_kill.c:78
|
#2 __GI___pthread_kill (threadid=22694742533696, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
|
#3 0x000014a41ce42476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
|
#4 0x000014a41ce287f3 in __GI_abort () at ./stdlib/abort.c:79
|
#5 0x000014a41ce2871b in __assert_fail_base (fmt=0x14a41cfdd150 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55a2c6c07a94 "err != DB_DUPLICATE_KEY", file=0x55a2c6c05bc8 "/test/10.6_dbg/storage/innobase/row/row0mysql.cc", line=2695, function=<optimized out>) at ./assert/assert.c:92
|
#6 0x000014a41ce39e96 in __GI___assert_fail (assertion=0x55a2c6c07a94 "err != DB_DUPLICATE_KEY", file=0x55a2c6c05bc8 "/test/10.6_dbg/storage/innobase/row/row0mysql.cc", line=2695, function=0x55a2c6c06ab0 "dberr_t row_rename_table_for_mysql(const char*, const char*, trx_t*, bool)") at ./assert/assert.c:101
|
#7 0x000055a2c6561ed4 in row_rename_table_for_mysql (old_name=<optimized out>, old_name@entry=0x14a40810c6d0 "test/#sql-alter-3c52c8-5", new_name=new_name@entry=0x14a40810c4d0 "test/t1", trx=trx@entry=0x14a403c01c80, use_fk=use_fk@entry=true) at /test/10.6_dbg/storage/innobase/row/row0mysql.cc:2695
|
#8 0x000055a2c63e9990 in innobase_rename_table (trx=trx@entry=0x14a403c01c80, from=from@entry=0x14a40810d1e0 "./test/#sql-alter-3c52c8-5", to=to@entry=0x14a40810d3e0 "./test/t1", use_fk=use_fk@entry=true) at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:13825
|
#9 0x000055a2c63f2ce9 in ha_innobase::rename_table (this=<optimized out>, from=<optimized out>, to=<optimized out>) at /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:14247
|
#10 0x000055a2c606f45c in handler::ha_rename_table (this=this@entry=0x14a3d00152a0, from=from@entry=0x14a40810d1e0 "./test/#sql-alter-3c52c8-5", to=to@entry=0x14a40810d3e0 "./test/t1") at /test/10.6_dbg/sql/handler.cc:5394
|
#11 0x000055a2c5e672f4 in mysql_rename_table (base=base@entry=0x55a2c963acc8, old_db=old_db@entry=0x14a40810f4a0, old_name=old_name@entry=0x14a40810f4d0, new_db=new_db@entry=0x14a40810f4a0, new_name=new_name@entry=0x14a40810f4c0, id=id@entry=0x14a40810f4f0, flags=1) at /test/10.6_dbg/sql/sql_table.cc:5007
|
#12 0x000055a2c5e7c999 in mysql_alter_table (thd=thd@entry=0x14a3d0000d58, new_db=new_db@entry=0x14a3d00059e0, new_name=new_name@entry=0x14a3d0005e38, create_info=create_info@entry=0x14a4081102e0, table_list=<optimized out>, table_list@entry=0x14a3d00134d0, recreate_info=recreate_info@entry=0x14a408110150, alter_info=<optimized out>, order_num=<optimized out>, order=<optimized out>, ignore=<optimized out>, if_exists=<optimized out>) at /test/10.6_dbg/sql/sql_table.cc:10791
|
#13 0x000055a2c5efe30e in Sql_cmd_alter_table::execute (this=<optimized out>, thd=0x14a3d0000d58) at /test/10.6_dbg/sql/sql_alter.cc:672
|
#14 0x000055a2c5dad762 in mysql_execute_command (thd=thd@entry=0x14a3d0000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.6_dbg/sql/sql_parse.cc:6026
|
#15 0x000055a2c5daf30a in mysql_parse (thd=thd@entry=0x14a3d0000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14a4081111f0) at /test/10.6_dbg/sql/sql_parse.cc:8050
|
#16 0x000055a2c5db1680 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14a3d0000d58, packet=packet@entry=0x14a3d000b049 "", packet_length=packet_length@entry=28, blocking=blocking@entry=true) at /test/10.6_dbg/sql/sql_class.h:241
|
#17 0x000055a2c5db379d in do_command (thd=0x14a3d0000d58, blocking=blocking@entry=true) at /test/10.6_dbg/sql/sql_parse.cc:1409
|
#18 0x000055a2c5ef71d9 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55a2c9a859a8, put_in_cache=put_in_cache@entry=true) at /test/10.6_dbg/sql/sql_connect.cc:1416
|
#19 0x000055a2c5ef74ce in handle_one_connection (arg=arg@entry=0x55a2c9a859a8) at /test/10.6_dbg/sql/sql_connect.cc:1318
|
#20 0x000055a2c6344e16 in pfs_spawn_thread (arg=0x55a2c9b12a08) at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
|
#21 0x000014a41ce94ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
|
#22 0x000014a41cf26a40 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
|
Bug confirmed present in:
MariaDB: 10.6.16 (dbg), 10.9.8 (dbg), 10.10.7 (dbg), 10.11.6 (dbg), 11.0.4 (dbg), 11.1.3 (dbg), 11.2.2 (dbg), 11.3.0 (dbg), 11.4.0 (dbg)
Bug (or feature/syntax) confirmed not present in:
MariaDB: 10.4.32 (dbg), 10.4.32 (opt), 10.5.23 (dbg), 10.5.23 (opt), 10.6.16 (opt), 10.9.8 (opt), 10.10.7 (opt), 10.11.6 (opt), 11.0.4 (opt), 11.1.3 (opt), 11.2.2 (opt), 11.3.0 (opt), 11.4.0 (opt)
MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.40 (dbg), 8.0.33 (dbg), 8.0.33 (opt)
Additionally, the ALTER TABLE takes a long time (~50 sec) to complete:
|
10.6.16 6f091434f313996436b4f01d7e7d62a9f3786958 (Debug)
|
10.6.16-dbg>ALTER TABLE t1 ENGINE=MERGE UNION (t_not_exists,t2);
|
Query OK, 0 rows affected, 1 warning (50.013 sec)
|
Records: 0 Duplicates: 0 Warnings: 1
|
It should also be noted that MySQL 8.0 hang on the query even longer:
|
MySQL 8.0.33 ea7087d885006918ad54458e7aad215b1650312c (Optimized and Debug)
|
Command: Query
|
Time: 614
|
State: Waiting for table metadata lock
|
Info: ALTER TABLE t1 ENGINE=MERGE UNION (t_not_exists,t2)
|
|