Skip to content

Conversation

dveeden
Copy link
Contributor

@dveeden dveeden commented Feb 26, 2025

What problem does this PR solve?

Issue Number: close #59775

Problem Summary:

What changed and how does it work?

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No need to test
    • I checked and no code files have been changed.

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

Please refer to Release Notes Language Style Guide to write a quality release note.

The `information_schema.columns` table was changed to be more compatible with MySQL

@ti-chi-bot ti-chi-bot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 26, 2025
Copy link

tiprow bot commented Feb 26, 2025

Hi @dveeden. Thanks for your PR.

PRs from untrusted users cannot be marked as trusted with /ok-to-test in this repo meaning untrusted PR authors can never trigger tests themselves. Collaborators can still trigger tests on the PR using /test all.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@dveeden
Copy link
Contributor Author

dveeden commented Feb 26, 2025

MySQL 8.0:

mysql-8.0.41> DESCRIBE information_schema.COLUMNS;
+--------------------------+----------------------------+------+-----+---------+-------+
| Field                    | Type                       | Null | Key | Default | Extra |
+--------------------------+----------------------------+------+-----+---------+-------+
| TABLE_CATALOG            | varchar(64)                | NO   |     | NULL    |       |
| TABLE_SCHEMA             | varchar(64)                | NO   |     | NULL    |       |
| TABLE_NAME               | varchar(64)                | NO   |     | NULL    |       |
| COLUMN_NAME              | varchar(64)                | YES  |     | NULL    |       |
| ORDINAL_POSITION         | int unsigned               | NO   |     | NULL    |       |
| COLUMN_DEFAULT           | text                       | YES  |     | NULL    |       |
| IS_NULLABLE              | varchar(3)                 | NO   |     |         |       |
| DATA_TYPE                | longtext                   | YES  |     | NULL    |       |
| CHARACTER_MAXIMUM_LENGTH | bigint                     | YES  |     | NULL    |       |
| CHARACTER_OCTET_LENGTH   | bigint                     | YES  |     | NULL    |       |
| NUMERIC_PRECISION        | bigint unsigned            | YES  |     | NULL    |       |
| NUMERIC_SCALE            | bigint unsigned            | YES  |     | NULL    |       |
| DATETIME_PRECISION       | int unsigned               | YES  |     | NULL    |       |
| CHARACTER_SET_NAME       | varchar(64)                | YES  |     | NULL    |       |
| COLLATION_NAME           | varchar(64)                | YES  |     | NULL    |       |
| COLUMN_TYPE              | mediumtext                 | NO   |     | NULL    |       |
| COLUMN_KEY               | enum('','PRI','UNI','MUL') | NO   |     | NULL    |       |
| EXTRA                    | varchar(256)               | YES  |     | NULL    |       |
| PRIVILEGES               | varchar(154)               | YES  |     | NULL    |       |
| COLUMN_COMMENT           | text                       | NO   |     | NULL    |       |
| GENERATION_EXPRESSION    | longtext                   | NO   |     | NULL    |       |
| SRS_ID                   | int unsigned               | YES  |     | NULL    |       |
+--------------------------+----------------------------+------+-----+---------+-------+
22 rows in set (0.00 sec)

TiDB (with this PR):

