Bug #121003 8.0 to 8.4 upgrade fails with `MY-010020 Data Dictionary initialization failed`
Submitted: 23 Jul 22:52
Reporter: Sanyam Jain Email Updates:
Status: Open Impact on me:
None 
Category:MySQL Server: Data Dictionary Severity:S3 (Non-critical)
Version:8.4.9 (upgrading in place from 8.0.40) OS:Linux
Assigned to: CPU Architecture:ARM (aarch64)
Tags: check_table_funs, data dictionary, upgrade

[23 Jul 22:52] Sanyam Jain
Description:
Upgraded a MySQL 8.0.40 server in place to 8.4.9, where the 8.0.40 instance had 10 schemas, each containing one stored procedure that fails to compile during early server bootstrap, plus a mix of ordinary InnoDB tables.

The upgrade aborts with `MY-010020 Data Dictionary initialization failed`, after logging `MY-013135`/`MY-014078` for every `CHECK`-constrained table in every schema that contains the stored procedure. The server does not come up on 8.4.9.

How to repeat:
Reproduced on two independent source builds (release and Debug+ASAN), same result both times.

1. Build MySQL 8.0.40 and MySQL 8.4.9 from source (or use official binaries)
2. Initialize a data directory on 8.0.40.
3. Create a schema with the following objects:
   - One stored procedure with `CREATE TABLE` containing `ENGINE=Memory`. 
   - 5 InnoDB tables that will fail `check_table_funs()`'s validation (any table with an integer `CHECK` constraint is enough)

Example SQL schema:

   CREATE DATABASE test_schema_1;

   DELIMITER //
   CREATE PROCEDURE test_schema_1.cleanup_proc()
   BEGIN
     CREATE TEMPORARY TABLE IF NOT EXISTS temp_ids (id BIGINT PRIMARY KEY)
       ENGINE=Memory;
     DROP TEMPORARY TABLE IF EXISTS temp_ids;
   END //
   DELIMITER ;

   CREATE TABLE test_schema_1.tbl_check_1 (
     id BIGINT NOT NULL AUTO_INCREMENT,
     c1 INT UNSIGNED NULL,
     PRIMARY KEY (id),
     CONSTRAINT tbl_check_1_chk CHECK ((c1 >= 0))
   ) ENGINE=InnoDB;
   -- tbl_check_2 .. tbl_check_5: identical shape, name only differs.

3. Cleanly shut down 8.0.40.
4. Start the 8.4.9 binary against the same data directory triggering the in-place data-dictionary upgrade.
5. Upgrade fails with the following error:
 
2026-07-12T06:57:54.532521Z 0 [System] [MY-015015] [Server] MySQL Server - start.
2026-07-12T06:57:54.722943Z 0 [System] [MY-010116] [Server] /opt/build/rel/runtime_output_directory/mysqld (mysqld 8.4.9) starting as process 62697
2026-07-12T06:57:54.731845Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2026-07-12T06:57:55.014454Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2026-07-12T06:57:55.031864Z 1 [System] [MY-011090] [Server] Data dictionary upgrading from version '80023' to '80300'.
2026-07-12T06:57:55.430320Z 1 [ERROR] [MY-013135] [Server] Incorrect information in file: './ilv_01/t_02_fail.frm'
2026-07-12T06:57:55.430357Z 1 [Warning] [MY-014078] [Server] Can not open table `ilv_01`.`t_02_fail`; functions in constraints, partitions, or virtual columns may have failed.
..
..
..
2026-07-12T06:57:55.599689Z 1 [ERROR] [MY-013135] [Server] Incorrect information in file: './ilv_10/t_10_fail.frm'
2026-07-12T06:57:55.599706Z 1 [Warning] [MY-014078] [Server] Can not open table `ilv_10`.`t_10_fail`; functions in constraints, partitions, or virtual columns may have failed.
2026-07-12T06:57:55.601882Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2026-07-12T06:57:55.601908Z 0 [ERROR] [MY-010119] [Server] Aborting
2026-07-12T06:57:56.742005Z 0 [System] [MY-010910] [Server] /opt/build/rel/runtime_output_directory/mysqld: Shutdown complete (mysqld 8.4.9)  Source distribution.
2026-07-12T06:57:56.742070Z 0 [System] [MY-015016] [Server] MySQL Server - end.

Suggested fix:
Workaround:
Dropping the stored procedure allows upgrade to succeed.