Repository navigation
Map BLOB column types and write their values in hex on H2 - #1855
Merged
Merged
Conversation
agusaldasoro
marked this pull request as ready for review
October 8, 2026 17:45
jgaleotti
approved these changes
Oct 8, 2026
Collaborator
|
@agusaldasoro hi there are merge conflicts |
# Conflicts: # core/src/main/kotlin/org/evomaster/core/database/sql/solver/service/SMTLibZ3DbConstraintSolver.kt
Collaborator
Author
Fixed! |
arcuri82
approved these changes
Oct 15, 2026
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.
Problem
BLOB columns had no entry in
TYPE_MAP. Every table of the schema is declared for every query, so a single BLOB column made SMT-LIB generation fail for all queries of the schema.The value also needs care. H2 1.4 reads a string literal given for a binary column as hexadecimal, so a value such as
"abc"makes it reject the INSERT (Hexadecimal string with odd number of characters). H2 2.x, MySQL and PostgreSQL accept any text.Fix
SmtLibGenerator.BLOB_TYPES: maps every spelling toString:BINARY LARGE OBJECT(H2 2.x)BLOB(H2 1.4, MySQL)TINYBLOB,MEDIUMBLOB,LONGBLOB(MySQL)SMTLibZ3DbConstraintSolver.binaryValue: on H2, writes the value of a BLOB column as the hex of its UTF-8 bytes, which both H2 versions accept. The mapping is injective, so the equalities the formula imposes (unique and primary keys) still hold. Other databases get the value as is. It is reached fromvalidTextValue(Generate valid UUID, JSON and JSONB values #1849), which handles UUID and JSON columns and passes every other value on.The values stay plain SMT Strings, so solving costs the same as before.
Tests
BlobColumnSolvingTest(H2, Z3 Docker). Onmasterboth cases fail, because the solver returns no action:BLOB(as H2 1.4 does),WHERE data = 'abc'produces the value616263, and the row is inserted.UntranslatableQueryCacheTestandUnmappedColumnTypeTest: used a BLOB column as their example of an unmapped type. They now useINTERVAL YEAR.All tests under
org.evomaster.core.database.sql.solverpass.🤖 Generated with Claude Code