Fix parsing of backtick-enclosed table options#644
Open
Ryujiyasu wants to merge 1 commit intophpmyadmin:masterfrom
Open
Fix parsing of backtick-enclosed table options#644Ryujiyasu wants to merge 1 commit intophpmyadmin:masterfrom
Ryujiyasu wants to merge 1 commit intophpmyadmin:masterfrom
Conversation
MariaDB encloses some table options in backticks by default (e.g. `PAGE_COMPRESSED`=1). The option name lookup in OptionsArrays::parse() used $token->token which includes the backticks, causing the match against the options array to fail. This adds a targeted check: when a backtick-enclosed symbol is followed by '=', its unquoted value is used for the lookup. A lookahead for '=' prevents regular quoted identifiers (such as table or column names) from being mistaken for options. Fixes phpmyadmin#643 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
`PAGE_COMPRESSED`=1produced by MariaDB=to distinguish option assignments from regular quoted identifiers (table/column names)$token->value(without backticks) for the option name lookup only when confirmed as an optionHow it works
In
OptionsArrays::parse(), the option name lookup used$token->tokenwhich includes backticks for quoted symbols. MariaDB outputs table options like`PAGE_COMPRESSED`=1, so the backtick-enclosed name never matched theTABLE_OPTIONSarray.The fix adds a targeted check: if the token is a backtick-enclosed symbol and the next non-whitespace token is
=, it uses the unquoted$token->valuefor the lookup. This prevents false matches where quoted identifiers (e.g.`database`inALTER TABLE `database`.`table`) could collide with option names likeDATABASE.Test plan
testBuilderCompressedBacktickstest for backtick-enclosedPAGE_COMPRESSEDandPAGE_COMPRESSION_LEVELFixes #643
🤖 Generated with Claude Code