rzo1 opened a new pull request, #241:
URL: https://github.com/apache/openjpa/pull/241

   https://issues.apache.org/jira/browse/OPENJPA-3035
   
   On MySQL, criteria arithmetic on Integer attributes returned a Long (TCK 
`Client5.neg`, `sumNumExpTest`, `diffNumberExpTest`). `Sum`, `Diff`, `Product` 
and `Quotient` in `Expressions` took their result type from the first operand 
only; `cb.neg(x)` is `0 - x` with a `Number` literal, so no conversion happened 
and MySQL's BIGINT came back as is.
   
   - New `promoteNumeric()` applies the spec's numeric promotion to both 
operands (Double, Float, BigDecimal, BigInteger, Long, Integer); a literal 
counts by its value's class. `Product` now passes its type to the kernel.
   - JPQL `+ - * /` on Short/Byte operands now returns Integer, as the existing 
4.2 migration note already says.
   - Migration note: Criteria results now depend on both operands, e.g. 
`sum(int, long)` gives Long and `sum(int, 2.5)` gives Double 9.5 instead of a 
truncated Integer.
   
   `TestArithmeticResultType` (exact result types for sum, diff, prod, neg, 
mod, division, mixed operands, JPQL, constructor expressions). Fails on MySQL 
without the fix. Full suite passes on Derby and H2, new test also on MySQL 8.4.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to