SELECT CASE WHEN $1 THEN utxo.tokenId ELSE null END AS tokenId, CASE WHEN $2 THEN utxo.boxId ELSE null END AS boxId, CASE WHEN $3 THEN utxo.amount ELSE null END AS amount FROM Utxo a INNER JOIN Asset2Box utxo ON a.boxId = utxo.boxId WHERE utxo.tokenId = $4 AND (utxo.tokenId = $5 OR $6) AND (utxo.boxId = $7 OR $8) AND (utxo.amount = $9 OR $10)
columns and filter are empty
Actual behavior
all results are amount: 0, however SELECT * FROM asset2box where amount = 0 limit 1; is empty and the values are Longs, not floats/double so IDK where the 0 comes from as it is not in database.
Expected behavior
However
Guess
So maybe in CASE WHEN $3 THEN utxo.amount ELSE null END the $3 is null which turns in to 0 amount value. But it should not be :shrug:
Version:
4.6.0.1
Module:quill-jdbc
Database:h2
-jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;MODE=PostgreSQL;DATABASE_TO_LOWER=TRUE;DEFAULT_NULL_ORDERING=HIGH
Repro
produces :
columns
andfilter
are emptyActual behavior
all results are
amount: 0
, howeverSELECT * FROM asset2box where amount = 0 limit 1;
is empty and the values are Longs, notfloats/double
so IDK where the0
comes from as it is not in database.Expected behavior
However
Guess
So maybe in
CASE WHEN $3 THEN utxo.amount ELSE null END
the$3
is null which turns in to0
amount value. But it should not be :shrug: