Repository navigation
fix(v4): accept negative index and foreign key options - #1779
Open
dajiaohuang wants to merge 1 commit into
Open
dajiaohuang wants to merge 1 commit into
dajiaohuang wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Problem
The v4 LOAD DATABASE grammar rejects
create no indexesandno foreign keys, although the v3 SQLite parser accepts both and the SQLite reference documentscreate no indexes. This prevents otherwise valid SQLite load commands from running.References #1773 and #1765. This addresses the documented plural
indexesspelling, not the separatedata onlybehavior mentioned in a comment on #1773.Change
Add the two negative grammar productions and translate them into explicit
:create-indexes false/:foreign-keys falseoptions. These override the existing database defaults; no execution/default-policy change is needed. Add parser regression cases for the positive options, each negative option, and both together.Validation
Against main
231ab86778ca5ffd7de40878714760c8b4860cdf, the regression suite has 6 failures; with the fix, the parser suite passes 43 tests / 155 assertions, 0 failures / 0 errors.Also exercised the public CLI with the changed grammar/AST/parser and checkout core/CLI explicitly loaded, using the matching official v4-dev JAR as the dependency classpath (Java 26). Against a fresh task-owned PostgreSQL 17.6 cluster and a self-authored tiny SQLite database with two tables, two rows each, a secondary index and a foreign key:
WITH create no indexes, no foreign keys: exact rows, 0 indexes and 0 FK constraints, with default table creation still working.All HOME/config/passfile/output and database paths were isolated. Parser tests used an empty MySQL option-file lookup instead of host configuration. No real migration, full cross-database suite, rebuilt uberjar, or CI result is claimed.