• Marko Mäkelä's avatar
    MDEV-21933 INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES accesses SYS_DATAFILES · 2e8b0c56
    Marko Mäkelä authored
    All tablespace metadata is buffered in fil_system. There is a LRU
    mechanism, but that only controls the opening and closing of
    fil_node_t::handle.
    
    It is much more efficient and less error-prone to access data file names
    by looking up the fil_space_t object rather than by essentially joining
    each row with an access to SYS_DATAFILES via the InnoDB internal SQL parser.
    
    dict_get_first_path(): Declare static. The function may only be needed
    when loading or updating the data dictionary. Also, change a condition
    in order to avoid a bogus GCC 10 -Wstringop-overflow warning for
    mem_strdupl() about len==ULINT_UNDEFINED.
    
    i_s_sys_tablespaces_fill_table(): Do not access other InnoDB internal
    dictionary tables than SYS_TABLESPACES.
    2e8b0c56
dict0load.h 12.8 KB