cubicweb #17065683 rql2sql bug when comparing attributes values [open]

My use case: an entity with two attributes minimum_pressure and maximum_pressure (not required) We want an RQLConstraint maximum_pressure > minimum_pressure, checked only if both exist

rql('Any S WHERE S eid 7031, S minimum_pressure MIN, S maximum_pressure >= MIN') works (1 row in resultset)

rql('Any S WHERE S eid 7031, S minimum_pressure NULL OR (S minimum_pressure MIN, S maximum_pressure >= MIN)') fails (empty resultset)

Looking at the debug information the second query is transformed in SQL: ... WHERE _S.cw_eid=7031 AND ((_S.cw_minimum_pressure IS NULL) OR (_S.cw_maximum_pressure=_S.cw_minimum_pressure AND _S.cw_maximum_pressure>=_S.cw_minimum_pressure))

The "_S.cw_maximum_pressure=_S.cw_minimum_pressure" is the problem

prioritynormal
typebug
done in<not specified>
closed by<not specified>