You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prior to v5.3.0 the SQL generated for all 3 DB types looked like
SELECT /* omitted for berevity*/
FROM "Entity" entity0_
WHERE (entity0_."IntValue" IS NOT NULL)
AND 5 /* @p1 */ + entity0_."IntValue" = 15 /* @p2 */
After v5.3.0 the PostgreSQL and MSSQL queries look like
SELECT /* omitted for berevity*/
FROM "Entity" entity0_
WHERE (entity0_."IntValue" IS NOT NULL)
AND 5 /* @p1 */ + cast(entity0_."IntValue" AS DECIMAL(29, 10)) = 15 /* @p2 */
While the SQLite query looks like
SELECT /* omitted for berevity*/
FROM "Entity" entity0_
WHERE (entity0_."IntValue" IS NOT NULL)
AND 5 /* @p1 */ + cast(entity0_."IntValue" AS REAL) = 15 /* @p2 */
fredericDelaporte
changed the title
Regression - Arithmetic operations adding casts to SQLite that cause incorrect results
Arithmetic operations adding casts to SQLite that cause incorrect results
Jun 6, 2021
Affects v5.3.0+
How to Reproduce
var result = session.Query<Entity>().Where(e => e.DecimalValue != null && (offset + e.DecimalValue) == test).ToList();
var result = session.Query<Entity>().Where(e => e.IntValue != null && (offset + (decimal?)e.IntValue) == test).ToList();
Where
offset
andtest
aredecimal
ordecimal?
types.Expected Result
result
contains a list of entities where the equality condition matches.This works fine for PostgreSQL and MS SQL Server.
Actual Result
SQLite gives no errors and always produces 0 results.
The text was updated successfully, but these errors were encountered: