Skip to content

Commit 8458102

Browse files
author
James Cor
committed
prevent most types from being as of clauses
1 parent 29d5096 commit 8458102

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

enginetest/queries/queries.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10751,6 +10751,10 @@ var ErrorQueries = []QueryErrorTest{
1075110751
Query: "SELECT i FROM myhistorytable AS OF MAX(i)",
1075210752
ExpectedErr: sql.ErrInvalidAsOfExpression,
1075310753
},
10754+
{
10755+
Query: "SELECT i FROM myhistorytable AS OF (SELECT 1)",
10756+
ExpectedErrStr: "invalid AS OF expression type",
10757+
},
1075410758
{
1075510759
Query: "SELECT pk FROM one_pk WHERE pk > ?",
1075610760
ExpectedErr: sql.ErrUnboundPreparedStatementVariable,

sql/planbuilder/show.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,7 @@ func (b *Builder) buildAsOfExpr(inScope *scope, time ast.Expr) sql.Expression {
616616
b.handleErr(err)
617617
}
618618
default:
619+
b.handleErr(fmt.Errorf("invalid AS OF expression type"))
619620
}
620621
return b.buildScalar(b.newScope(), time)
621622
}

0 commit comments

Comments
 (0)