sql-statements: document ALTER TABLE COMPRESSION='NONE' behavior#23299
sql-statements: document ALTER TABLE COMPRESSION='NONE' behavior#23299takaidohigasi wants to merge 2 commits into
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @takaidohigasi. Thanks for your PR. I'm waiting for a pingcap member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
There was a problem hiding this comment.
Code Review
This pull request updates the ALTER TABLE documentation to clarify that the COMPRESSION option only accepts NONE as a no-op for compatibility, while other values like ZLIB or LZ4 will return an error. The review feedback suggests formatting SQL values with backticks, using active voice, and addressing the user in the second person to align with the repository style guide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
@D3Hunter Please help with the tech review of this PR. Thanks. |
|
|
||
| - `ALTER TABLE t CACHE | NOCACHE` is a TiDB extension to MySQL syntax. For details, see [Cached Tables](/cached-tables.md). | ||
|
|
||
| - `ALTER TABLE ... COMPRESSION` only accepts `NONE` (case-insensitive) and is a no-op. TiDB accepts this statement only for compatibility (for example, for tables migrated from MySQL that carry a `COMPRESSION` attribute) and does not compress or uncompress any table data. Specifying other values, such as `ZLIB` or `LZ4`, returns the error `This type of ALTER TABLE is currently unsupported` (error code 8200). If you specify an unsupported `COMPRESSION` value together with other options in a single statement, none of the options take effect. |
There was a problem hiding this comment.
The parser grammar requires COMPRESSION to be followed by stringLit, so bare NONE, ZLIB, and LZ4 do not reflect executable syntax. Keeping the quotes inside the code span also makes the MySQL-migration example immediately usable.
| - `ALTER TABLE ... COMPRESSION` only accepts `NONE` (case-insensitive) and is a no-op. TiDB accepts this statement only for compatibility (for example, for tables migrated from MySQL that carry a `COMPRESSION` attribute) and does not compress or uncompress any table data. Specifying other values, such as `ZLIB` or `LZ4`, returns the error `This type of ALTER TABLE is currently unsupported` (error code 8200). If you specify an unsupported `COMPRESSION` value together with other options in a single statement, none of the options take effect. | |
| - `ALTER TABLE ... COMPRESSION` accepts only the string literal `'NONE'` (case-insensitive) and is a no-op. TiDB accepts this statement only for compatibility, for example, for tables migrated from MySQL that carry a `COMPRESSION` attribute. It does not compress or uncompress table data. Other values, such as `'ZLIB'` or `'LZ4'`, return error code 8200 (`This type of ALTER TABLE is currently unsupported`). If you specify an unsupported `COMPRESSION` value together with other options in a single statement, none of the options take effect. |
What is changed, added or deleted? (Required)
Document the
ALTER TABLE ... COMPRESSIONbehavior introduced by pingcap/tidb#62305:ALTER TABLE ... COMPRESSIONonly accepts'NONE'(case-insensitive) and it is a no-op (metadata-only; TiDB does not compress or uncompress any table data). This allows reverting theCOMPRESSIONattribute for tables migrated from MySQL.'ZLIB'and'LZ4'return the errorThis type of ALTER TABLE is currently unsupported(error code 8200).COMPRESSIONvalue is specified together with other options in one statement, none of the options take effect.Added one item to the
MySQL compatibilitysection ofsql-statements/sql-statement-alter-table.md.Which TiDB version(s) do your changes apply to? (Required)
Tips for choosing the affected version(s):
By default, CHOOSE MASTER ONLY so your changes will be applied to the next TiDB major or minor releases. If your PR involves a product feature behavior change or a compatibility change, CHOOSE THE AFFECTED RELEASE BRANCH(ES) AND MASTER.
For details, see tips for choosing the affected versions.
What is the related PR or file link(s)?
AI agent involvement
Do your changes match any of the following descriptions?