Bug #88043 upgrade to 8.0 crashes: Assertion failure: dict0dict.cc:1331:table2 == NULL
Submitted: 10 Oct 2017 8:56 Modified: 10 Aug 2018 7:37
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Data Dictionary Severity:S2 (Serious)
Version:8.0.3 OS:Any
Assigned to: CPU Architecture:Any

[10 Oct 2017 8:56] Shane Bester
Description:
First 8.0 startup on 5.7 datadir, we see some fulltext problems, then a crash...

[Note] [000000] InnoDB: Loading buffer pool(s) from E:\mysql-5.7.19-winx64\data\ib_buffer_pool
[Note] [003960] Created Data Dictionary for upgrade
[ERROR] [000000] InnoDB: Cannot rename '.\test\FTS_0000000000001cb5_BEING_DELETED.ibd' to '.\test\fts_00000000000020b5_being_deleted.ibd' for space ID 7333 because the target file exists. Remove the target file and try again.
[ERROR] [004390] Error in fixing SE data for test.t0005
[Note] [000000] InnoDB: Buffer pool(s) load completed at 171010 10:39:33
[ERROR] [000000] InnoDB: Cannot rename '.\test\FTS_0000000000001dcd_BEING_DELETED.ibd' to '.\test\fts_00000000000021cd_being_deleted.ibd' for space ID 7613 because the target file exists. Remove the target file and try again.
[ERROR] [004390] Error in fixing SE data for test.t0139
[ERROR] [000000] InnoDB: Assertion failure: dict0dict.cc:1331:table2 == NULL
InnoDB: thread 29604
InnoDB: We intentionally generate a memory trap.

mysqld-debug.exe!my_sigabrt_handler()[my_thr_init.cc:418]
  ucrtbased.dll!raise()
  ucrtbased.dll!abort()
mysqld-debug.exe!ut_dbg_assertion_failed()[ut0dbg.cc:61]
mysqld-debug.exe!dict_table_add_to_cache()[dict0dict.cc:1331]
mysqld-debug.exe!dict_load_table_one()[dict0load.cc:2676]
mysqld-debug.exe!dict_load_table()[dict0load.cc:2367]
mysqld-debug.exe!dict_table_get_low()[dict0priv.ic:59]
mysqld-debug.exe!dict_load_foreigns()[dict0load.cc:3280]
mysqld-debug.exe!dict_load_table_one()[dict0load.cc:2738]
mysqld-debug.exe!dict_load_table()[dict0load.cc:2367]
mysqld-debug.exe!dict_table_open_on_name()[dict0dict.cc:1163]
mysqld-debug.exe!fts_upgrade_rename_table()[fts0fts.cc:7168]
mysqld-debug.exe!fts_upgrade_aux_tables()[fts0fts.cc:7238]
mysqld-debug.exe!dd_upgrade_table()[dict0upgrade.cc:954]
mysqld-debug.exe!ha_innobase::upgrade_table()[ha_innodb.cc:13901]
mysqld-debug.exe!handler::ha_upgrade_table()[handler.cc:8767]
mysqld-debug.exe!dd::upgrade::set_se_data_for_user_tables()[table.cc:1397]
mysqld-debug.exe!dd::upgrade::migrate_table_to_dd()[table.cc:1913]
mysqld-debug.exe!dd::upgrade::migrate_all_frm_to_dd()[table.cc:2016]
mysqld-debug.exe!dd::upgrade::fill_dd_and_finalize()[upgrade.cc:1312]
mysqld-debug.exe!handle_bootstrap()[bootstrap.cc:336]
mysqld-debug.exe!pfs_spawn_thread()[pfs.cc:2989]
mysqld-debug.exe!win_thread_start()[my_thread.cc:42]
  ucrtbased.dll!_register_onexit_function()
  ucrtbased.dll!_register_onexit_function()
ernel32.dll!BaseThreadInitThunk()
tdll.dll!RtlUserThreadStart()

How to repeat:
On clean 5.7,  import the attached test.sql to create the schema
Shutdown 5.7
Start 8.0 on the datadir.
[10 Oct 2017 8:57] MySQL Verification Team
create the schema

Attachment: test.sql (application/octet-stream, text), 1.40 MiB.

[10 Oct 2017 9:00] MySQL Verification Team
Debug build crashed as above.  Release build fails to start:

[ERROR] [004390] Error in fixing SE data for test.t0139
[Note] [000000] InnoDB: Buffer pool(s) load completed at 171010 10:59:12
[ERROR] [003636] Failed to Populate DD tables.
[ERROR] [003742] Aborting
[Note] [000000] InnoDB: FTS optimize thread exiting.
[Note] [003743] Binlog end
[13 Oct 2017 13:57] MySQL Verification Team
Verified again by importing test.sql into 5.7.19, then shutting it down.
Then starting 8.0.3 on the datadir.  Linux build crashes, here it outputs:

https://pastebin.com/sgKM4piM
[13 Oct 2017 14:23] MySQL Verification Team
Stack trace "bt" and "bt full" output of 8.0.3 release build:

https://pastebin.com/raw/E0EV2eRt
[10 Aug 2018 7:37] Jon Stephens
This is a duplicate of BUG#88042.