• Dmitry Lenev's avatar
    Fix for bug #44738 "fill_schema_table_from_frm() opens tables without · a7b01480
    Dmitry Lenev authored
    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.
    a7b01480
sql_table.cc 250 KB