-
-
Notifications
You must be signed in to change notification settings - Fork 212
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
fix AS OF
clause panic for certain expressions
#2779
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just some questions about whether it's easy to extend the fix to be a bit safer
sql/planbuilder/show.go
Outdated
@@ -615,6 +615,8 @@ func (b *Builder) buildAsOfExpr(inScope *scope, time ast.Expr) sql.Expression { | |||
err := sql.ErrInvalidAsOfExpression.New(v) | |||
b.handleErr(err) | |||
} | |||
case *ast.Subquery: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there anyway we could easily extend this a bit? should the default be an error? would we need a whitelist of acceptable exprs? longer blacklist of non-acceptable exprs?
We attempt to parse eval
AS OF
expressions in the builder (because we assume it is going to be a literal), but Subqueries cannot be evaluated until after they have gone through the analyzer.partially addresses: dolthub/dolt#8635