Skip to content

test(jdbc): pin the hidden column filter - #236

Merged
magnusp merged 1 commit into
mainfrom
test/i224-hidden-filter-pin
Oct 24, 2026
Merged

magnusp merged 1 commit into
mainfrom
test/i224-hidden-filter-pin

Conversation

@magnusp

@magnusp magnusp commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

Fixes #224

Adds two characterization tests that pin the AND p.hidden != 1 filter on both pragma_table_xinfo queries in TableMetadataResolver. Test-only change; no production code or pom touched.

Stub design

connectionForHiddenColumns() follows the existing fake-catalogue pattern and answers both pragma_table_xinfo forms. 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 contain p.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.resolve discards 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:

Mutation excludesHiddenColumnsFromMainSchemaStarExpansion excludesHiddenColumnsFromAttachedSchemaStarExpansion
Remove filter from main query (loadTableInfo) FAIL pass
Remove filter from attached query (loadAttachedTableInfo) pass FAIL
Remove filter from both queries FAIL FAIL
Restored filters pass pass

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 SUCCESS

Diff is limited to LibsqlResultSetMetaDataTest.java (+105/−2), with no existing assertion modified.

@magnusp
magnusp merged commit c4357d2 into main Oct 24, 2026
6 checks passed
@magnusp
magnusp deleted the test/i224-hidden-filter-pin branch October 24, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pin the hidden != 1 filter on the table metadata queries

1 participant