Repository navigation
fix(jdbc): resolve SqlTableReference literal, alias, and join misreads - #132
Merged
Merged
Conversation
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.
Fixes #110
Contract: Hrana 3 is the source of truth for transport, values, metadata, batching, transactions, and error reporting;
java.sqlis the source of truth for the JDBC surface; xerial/sqlite-jdbc is the behavioral reference and conformance foundation, never a copy target. The protocol supplies column names and decltype but no table origin, soSqlTableReferencefollows SQLite syntax for origin and nullability.Red
At trunk, with the new cases only:
./mvnw -pl libsql-jdbc test -Dtest=SqlTableReferenceTestgivesTests run: 29, Failures: 7, one failing case per defect (string/blob literals, operator aliases, NOT INDEXED, left()/right(), unresolved CTE, USING column, RETURNING alias). Log:/tmp/xerial-parity-i110/lane-1-trunk.log.Green
At the PR head:
Tests run: 29, Failures: 0. Lanes 2-10 pass: parser+metadata 59, #100 width guard 2, module suite 233, conformance 115, xerial control, spotless, reactor 233, RSMetaDataTest 13, package. Perf: trunk median 2.34s vs head 2.25s, within the 10% rule.Changes
tokenizeemits aLITERALtoken for'...'andx'...', so literals never reach the parser as words.CASE ... ENDandx ISNULLdo not alias, andcount(*) cnow findsc.NOT INDEXEDconsumes two tokens;LEFTandRIGHTstart a join only beforeJOINorOUTER.AS aliason the INSERT/UPDATE/DELETE target.Divergences
ASonly. SQLite's grammar spells the alias that way, and accepting a bare following word would misreadVALUESorSETas an alias.