Details
-
Bug
-
Status: Closed (View Workflow)
-
Blocker
-
Resolution: Fixed
-
10.5.28, 10.11.11, 11.4.5, 11.7.2, 11.8.1
Description
When the server starts up it looks in --tmpdir for leftover .FRM files from temporary tables (eg. from a prior crash). After the latest release, if any such .frm files are found and opened successfully, the server will crash on nullpointer access and will not be able to start until the .frm files have been manually removed from --tmpdir or the server downgraded to an earlier release without the problem.
The bug is introduced with this patch from MDEV-35840:
commit 78157c4765f2c086fabe183d51d7734ecffdbdd8
|
Author: Yuchen Pei <ycp@mariadb.com>
|
Date: Tue Jan 14 17:47:08 2025 +1100
|
|
MDEV-35840 Eliminate -warray-bounds triggered by TABLE_SHARE::db_type()
|
|
The warnings are triggered with -O3
|
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
|
index 5c03ba3d42d..aaa86e7bfa0 100644
|
--- a/sql/sql_base.cc
|
+++ b/sql/sql_base.cc
|
@@ -8953,8 +8953,9 @@ my_bool mysql_rm_tmp_tables(void)
|
memcpy(path_copy, path, path_len - ext_len);
|
path_copy[path_len - ext_len]= 0;
|
init_tmp_table_share(thd, &share, "", 0, "", path_copy);
|
+ handlerton *ht= share.db_type();
|
if (!open_table_def(thd, &share))
|
- share.db_type()->drop_table(share.db_type(), path_copy);
|
+ ht->drop_table(share.db_type(), path_copy);
|
free_table_share(&share);
|
}
|
/*
|
The share.db_type() is set by the call to open_table_def(), so after the patch the ht will always be NULL and the code will crash whenever open_table_def() returns 0.
This regression is quite severe as it leaves the server in a state where it cannot be started and with no indication to the user what is needed to resolve the problem. So the fix will need to go into 10.5.
Attachments
Issue Links
- is caused by
-
MDEV-35840 gcc 12/13: -Warray-bounds when dereferencing value returned from TABLE_SHARE::db_type()
-
- Closed
-
Thanks for the review - pushed 0fa141ebb4639c5c6c4b5d990f448a932fd095a8 to 10.5