Skip to content

Only reject queries on tables with unmapped column types - #1844

Open
agusaldasoro wants to merge 3 commits into
masterfrom
fix/smtlib-unknown-column-type
Open

agusaldasoro wants to merge 3 commits into
masterfrom
fix/smtlib-unknown-column-type

Conversation

@agusaldasoro

@agusaldasoro agusaldasoro commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

SmtLibGenerator declares every table of the schema for every query. getConstructors throws Unsupported column type for any column whose type has no entry in TYPE_MAP (e.g. BLOB, BYTEA, JSON, UUID depending on the backend). So a single such column anywhere in the schema made generation fail for every query, including queries on tables that never touch it. In a schema like that, the solver produced no data at all.

Fix

  • Excluded tables. SmtLibGenerator computes the tables it leaves out of the formula (undeclaredTables):
    • tables with a column of an unmapped type;
    • transitively, tables with a foreign key to one of them. A row referencing a table that is not declared could never be inserted.
  • Constraints. These tables are filtered out of smtTables, so their declarations, keys, CHECKs, boolean/timestamp constraints and get-values are all skipped.
  • Rejected queries. generateSMT first rejects a query that reads from an excluded table (rejectUndeclaredTables). The Unsupported column type: … message now names the column and table. Such a query is still recorded as an untranslatable SMTLIB_GENERATION failure, as before.

Tests

New UnmappedColumnTypeTest, on an H2 schema with users, blobs (payload blob) and blob_refs (FK to blobs):

  • a query on users is translated, and blobs does not appear in the formula. On master this throws Unsupported column type;
  • a query on blobs is rejected;
  • a query on blob_refs is rejected.

UntranslatableQueryCacheTest keeps using a query on the blob table as its generation failure. Only its comment changed: it said every query against that schema fails.

All tests under org.evomaster.core.database.sql.solver pass.

  Every table is declared for every query, so one column whose type has
  no SMT-LIB mapping made generation fail for all queries against the
  schema. Such tables, and those referencing them through foreign keys,
  are now left out of the formula, and only the queries reading them are
  rejected.
@agusaldasoro agusaldasoro changed the title Only reject queries on tables with unmapped column types Only reject queries on tables with unmapped column types Oct 7, 2026
@agusaldasoro
agusaldasoro marked this pull request as ready for review October 8, 2026 09:48
@agusaldasoro
agusaldasoro marked this pull request as draft October 8, 2026 09:50
@agusaldasoro
agusaldasoro marked this pull request as ready for review October 8, 2026 17:21
@agusaldasoro
agusaldasoro requested a review from jgaleotti October 8, 2026 17:21
@jgaleotti
jgaleotti requested a review from arcuri82 October 8, 2026 19:25
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.

2 participants