Fix foreign key parsing broken by MariaDB system versioning - #20346
Open
Maria-Berta wants to merge 1 commit into
Open
Fix foreign key parsing broken by MariaDB system versioning#20346Maria-Berta wants to merge 1 commit into
Maria-Berta wants to merge 1 commit into
Conversation
Member
|
Thank you for your work It would be great if you could add some phpunit tests |
When a MariaDB table has system versioning enabled, SHOW CREATE TABLE includes constructs the sql-parser library does not handle: - GENERATED ALWAYS AS ROW START/END columns - PERIOD FOR SYSTEM_TIME clause These cause getForeigners() to return an empty array, making the Relation View appear empty for system-versioned tables. Fix: Pre-process the SHOW CREATE TABLE string to strip these MariaDB-specific constructs before passing to the parser. Add PHPUnit tests covering versioned and non-versioned tables. Fixes: phpmyadmin#20095 Signed-off-by: Mariamawit Berta <mariamawit21geremew@gmail.com>
Maria-Berta
force-pushed
the
fix/system-versioning-foreign-keys
branch
from
July 7, 2026 18:24
2aac852 to
86bd09b
Compare
Author
|
Hi @williamdes , I've completed both requests: ->Hard reset the branch to QA_5_2 and cherry-picked the fix
All 4 tests pass. Please let me know if any further changes are needed! |
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.
When a MariaDB table has system versioning enabled, SHOW CREATE TABLE
includes constructs the sql-parser library does not handle:
These cause getForeignKeysData() to return an empty array, making
the Relation View appear empty for system-versioned tables even though
the foreign keys exist in the database.
Fix: Pre-process the SHOW CREATE TABLE string in getForeignKeysData()
to strip these MariaDB-specific constructs before passing to the parser.
Steps to reproduce:
Fixes: #20095
Signed-off-by: Mariamawit Berta mariamawit21geremew@gmail.com