KamoCRM

Stop Hibernate mangling the "::" casts in the native SQL

FixEmailService
Shipped
5 ஆகஸ்ட், 2026 அன்று 11:33 PM UTC
Author
Kamo
Commit
ad9be48

Hibernate's native-query parser treats "::" as an escaped colon and forwards a single ":". CockroachDB received **************** ARRAY[]:text[]), ' ') and rejected it with: at or near ":": syntax error. The statement is valid SQL -- it prepares and executes fine by hand -- which is what made this look like a missing database function rather than a client-side rewrite. updateSearchVector shares its transaction with the search_index insert, so that syntax error rolled the insert back too and the table could never fill. Coalesce the joined string rather than the array, which needs no cast at all, and build the label filter with CAST(? AS UUID) instead of ?::uuid -- the same trap, waiting on any search using label:.

All changes

Like what you see shipping?

All of it arrives in your workspace on its own. Start on the free plan and read this page again in a month.

Start Free ForeverView Pricing