ID |
|
|---|---|
Status |
Backlog |
Bucket |
bug |
Priority |
2 |
Theme |
codegen-correctness |
Created |
2026-11-16 |
Updated |
2026-11-16 |
A Float argument filtering a NUMERIC column is converted, not cast to BigDecimal
Goal
A query argument typed Float that filters a NUMERIC column through @field executes instead of failing with a redacted error. Today the generated condition reads the argument as (BigDecimal) args.get(...), but the engine hands a Float argument over as a Double, so every non-null value throws ClassCastException in the fetcher. The sakila example’s Query.films(maxRentalRate: Float @field(name: "RENTAL_RATE")) shows it: { films(maxRentalRate: 2.99) { title } } answers An error occurred. Reference: ... at films, from QueryConditions.filmsCondition. No test passes a value for maxRentalRate, which is how it went unnoticed.
Notes
-
The generated reader is the cast; jOOQ’s
DataType.converton the column’s type (as thefilmsByWireIdConditionshape already does withDSL.val(..., getDataType()).getValue()) is the obvious alternative. Spec decides whether aFloaton an exactNUMERICcolumn should be accepted at all, given that adoublecannot carry everyNUMERICvalue, or refused at build time in favour of aBigDecimalscalar. -
Found while writing
RequestNumberBoundsTestingraphitron-sakila-example, which steps around it with@skip(if: true); once this lands that test can drop the@skip.