Skip to content

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

Closed

Description

@magnusp

Goal

Add a committed test that fails when the hidden != 1 filter is removed from the table metadata queries.

Where

TableMetadataResolver, which was extracted from LibsqlResultSetMetaData in #205. Both pragma_table_xinfo queries filter p.hidden != 1.

Evidence

Removing both filter clauses leaves the suite green. On main and on the #223 head, ./mvnw -pl libsql-jdbc -am test (392 tests) and ./mvnw -pl libsql-conformance -am verify (272 tests) still pass.

A live FTS5 star-width probe against the pinned sqld image showed the filter matters in practice. With it removed, getTableName(1) came back empty. So the behavior is real, but no committed test observes it.

Why it matters

SQLite reports hidden as 0 for a normal column, 1 for a hidden virtual-table column, 2 for a generated virtual column, and 3 for a generated stored column. A virtual table's hidden column must not appear in star expansion or column metadata. Without the filter, a future change can silently include it and the suite stays green.

Scope

  • Add a characterization test in LibsqlResultSetMetaDataTest using the existing stub pattern. The pragma_table_xinfo rows include one with hidden = 1, and the test asserts it is excluded from star expansion and column mapping.
  • Optionally mirror the case in the live conformance or itests lane, following the FTS5 probe that found this.
  • Prove the test fails when AND p.hidden != 1 is removed from either query, then restore the filter.

Acceptance

  • The new test fails against the filter-removal mutation and passes on the current head.
  • No production change in this issue.
  • ./mvnw -pl libsql-jdbc -am test and ./mvnw spotless:check are green.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal priority: edge case, feature gap, or test/process improvement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions