[MDEV-23000] Ensure we get a warning from THD::drop_temporary_table() in case of disk errors Created: 2020-06-24  Updated: 2023-03-08  Resolved: 2023-03-08

Status: Closed
Project: MariaDB Server
Component/s: Data Definition - Temporary
Affects Version/s: None
Fix Version/s: 10.11.3, 11.0.2, 10.5.20, 10.6.13, 10.8.8, 10.9.6, 10.10.4

Type: Bug Priority: Minor
Reporter: Michael Widenius Assignee: Daniel Black
Resolution: Fixed Votes: 0
Labels: beginner-friendly

Issue Links:
Relates
relates to MDEV-11412 Ensure that table is truly dropped wh... Closed

 Description   

The call stack for DROP TEMPORARY TABLE is:

THD::drop_temporary_table()
mysql_rm_table_no_locks()
free_tmp_table_share()
THD::free_tmp_table_share()
THD::rm_temporary_table()
ha_delete_table()

The problem is that free_temp_table_share() is a void function and thus the caller doesn't know if ha_delete_table() failed or not.

How to repeat:
in gdb, put a breakpoint at: maria_delete_table()
Execute in command tool:
create temporary table t1 (a int) engine=aria;
drop temporary table t1;



 Comments   
Comment by Daniel Black [ 2023-03-02 ]

MDEV-11412 in 10.5 is when THD::rm_temporary_table started emitting warnings about deleted files errors (except ENOENT).

As future feature:
If we could check O_TMPFILE_works from MDEV-15584 / 3edac3f18d2d74f68e6f9f9b41e5d05a5c8ca9c5 we wouldn't even need to delete it.

Comment by Daniel Black [ 2023-03-08 ]

Thanks Weijun Huang for another great fix.

Generated at Thu Feb 08 09:19:06 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.