Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tuple-value inclusive comparisons generating incorrect SQL #579

Open
fluffy-critter opened this issue Dec 30, 2020 · 0 comments
Open

Tuple-value inclusive comparisons generating incorrect SQL #579

fluffy-critter opened this issue Dec 30, 2020 · 0 comments

Comments

@fluffy-critter
Copy link

fluffy-critter commented Dec 30, 2020

Related to #468, there's currently a bug in how <= and >= are implemented for tuple comparisons.

For example, a query like model.select(lambda e: (e.a,e.b) <= (ref.a,ref.b)) is generating an expression like:

SELECT "e"."a", "e"."b" FROM "Model" "e" WHERE ("e"."a" <= ? OR "e"."a" = ? AND "e"."b" <= ?)

when that should actually be:

SELECT "e"."a", "e"."b" FROM "Model" "e" WHERE ("e"."a" < ? OR "e"."a" = ? AND "e"."b" <= ?)

and the same goes for >=.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant