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

[BUG] Order of precedence not honored in APPLY functions with exponents #4546

Open
joeywhelan opened this issue Mar 22, 2024 · 1 comment
Open
Assignees
Labels

Comments

@joeywhelan
Copy link

joeywhelan commented Mar 22, 2024

Mathematical order of precedence is not being followed for APPLY equations with exponentiation. Parentheses are necessary to ensure exponentiation has higher precedence. Redis Search version = 2.8.12

Examples:

  • Incorrect
> FT.AGGREGATE txns * APPLY '(2*3^2)' AS Value LIMIT 0 1
1) "1"
2) 1) "Value"
   2) "36"
  • Correct
> FT.AGGREGATE txns * APPLY '(2*(3^2))' AS Value LIMIT 0 1
1) "1"
2) 1) "Value"
   2) "18"
@meiravgri
Copy link
Collaborator

Hi @joeywhelan
This indeed seems like a bug. Thanks for reporting.

@joeywhelan joeywhelan changed the title Order of precedence not honored in APPLY functions with exponents [BUG] [BUG] Order of precedence not honored in APPLY functions with exponents Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants