[RQL] SQL error when an attribute exists on several entity type with the same name but not the same type
How to reproduce ?
class Poulet:
code = String()
class Canard:
code = Int()
Then, doing "Any X Where X code 5"
or "Any X Where X code 'tomate'"
will raise an SQL error, because the RQL will be translated to:
SELECT _X.cw_eid FROM cw_poulet as _X WHERE X code 5 UNION ALL SELECT _X.cw_eid FROM cw_canard as _X WHERE X code 5
But in the sql schema, Poulet.code is a varchar ... not an integer
In my opinion, we might want to take care of the type when translated to SQL and only takes possible option (in our case, if we ask for a number for the code value, we should only check the Canard table, not the Poulet table.)