mirror of
https://github.com/minio/minio.git
synced 2025-11-20 18:06:10 -05:00
Fix precendence bug in S3Select SQL IN clauses (#18708)
Fixes a precendence issue in SQL Select where `a in b and c = 3` was parsed as `a in (b and c = 3)`. Fixes #18682
This commit is contained in:
committed by
GitHub
parent
8bd4f6568b
commit
496027b589
@@ -166,8 +166,7 @@ type Condition struct {
|
||||
Not *Condition `parser:"| \"NOT\" @@"`
|
||||
}
|
||||
|
||||
// ConditionOperand is a operand followed by an an optional operation
|
||||
// expression
|
||||
// ConditionOperand is a operand followed by an optional operation expression.
|
||||
type ConditionOperand struct {
|
||||
Operand *Operand `parser:"@@"`
|
||||
ConditionRHS *ConditionRHS `parser:"@@?"`
|
||||
@@ -202,9 +201,13 @@ type Between struct {
|
||||
End *Operand `parser:" \"AND\" @@ "`
|
||||
}
|
||||
|
||||
// In represents the RHS of an IN expression
|
||||
// In represents the RHS of an IN expression. The RHS can be a list-literal
|
||||
// (i.e. enclosed in parantheses like `IN (1,2,4)`) or it could be a JSON path
|
||||
// expression (as in `8.5 IN s.nested[*][*]`). Specifically, it cannot be an
|
||||
// `Expression` as an expression can never evaluate to a list.
|
||||
type In struct {
|
||||
ListExpression *Expression `parser:"@@ "`
|
||||
JPathExpr *JSONPath `parser:"@@"`
|
||||
ListExpr *ListExpr `parser:"| @@"`
|
||||
}
|
||||
|
||||
// Grammar for Operand:
|
||||
|
||||
Reference in New Issue
Block a user