Bug #120353 InnoDB crashes with assertion failure (ut_dbg_assertion_failed) when creating index with ALGORITHM COPY on table with F

Submitted: 27 Apr 11:55 Modified: 29 Apr 11:43
Reporter: Jason Tang Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S2 (Serious)
Version:<=8.0.42-debug OS:Any
Assigned to: CPU Architecture:Any

[27 Apr 11:55] Jason Tang
Description:
Executing a standard sequence of DDL statements (create database → create table with FLOAT column STORAGE DISK and unique constraint → create composite unique index → create secondary index with VISIBLE ALGORITHM COPY) causes the MySQL server to crash immediately with an InnoDB assertion failure.

The crash occurs in the InnoDB index creation function btr_create(), triggering a debug assertion failure (ut_dbg_assertion_failed). The server cannot handle the DDL combination gracefully and aborts directly.

How to repeat:
-- 1. Initialize database
DROP DATABASE IF EXISTS fuzzDatabase1;
CREATE DATABASE fuzzDatabase1;
USE fuzzDatabase1;

-- 2. Modify InnoDB global variable (no impact on crash, included in original test case)
SET GLOBAL innodb_redo_log_capacity = 137438953472;

-- 3. Create table with FLOAT column: STORAGE DISK + UNIQUE NULL
CREATE TABLE IF NOT EXISTS t0(
    c0 DECIMAL, 
    c1 FLOAT STORAGE DISK UNIQUE NULL 
);

-- 4. Create composite unique index (DECIMAL + FLOAT columns)
CREATE UNIQUE INDEX i0 ON t0(c0 ASC, c1);

-- 5. Useless update (no impact on crash)
UPDATE t0 SET c0=DEFAULT;

-- 6. CRASH TRIGGER: Create BTREE index with VISIBLE + ALGORITHM COPY
CREATE INDEX i1 USING BTREE ON t0(c0, c1) VISIBLE ALGORITHM COPY;
[27 Apr 17:25] Shane Bester
Please upload your mysql error log and my.cnf.  I couldn't reproduce this on 8.0.46-debug.

mysql> CREATE DATABASE fuzzDatabase1;
Query OK, 1 row affected (0.01 sec)

mysql> USE fuzzDatabase1;
Database changed
mysql> CREATE TABLE IF NOT EXISTS t0(
    ->     c0 DECIMAL,
    ->     c1 FLOAT STORAGE DISK UNIQUE NULL
    -> );
Query OK, 0 rows affected (0.07 sec)

mysql> CREATE UNIQUE INDEX i0 ON t0(c0 ASC, c1);
Query OK, 0 rows affected (0.09 sec)
Records: 0  Duplicates: 0  Warnings: 0

mysql> UPDATE t0 SET c0=DEFAULT;
Query OK, 0 rows affected (0.00 sec)
Rows matched: 0  Changed: 0  Warnings: 0

mysql> CREATE INDEX i1 USING BTREE ON t0(c0, c1) VISIBLE ALGORITHM COPY;
Query OK, 0 rows affected (0.16 sec)
Records: 0  Duplicates: 0  Warnings: 0

mysql> select version();
+-------------------------+
| version()               |
+-------------------------+
| 8.0.46-commercial-debug |
+-------------------------+
1 row in set (0.00 sec)

