Bug #120404 MySQL 8.0.39/8.0.42/8.4.8 crashed due to Assertion failure error when running TRUNCATE
Submitted: 5 May 14:57 Modified: 15 May 12:08
Reporter: IVAN HO Email Updates:
Status: Open Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S2 (Serious)
Version:8.0.39/8.0.42/8.4.8 OS:Red Hat (8.10)
Assigned to: CPU Architecture:x86

[5 May 14:57] IVAN HO
Description:
I opened Bug #120156 on Mar-2026.
https://bugs.mysql.com/bug.php?id=120156

The bug is about mysql 8.0/8.4 using symlink for databases will crash when running TRUNCATE TABLE.
I summarize the test case in the attached file "Truncate Table Test Case.html"

When database symlink is used, the flag value of the table is 97.
After optimize table, flag value is changed to 33.
But after mysql is restarted, flag value is reverted back to 97.
When flag value is 97, truncate table will crash mysql.

Finally, we use the databases without symlinks, run optimize table, the issue is resolved.

Actions:
- Stop mysql
- Remove db symlink, use local db instead.
- Start mysql
- Run optimize table
- Restart mysql again
- Run truncate table (do not crash)

We found that 8.4.9 is released on 2026-04-21.
https://dev.mysql.com/doc/relnotes/mysql/8.4/en/news-8-4-9.html

It states :
Fixed an issue related to TRUNCATE TABLE. (Bug #38169053)

I tried upgrading to 8.4.9 to reproduce the above case.

Upgrade to 8.4.9 
- flag is still 97, truncate crash
- run optimize table, flag change to 33
- restart DB, flag keeps 33, truncate OK.
- create new table on DB with symlink, flag=33, truncate OK.

It seems that the previous bug is fixed but we still need to run optimize to all existing tables.
We hope the next patch can completely solve the bug without running optimize table to all existing tables.

The situation is that some of our customers have huge size tables. Running optimize table will cause impact on their business. Besides, some huge size tables are over 50% of the total disk size. Disk will be full during optimize process.

How to repeat:
See the attachment.
[15 May 12:08] IVAN HO
any updates?