@@ -112,6 +112,34 @@ func replaceVariablesInExpr(ctx *sql.Context, stack *InterpreterStack, expr ast.
112112 }
113113 e .Left = newLeftExpr .(ast.Expr )
114114 e .Right = newRightExpr .(ast.Expr )
115+ case * ast.AndExpr :
116+ newLeftExpr , err := replaceVariablesInExpr (ctx , stack , e .Left , asOf )
117+ if err != nil {
118+ return nil , err
119+ }
120+ newRightExpr , err := replaceVariablesInExpr (ctx , stack , e .Right , asOf )
121+ if err != nil {
122+ return nil , err
123+ }
124+ e .Left = newLeftExpr .(ast.Expr )
125+ e .Right = newRightExpr .(ast.Expr )
126+ case * ast.OrExpr :
127+ newLeftExpr , err := replaceVariablesInExpr (ctx , stack , e .Left , asOf )
128+ if err != nil {
129+ return nil , err
130+ }
131+ newRightExpr , err := replaceVariablesInExpr (ctx , stack , e .Right , asOf )
132+ if err != nil {
133+ return nil , err
134+ }
135+ e .Left = newLeftExpr .(ast.Expr )
136+ e .Right = newRightExpr .(ast.Expr )
137+ case * ast.NotExpr :
138+ newExpr , err := replaceVariablesInExpr (ctx , stack , e .Expr , asOf )
139+ if err != nil {
140+ return nil , err
141+ }
142+ e .Expr = newExpr .(ast.Expr )
115143 case * ast.FuncExpr :
116144 for i := range e .Exprs {
117145 newExpr , err := replaceVariablesInExpr (ctx , stack , e .Exprs [i ], asOf )
@@ -120,12 +148,6 @@ func replaceVariablesInExpr(ctx *sql.Context, stack *InterpreterStack, expr ast.
120148 }
121149 e .Exprs [i ] = newExpr .(ast.SelectExpr )
122150 }
123- case * ast.NotExpr :
124- newExpr , err := replaceVariablesInExpr (ctx , stack , e .Expr , asOf )
125- if err != nil {
126- return nil , err
127- }
128- e .Expr = newExpr .(ast.Expr )
129151 case * ast.Set :
130152 for _ , setExpr := range e .Exprs {
131153 newExpr , err := replaceVariablesInExpr (ctx , stack , setExpr .Expr , asOf )
0 commit comments