Numeric fields in SQLite returned by `search` with `query=True` can not be used in an enclosing query
This issue was detected when using the OR
-ed optimisation in SQLite with a table containing a Numeric
field.
This is due to the SQLite_Cast
method introduced in fc5080f35a0b, since it overrides as_
to use the PARSE_COLNAMES
feature of the sqlite connector it effectively renames the column to their name and type. When the column name without the type is used in an enclosing query (such as with an UNION
when doing the OR
-ed optimisation but it could be any other use case) it won't work anymore.