Bug #74531 InnoDB: Refactor code related to loading tables and tablesapces
Submitted: 23 Oct 2014 23:34 Modified: 3 Nov 2014 14:39
Reporter: Kevin Lewis Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:5.7.6 OS:Any
Assigned to: CPU Architecture:Any

[23 Oct 2014 23:34] Kevin Lewis
Description:
InnoDB code related to loading tablespaces and tables needs to be refactored so that general tablespaces can be loaded and managed along with file-per-table tablespaces.

Restructure dict_check_tablespaces_and_store_max_id(() so that it calls a new function dict_check_sys_tables(). This function uses dict_startscan_system() and dict_getnext_system() to step through the system table which is different from the direct way it did before, and the code can be more easily used for the GlobalDD, hopefully. Then for each SYS_TABLES table, it calls a new function dict_sys_tables_rec_read() which does the read, much like the original code in dict_check_tablespaces_and_store_max_id().

The parameters to dict_check_tablespaces_and_store_max_id(), recv_needed_recovery and dict_check were consolidated to just a 'bool validate', which is set true if recovery was needed. This makes validation in fil_open_ibd_tablespace happen more often which results in the correction of the I_S.INNODB_SYS_DATAFILES output in the restart.test.

Take the portion of dict_load_table_one() that loads a tablespace while loading a table, and put it into its own inline function called dict_load_tablespace().

How to repeat:
Non-functional change

Suggested fix:
See Description