The bindparam function used to bind values when comparing strings with = or == leads to the following erroneous SQL queries being emitted to the database.
For example, the following clause
supporter_amount=10 and (zip=53* or zip=54*)
leads to the following SQL query (only WHERE clause is included):
...
WHERE person.supporter_amount = 10.0
AND (lower(person.zip) ILIKE '54%'
OR lower(person.zip) ILIKE '54%')
As you can see, the last element of the OR clause overwrites the first. This bug is fixed when removing the bindparam function in this code here.
The
bindparam
function used to bind values when comparing strings with=
or==
leads to the following erroneous SQL queries being emitted to the database.For example, the following clause
leads to the following SQL query (only
WHERE
clause is included):As you can see, the last element of the
OR
clause overwrites the first. This bug is fixed when removing thebindparam
function in this code here.