mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Fix for bug #44738 "fill_schema_table_from_frm() opens tables without
lowercasing table name". In lower_case_table_names > 0 mode some queries to I_S left entries with incorrect key in table definition cache. This wasted memory and caused some of the further queries to I_S to produce stale results in cases when table definition was changed by a DDL statement. Also in combination with similar problem in CREATE TABLE (which also has peeked into table definition cache using non-normalized key) this issue led to to spurious ER_TABLE_EXISTS_ERROR errors when one tried to create a table with the same name as a previously existing but dropped table (assuming that table name contained characters in upper case). This problem occured due to fact that fill_schema_table_from_frm() was not properly normalizing (lowercasing) database and table names which it used for lookups in table definition cache. This fix adds proper normalization to this function. It also solves similar problem in CREATE TABLE's code by ensuring that it uses properly normalized version of table name when it peeks into table definition cache instead of non-normalized one.
This commit is contained in:
@ -3844,7 +3844,7 @@ bool mysql_create_table_no_lock(THD *thd,
|
||||
Then she could create the table. This case is pretty obscure and
|
||||
therefore we don't introduce a new error message only for it.
|
||||
*/
|
||||
if (get_cached_table_share(db, alias))
|
||||
if (get_cached_table_share(db, table_name))
|
||||
{
|
||||
my_error(ER_TABLE_EXISTS_ERROR, MYF(0), table_name);
|
||||
goto unlock_and_end;
|
||||
|
Reference in New Issue
Block a user