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

Wrap all math operations in parens #2018

Merged
merged 1 commit into from
Mar 19, 2019
Merged

Wrap all math operations in parens #2018

merged 1 commit into from
Mar 19, 2019

Conversation

sgrif
Copy link
Member

@sgrif sgrif commented Mar 19, 2019

Previously if you used local variables or parens in Rust to override the
default order of operations, we would completely lose that information
in the generated SQL. This would at best result in an unexpected value,
but at worse would cause a query like now + 2.minutes() * (some_int + 1) to result in a runtime error complaining that there's no operator
for interval + integer

I intend to backport this to 1.4

Fixes #2017

@sgrif sgrif requested a review from a team March 19, 2019 01:44
@Eijebong
Copy link
Member

Lgtm with ci fixed

Previously if you used local variables or parens in Rust to override the
default order of operations, we would completely lose that information
in the generated SQL. This would at best result in an unexpected value,
but at worse would cause a query like `now + 2.minutes() * (some_int +
1)` to result in a runtime error complaining that there's no operator
for `interval + integer`

I intend to backport this to 1.4

Fixes #2017
@sgrif sgrif merged commit 0b6ee50 into master Mar 19, 2019
@sgrif sgrif deleted the sg-math-parens branch April 10, 2019 14:19
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

Successfully merging this pull request may close these issues.

2 participants