Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TiDB: Exclude INFORMATION_SCHEMA #7352

Merged
merged 2 commits into from
Feb 28, 2025
Merged

Conversation

shunki-fujita
Copy link
Contributor

@shunki-fujita shunki-fujita commented Feb 27, 2025

What type of PR is this?

  • Bug Fix

Description

#7347
INFORMATION_SCHEMA is excluded in TiDB.

How is this tested?

  • Unit tests (pytest, jest)
  • E2E Tests (Cypress)
  • Manually
  • N/A

before change

  • MySQL
mysql> SELECT col.table_schema as table_schema,
    ->                col.table_name as table_name,
    ->                col.column_name as column_name
    ->         FROM `information_schema`.`columns` col
    ->         WHERE col.table_schema NOT IN ('information_schema', 'performance_schema', 'mysql', 'sys');
+--------------+------------+-------------+
| table_schema | table_name | column_name |
+--------------+------------+-------------+
| test         | t1         | x           |
+--------------+------------+-------------+
1 row in set (0.00 sec)
  • TiDB
mysql> SELECT col.table_schema as table_schema,
    ->                col.table_name as table_name,
    ->                col.column_name as column_name
    ->         FROM `information_schema`.`columns` col
    ->         WHERE col.table_schema NOT IN ('information_schema', 'performance_schema', 'mysql', 'sys');
+--------------------+---------------------------------------+-------------------------------------------+
| table_schema       | table_name                            | column_name                               |
+--------------------+---------------------------------------+-------------------------------------------+
| INFORMATION_SCHEMA | CLUSTER_DEADLOCKS                     | INSTANCE                                  |
| INFORMATION_SCHEMA | CLUSTER_DEADLOCKS                     | DEADLOCK_ID                               |
| INFORMATION_SCHEMA | CLUSTER_DEADLOCKS                     | OCCUR_TIME                                |
| INFORMATION_SCHEMA | CLUSTER_DEADLOCKS                     | RETRYABLE                                 |
...
| INFORMATION_SCHEMA | SEQUENCES                             | MIN_VALUE                                 |
| INFORMATION_SCHEMA | SEQUENCES                             | START                                     |
| INFORMATION_SCHEMA | SEQUENCES                             | COMMENT                                   |
| test               | t1                                    | x                                         |
+--------------------+---------------------------------------+-------------------------------------------+
1525 rows in set (0.02 sec)

after change

  • MySQL
mysql> SELECT col.table_schema as table_schema,
    ->                col.table_name as table_name,
    ->                col.column_name as column_name
    ->         FROM `information_schema`.`columns` col
    ->         WHERE LOWER(col.table_schema) NOT IN ('information_schema', 'performance_schema', 'mysql', 'sys');
+--------------+------------+-------------+
| table_schema | table_name | column_name |
+--------------+------------+-------------+
| test         | t1         | x           |
+--------------+------------+-------------+
1 row in set (0.00 sec)
  • TiDB
mysql> SELECT col.table_schema as table_schema,
    ->                col.table_name as table_name,
    ->                col.column_name as column_name
    ->         FROM `information_schema`.`columns` col
    ->         WHERE LOWER(col.table_schema) NOT IN ('information_schema', 'performance_schema', 'mysql', 'sys');
+--------------+------------+-------------+
| table_schema | table_name | column_name |
+--------------+------------+-------------+
| test         | t1         | x           |
+--------------+------------+-------------+
1 row in set (0.01 sec)

mysql>

Related Tickets & Documents

Mobile & Desktop Screenshots/Recordings (if there are UI changes)

@shunki-fujita shunki-fujita marked this pull request as ready for review February 27, 2025 05:31
Copy link
Member

@snickerjp snickerjp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Since we have already discussed this in issue #7347, I have reviewed it and everything looks good.

@snickerjp snickerjp merged commit 3bad8c8 into getredash:master Feb 28, 2025
11 checks passed
@snickerjp
Copy link
Member

@shunki-fujita

Thank you for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants