Closed
Description
Migrated issue, originally created by Anonymous
Operator precedence list in sql.py doesn't match the precedences used in databases.
Example:
>>> print (literal(1) == literal(2)) == None
:literal = :literal_1 IS NULL
This will generate errors on postgresql because IS has higher precedence than comparison.
Attachments: operator_precedence.patch
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
sqlalchemy-bot commentedon Jun 25, 2007
Anonymous wrote:
Patch fixing issue with unittests.
sqlalchemy-bot commentedon Jun 25, 2007
Changes by Anonymous:
sqlalchemy-bot commentedon Jun 25, 2007
Anonymous wrote:
The current patch has a problem with boolean operators used as the comparable for BETWEEN. e.g. (literal(1) == literal(2)).between(False,True) outputs '':literal = :literal_1 BETWEEN :literal_2 AND :literal_3'', correct would be (:literal = :literal_1) BETWEEN :literal_2 AND :literal_3.
sqlalchemy-bot commentedon Jun 25, 2007
Michael Bayer (@zzzeek) wrote:
patch applied in changeset:2783. the "between" issue branched off into #621.
sqlalchemy-bot commentedon Jun 25, 2007
Changes by Michael Bayer (@zzzeek):