mysql-8.0.11-TiDB-v9.0.0-alpha-328-g8b30027ba7-dirty> DESCRIBE information_schema.COLUMNS;
+--------------------------+-----------------+------+------+---------+-------+
| Field                    | Type            | Null | Key  | Default | Extra |
+--------------------------+-----------------+------+------+---------+-------+
| TABLE_CATALOG            | varchar(64)     | YES  |      | NULL    |       |
| TABLE_SCHEMA             | varchar(64)     | YES  |      | NULL    |       |
| TABLE_NAME               | varchar(64)     | YES  |      | NULL    |       |
| COLUMN_NAME              | varchar(64)     | YES  |      | NULL    |       |
| ORDINAL_POSITION         | int unsigned    | YES  |      | NULL    |       |
| COLUMN_DEFAULT           | text            | YES  |      | NULL    |       |
| IS_NULLABLE              | varchar(3)      | YES  |      | NULL    |       |
| DATA_TYPE                | longtext        | YES  |      | NULL    |       |
| CHARACTER_MAXIMUM_LENGTH | bigint          | YES  |      | NULL    |       |
| CHARACTER_OCTET_LENGTH   | bigint          | YES  |      | NULL    |       |
| NUMERIC_PRECISION        | bigint unsigned | YES  |      | NULL    |       |
| NUMERIC_SCALE            | bigint unsigned | YES  |      | NULL    |       |
| DATETIME_PRECISION       | int unsigned    | YES  |      | NULL    |       |
| CHARACTER_SET_NAME       | varchar(64)     | YES  |      | NULL    |       |
| COLLATION_NAME           | varchar(64)     | YES  |      | NULL    |       |
| COLUMN_TYPE              | mediumtext      | YES  |      | NULL    |       |
| COLUMN_KEY               | varchar(3)      | YES  |      | NULL    |       |
| EXTRA                    | varchar(256)    | YES  |      | NULL    |       |
| PRIVILEGES               | varchar(154)    | YES  |      | NULL    |       |
| COLUMN_COMMENT           | text            | YES  |      | NULL    |       |
| GENERATION_EXPRESSION    | longtext        | NO   |      | NULL    |       |
| SRS_ID                   | int unsigned    | YES  |      | NULL    |       |
+--------------------------+-----------------+------+------+---------+-------+
22 rows in set (0.00 sec)

Note that COLUMN_KEY is different. Not sure if it is safe to change that.

@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Feb 26, 2025
@dveeden
Copy link
Contributor Author

dveeden commented Feb 26, 2025

/ok-to-test

@ti-chi-bot ti-chi-bot bot added the ok-to-test Indicates a PR is ready to be tested. label Feb 26, 2025
@dveeden dveeden changed the title infoschema: make columns table compatible with MySQL 8.0 infoschema: make columns table compatible with MySQL 8.0 | tidb-test=pr/2489 Feb 26, 2025
@dveeden
Copy link
Contributor Author

dveeden commented Feb 26, 2025

/retest

Copy link

codecov bot commented Feb 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.9372%. Comparing base (8b30027) to head (5feb68f).
Report is 6 commits behind head on master.

Additional details and impacted files
@@               Coverage Diff                @@
##             master     #59779        +/-   ##
================================================
+ Coverage   72.9531%   74.9372%   +1.9840%     
================================================
  Files          1699       1745        +46     
  Lines        469241     478550      +9309     
================================================
+ Hits         342326     358612     +16286     
+ Misses       105828      97352      -8476     
- Partials      21087      22586      +1499     
Flag Coverage Δ
integration 49.0419% <100.0000%> (?)
unit 72.2642% <100.0000%> (+0.0972%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
dumpling 52.6910% <ø> (ø)
parser ∅ <ø> (∅)
br 61.3815% <ø> (+16.3280%) ⬆️

Copy link

ti-chi-bot bot commented Feb 26, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Defined2014, tangenta

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added approved lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Feb 26, 2025
Copy link

ti-chi-bot bot commented Feb 26, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-02-26 08:29:19.663923888 +0000 UTC m=+430907.617082154: ☑️ agreed by Defined2014.
  • 2025-02-26 09:49:31.102714296 +0000 UTC m=+435719.055872562: ☑️ agreed by tangenta.

@dveeden
Copy link
Contributor Author

dveeden commented Feb 26, 2025

/retest

3 similar comments
@dveeden
Copy link
Contributor Author

dveeden commented Feb 26, 2025

/retest

@hawkingrei
Copy link
Member

/retest

@dveeden
Copy link
Contributor Author

dveeden commented Feb 26, 2025

/retest

@ti-chi-bot ti-chi-bot bot merged commit ba9f6ff into pingcap:master Feb 26, 2025
26 checks passed
zeminzhou pushed a commit to zeminzhou/tidb that referenced this pull request May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm ok-to-test Indicates a PR is ready to be tested. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make information_schema.columns have the same columns as MySQL
4 participants