Repository navigation
test(jdbc): pin the hidden column filter - #236
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 #224
Adds two characterization tests that pin the
AND p.hidden != 1filter on bothpragma_table_xinfoqueries inTableMetadataResolver. Test-only change; no production code or pom touched.Stub design
connectionForHiddenColumns()follows the existing fake-catalogue pattern and answers bothpragma_table_xinfoforms. Its catalogue includes a hidden column (rank,hidden = 1) beside normal columns. The stub dispatches on the query text: it returns the hidden column only when the statement does not containp.hidden != 1, which mirrors SQLite's filtering. Row nullability differs between the main and attached catalogues so each test proves which query answered.Both tests drive star expansion, whose width comes from the xinfo catalogue. If the hidden column leaks in, the expansion is one column wider than the protocol column list,
SqlTableReference.resolvediscards the resolution, and every table name goes blank. The tests assert the visible columns still map to their tables, so a leaked hidden column fails them.Mutant outcomes
On the final tree:
excludesHiddenColumnsFromMainSchemaStarExpansionexcludesHiddenColumnsFromAttachedSchemaStarExpansionloadTableInfo)loadAttachedTableInfo)Each query is pinned independently; one test does not rely on the other.
Lane results
./mvnw -pl libsql-jdbc -am test— BUILD SUCCESS, 407 tests (405 baseline + 2 new), no failures./mvnw spotless:apply— clean./mvnw spotless:check— BUILD SUCCESSDiff is limited to
LibsqlResultSetMetaDataTest.java(+105/−2), with no existing assertion modified.