Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
5.5(EOL), 10.0(EOL), 10.1(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5, 10.6
Description
Many InnoDB data dictionary cache operations require that the table name be copied so that it will be NUL terminated. The table name that would be read from SYS_TABLES.NAME is not guaranteed to be NUL-terminated.
Let us refactor the code so that such unnecessary copying can be avoided and the table name can be passed as const span<const char>& to those functions that need it.
This will also change some error reporting, like this:
@@ -2314,8 +2317,10 @@ fil_ibd_open(
|
First, bail out if no tablespace files were found. */
|
if (valid_tablespaces_found == 0) {
|
os_file_get_last_error(true);
|
- ib::error() << "Could not find a valid tablespace file for `"
|
- << tablename << "`. " << TROUBLESHOOT_DATADICT_MSG;
|
+ sql_print_error("InnoDB: Could not find a valid tablespace"
|
+ " file for %.*s. %s",
|
+ static_cast<int>(name.size()), name.data(),
|
+ TROUBLESHOOT_DATADICT_MSG);
|
goto corrupted;
|
}
|
if (!validate) { |
The user-visible change is that instead of a string like `test`.`t1` the internal name `test/t1` will be reported.
Attachments
Issue Links
- blocks
-
MDEV-25506 Atomic DDL: .frm file is removed and orphan InnoDB tablespace is left behind upon crash recovery
- Closed
- causes
-
MDEV-25996 sux_lock::s_lock(): Assertion !have_s() failed on startup
- Closed
-
MDEV-27219 Some error messages might report table names incorrectly on LLP64 platforms
- Closed
-
MDEV-28264 Heap-use-after-free error while loading the table in dict_sys_t::load_table()
- Open