-- 
Shane, MySQL Senior Principal Technical Support Engineer
Oracle Corporation
http://dev.mysql.com/
[28 Apr 16:17] Jason Tang
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/8.0/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
2026-04-27T11:46:22Z UTC - mysqld got signal 6 ;
Most likely, you have hit a bug, but this error can also be caused by malfunctioning hardware.
BuildID[sha1]=74c66055f3de3ce92689b61f26f34703359b2316
Thread pointer: 0x7f38c8001050
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 7f39387f79b8 thread_stack 0x100000
/usr/local/mysql/bin/mysqld(my_print_stacktrace(unsigned char const*, unsigned long)+0x4c) [0x55efe32ededc]
/usr/local/mysql/bin/mysqld(print_fatal_signal(int)+0x398) [0x55efe11f72e8]
/usr/local/mysql/bin/mysqld(my_server_abort()+0x10d) [0x55efe11f769d]
/usr/local/mysql/bin/mysqld(my_abort()+0xa) [0x55efe32dd35a]
/usr/local/mysql/bin/mysqld(ut_dbg_assertion_failed(char const*, char const*, unsigned long)+0x2c6) [0x55efe384c9c6]
/usr/local/mysql/bin/mysqld(+0x3df605d) [0x55efe38bd05d]
/usr/local/mysql/bin/mysqld(btr_create(unsigned long, unsigned int, unsigned long, dict_index_t*, mtr_t*)+0x76a) [0x55efe38bca5a]
/usr/local/mysql/bin/mysqld(dict_create_index_tree_in_mem(dict_index_t*, trx_t*)+0x29c) [0x55efe3a3acac]
/usr/local/mysql/bin/mysqld(row_create_index_for_mysql(dict_index_t*, trx_t*, unsigned long const*, dict_table_t*)+0x75c) [0x55efe36a1a3c]
/usr/local/mysql/bin/mysqld(create_index(trx_t*, TABLE const*, unsigned int, char const*, unsigned int, dd::Table const*)+0x1118) [0x55efe33953d8]
/usr/local/mysql/bin/mysqld(create_table_info_t::create_table(dd::Table const*, dd::Table const*)+0x132b) [0x55efe338fe5b]
/usr/local/mysql/bin/mysqld(int innobase_basic_ddl::create_impl<dd::Table>(THD*, char const*, TABLE*, HA_CREATE_INFO*, dd::Table*, bool, bool, bool, unsigned int, unsigned int, dd::Table const*)+0x26c) [0x55efe33985dc]
/usr/local/mysql/bin/mysqld(ha_innobase::create(char const*, TABLE*, HA_CREATE_INFO*, dd::Table*)+0x218) [0x55efe33a4398]
/usr/local/mysql/bin/mysqld(ha_create_table(THD*, char const*, char const*, char const*, HA_CREATE_INFO*, bool, bool, dd::Table*)+0x82f) [0x55efe14561bf]
/usr/local/mysql/bin/mysqld(mysql_alter_table(THD*, char const*, char const*, HA_CREATE_INFO*, Table_ref*, Alter_info*)+0x4661) [0x55efe102c071]
/usr/local/mysql/bin/mysqld(Sql_cmd_create_or_drop_index_base::execute(THD*)+0x2dd) [0x55efe199677d]
/usr/local/mysql/bin/mysqld(mysql_execute_command(THD*, bool)+0x5fbb) [0x55efe0ec29cb]
/usr/local/mysql/bin/mysqld(dispatch_sql_command(THD*, Parser_state*)+0xfa8) [0x55efe0eb90d8]
/usr/local/mysql/bin/mysqld(dispatch_command(THD*, COM_DATA const*, enum_server_command)+0x4792) [0x55efe0eb3d32]
/usr/local/mysql/bin/mysqld(do_command(THD*)+0x9de) [0x55efe0eb6a8e]
/usr/local/mysql/bin/mysqld(+0x170b554) [0x55efe11d2554]
/usr/local/mysql/bin/mysqld(+0x48e64dc) [0x55efe43ad4dc]
/lib/x86_64-linux-gnu/libc.so.6(+0x94ac3) [0x7f3986c60ac3]
/lib/x86_64-linux-gnu/libc.so.6(+0x1268d0) [0x7f3986cf28d0]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (7f38c8202fc0): CREATE INDEX i1 USING BTREE ON t0(c0, c1) VISIBLE ALGORITHM COPY
Connection ID (thread ID): 8
Status: NOT_KILLED
[28 Apr 16:19] Jason Tang
POC:

DROP DATABASE IF EXISTS fuzzDatabase1;
CREATE DATABASE fuzzDatabase1;
USE fuzzDatabase1;
SET GLOBAL innodb_redo_log_capacity = 137438953472;
CREATE TABLE IF NOT EXISTS t0(c0 DECIMAL, c1 FLOAT  STORAGE DISK UNIQUE NULL ) ;
CREATE UNIQUE INDEX i0 ON t0(c0 ASC, c1);
UPDATE t0 SET c0=DEFAULT;
CREATE INDEX i1 USING BTREE ON t0(c0, c1) VISIBLE ALGORITHM COPY;
[29 Apr 11:43] Shane Bester
Hello!

I cannot repeat this on linux on 8.0.45-debug either.

However, I notice you've changed the version:

-Version:          8.0.45+
+Version:          <=8.0.42-debug

Still not able to reproduce this on 8.0.42-debug.

$ mysql -uroot -h127.0.0.1 -P3333
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 8.0.42-debug (Built on 24 May 2025,  with gcc (GCC) 11.5.0 20240719 (Red Hat 11.5.0-5.0.1))

Copyright (c) 2000, 2025, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>
CREATE TABLE IF NOT EXISTS t0(c0 DECIMAL, c1 FLOAT  STORAGE DISK UNIQUE NULL ) ;
mysql> DROP DATABASE IF EXISTS fuzzDatabase1;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> CREATE DATABASE fuzzDatabase1;
Query OK, 1 row affected (0.00 sec)

mysql> USE fuzzDatabase1;
Database changed
mysql> SET GLOBAL innodb_redo_log_capacity = 137438953472;
Query OK, 0 rows affected (0.02 sec)

mysql> CREATE TABLE IF NOT EXISTS t0(c0 DECIMAL, c1 FLOAT  STORAGE DISK UNIQUE NULL ) ;
Query OK, 0 rows affected (0.06 sec)

mysql> CREATE UNIQUE INDEX i0 ON t0(c0 ASC, c1);
Query OK, 0 rows affected (0.08 sec)
Records: 0  Duplicates: 0  Warnings: 0

mysql> UPDATE t0 SET c0=DEFAULT;
Query OK, 0 rows affected (0.00 sec)
Rows matched: 0  Changed: 0  Warnings: 0

mysql> CREATE INDEX i1 USING BTREE ON t0(c0, c1) VISIBLE ALGORITHM COPY;
Query OK, 0 rows affected (0.20 sec)
Records: 0  Duplicates: 0  Warnings: 0

Older versions don't get fixed.  Suggest you please try 8.4.9 or newer.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.041 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.