[MDEV-31523] Using two temporary tables in OPTIMIZE TABLE lead to crash Created: 2023-06-22 Updated: 2024-01-12 Resolved: 2024-01-12 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | OTHER |
| Affects Version/s: | 11.2 |
| Fix Version/s: | 10.4.33, 10.5.24, 10.6.17, 10.11.7, 11.0.5, 11.1.4, 11.2.3 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Ramesh Sivaraman | Assignee: | Oleksandr Byelkin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Leads to
Setup Compiled with GCC 9.4.0
|
| Comments |
| Comment by Ramesh Sivaraman [ 2023-06-28 ] | |||||||||||||||||||||||||||||||
|
Another test case
Leads to
| |||||||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2023-10-12 ] | |||||||||||||||||||||||||||||||
|
The second case is somehow destroyed temporary table list by thd->close_unused_temporary_table_instances(tables); in mysql_admin of previous statement so there id NULL pointer instead of t1 in the list of temporary tables | |||||||||||||||||||||||||||||||
| Comment by Julien Fritsch [ 2023-12-05 ] | |||||||||||||||||||||||||||||||
|
Automated message: | |||||||||||||||||||||||||||||||
| Comment by JiraAutomate [ 2023-12-05 ] | |||||||||||||||||||||||||||||||
|
Automated message: | |||||||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2024-01-08 ] | |||||||||||||||||||||||||||||||
|
It is nothing to do with memory stiniser | |||||||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2024-01-10 ] | |||||||||||||||||||||||||||||||
|
It is not repeatable before 11.2 because SHOW TABLES do not show temporary table before 11.2 | |||||||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2024-01-10 ] | |||||||||||||||||||||||||||||||
|
It is clash of anel patch of 0b7d1748ad3be55b50e843ee96ec6237d3d5e0cd and monty patch of c8b5fa4afc6c233101b8163ef19c1abc1be0373d . First add showing temporary tables in SHOW TABLES the second I do not understand in part of moving THD::close_unused_temporary_table_instances call. | |||||||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2024-01-10 ] | |||||||||||||||||||||||||||||||
|
ramesh it has nothing to do not only with UBSAN but also with prepared statements:
| |||||||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2024-01-10 ] | |||||||||||||||||||||||||||||||
|
It looks like only OPTIMIZE TABLE affected. There is no way to see temporary tables created by user before 11.2, so versions before 11.2 is not affected. SELECT opens its tables in any case so it is not afected. | |||||||||||||||||||||||||||||||
| Comment by Oleksandr Byelkin [ 2024-01-11 ] | |||||||||||||||||||||||||||||||
|
| |||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2024-01-11 ] | |||||||||||||||||||||||||||||||
|
f807a9f874a is ok to push |