This repository was archived by the owner on Jun 2, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Information schema cleanup and improvements #49
Merged
+1,057
−250
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
c9e37bd
Do not create information schema tables that are not used yet
JanJakes 394bce2
Refactor schema query creation to avoid str_replace()
JanJakes 33e6114
Support "CONSTRAINT name" clause
JanJakes 8f271af
Implement "table_constraints" table in information schema
JanJakes 8b9e6f8
Fix naming condition for expression indexes
JanJakes bd2c533
Fix and simplify sync of key info to columns table
JanJakes 5ed53f0
Make identifiers and some other information schema values case insens…
JanJakes ad3f600
Explicitly support only ASCII identifiers
JanJakes 03d8ee5
Implement implicit index naming
JanJakes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
668 changes: 444 additions & 224 deletions
668
wp-includes/sqlite-ast/class-wp-sqlite-information-schema-builder.php
Large diffs are not rendered by default.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's great to surface this error in an explicit way, thank you!
Thinking about the future, if identifiers are case-insensitive in PHP, could we lowercase them effectively in PHP and pass the transformed names to SQLite? Although that opens more questions – are column names raw bytes, or are they normalized? Yeah, perhaps not going there is for the best.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@adamziel It's definitely something we could solve on the PHP side (the simplest way probably requires
mbstring
), but yeah, we'd need to be careful exactly about what you mention — the column name will be stored as raw bytes in MySQL, but comparisons would need to be done normalized.