MDEV-33910 Mark mysql and performance_schema tables as SYSTEM TABLE/VIEW#4243
MDEV-33910 Mark mysql and performance_schema tables as SYSTEM TABLE/VIEW#4243akshatnehra wants to merge 1 commit intoMariaDB:mainfrom
Conversation
|
|
|
I observed some test failures because BASE TABLE has been changed to SYSTEM TABLE, I will fix these tests and push the changes once done. |
c3a158b to
967e957
Compare
gkodinov
left a comment
There was a problem hiding this comment.
Thank you for taking the time to implement and submit this.
These are some preliminary review comments. A developer will be assigned to do the final review once we get past the basics.
Before we go any further with the contribution, please consider the following:
- sign the CLA (one of its two versions) so that the CLA bot can check and comfirm it
- re-record funcs_1.is_tables_mysql perfschema.information_schema
- consider justifying the non-SQL standard value for TABLE_TYPE.
967e957 to
f26bb95
Compare
|
How much was that change had been tested with external tools and connectors that rely on I_S.TABLES? It has the potential to break a lot of things, if MySQL did not do the same thing yet. "A lot of things" are popular UIs, and at least JDBC connectors. And a lot of things I have no idea of yet. |
Tables in the mysql and performance_schema databases were incorrectly shown as "BASE TABLE" and "VIEW" in INFORMATION_SCHEMA.TABLES. These should be marked as "SYSTEM TABLE" and "SYSTEM VIEW" respectively. This commit modifies the get_schema_tables_record() function in sql_show.cc to correctly identify tables belonging to mysql and performance_schema schemas and set their TABLE_TYPE accordingly. All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc.
97c2c9a to
de76e99
Compare
Description
This PR addresses issue where tables residing in databases
mysqlandperformance_schemawere not properly identified as SYSTEM TABLE/SYSTEM VIEW inINFORMATION_SCHEMA.TABLES.The fix involves modifying the
get_schema_tables_record()function to:sysschema tables as regular tables/views as intendedNOTE: A specific exception was made for
mysql.userto resolve failures in the test suite. Themain.mysql_upgrade_to_100502test failed because itsmysql_upgradescript requires direct write access tomysql.userwhich was blocked when it was classified as a SYSTEM TABLE. Also,main.plugin_authand manualFLUSH PRIVILEGEScommands failed with ERROR 1347: 'mysql.user' is not of type 'TABLE'. This indicates that the server's internal privilege reload mechanism (acl_reload) expects to read the grant tables as standard BASE TABLEs. Classifying them as SYSTEM objects breaks this core server function, leading to privilege inconsistencies. This targeted exception formysql.userfixed these inconsistencies. Could there be any better way of handling this?How can this PR be tested?
NOTE: Make sure performance_schema is enabled when starting the server.
Run queries to check the table types before and after the fix:
Results from my testing
Before changes
Result will show mysql and performance_schema tables as "BASE TABLE"
After Changes
Result should show:
Basing the PR against the correct MariaDB version
PR quality check
CODING_STANDARDS.mdfile and my PR conforms to this where appropriate.