-
Sivert Sorumgard authored
This worklog prohibits access to the internal tables of the transactional data dictionary (DD). The worklog implements the following main changes: 1. Remove unused data structures and plugin usage. In particular, please note that the 'system_database()' handlerton function has been removed. 2. Prohibit access for usage of DD tables from: - SQL statements. - Foreign key constraints. - Stored programs. - Replication (also cross version). Access is accepted if the thread executing the statement is a DD system thread. For external threads, i.e., representing an external client, access is accepted if the table is a DDSE table (e.g. the 'innodb_*_stats' tables), and the statement is DML. 3. Add a debug flag 'skip_dd_table_access_check' to allow DD table access in debug builds. Rewrite tests to set this flag when needing access to the DD tables. Please note that great care must be taken when this flag is used. If using DML to update the contents of the DD tables directly, without any corresponding updates in the storage engine or DD cache, invariants that the server expectes to hold will be broken, and a malfunctioning server is to be expected. The same goes for DDL; with a change in the definitions of the DD tables, it is to be expected that the server will not work as intended. 4. Rewrite tests that currently access DD tables to set the debug flag above. Separate out specific parts of tests to only be run on debug builds, if the test previously could run on non-debug builds as well. 5. Take into account that the access check mechanism may be invoked from the unit tests; check that the Dictionary instance exists before calling it. TODO: Dependencies on other worklogs: 1. Remove exception regarding queries against the st_spatial_refrerence_systems table (WL#9059). 2. Prohibit access to altering or dropping the system tablespace (WL#7141).
Sivert Sorumgard authoredThis worklog prohibits access to the internal tables of the transactional data dictionary (DD). The worklog implements the following main changes: 1. Remove unused data structures and plugin usage. In particular, please note that the 'system_database()' handlerton function has been removed. 2. Prohibit access for usage of DD tables from: - SQL statements. - Foreign key constraints. - Stored programs. - Replication (also cross version). Access is accepted if the thread executing the statement is a DD system thread. For external threads, i.e., representing an external client, access is accepted if the table is a DDSE table (e.g. the 'innodb_*_stats' tables), and the statement is DML. 3. Add a debug flag 'skip_dd_table_access_check' to allow DD table access in debug builds. Rewrite tests to set this flag when needing access to the DD tables. Please note that great care must be taken when this flag is used. If using DML to update the contents of the DD tables directly, without any corresponding updates in the storage engine or DD cache, invariants that the server expectes to hold will be broken, and a malfunctioning server is to be expected. The same goes for DDL; with a change in the definitions of the DD tables, it is to be expected that the server will not work as intended. 4. Rewrite tests that currently access DD tables to set the debug flag above. Separate out specific parts of tests to only be run on debug builds, if the test previously could run on non-debug builds as well. 5. Take into account that the access check mechanism may be invoked from the unit tests; check that the Dictionary instance exists before calling it. TODO: Dependencies on other worklogs: 1. Remove exception regarding queries against the st_spatial_refrerence_systems table (WL#9059). 2. Prohibit access to altering or dropping the system tablespace (WL#7141).
Loading