Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion parser/parser_alter.go
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,10 @@ func (p *Parser) parseAlterTableModify(pos Pos) (AlterTableClause, error) {
}, nil
case p.matchKeyword(KeywordQuery):
_ = p.lexer.consumeToken()
selectQuery, _ := p.parseSelectQuery(pos)
selectQuery, err := p.parseSelectQuery(pos)
if err != nil {
return nil, err
}
return &AlterTableModifyQuery{
ModifyPos: pos,
StatementEnd: selectQuery.End(),
Expand Down
1 change: 1 addition & 0 deletions parser/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ func TestParser_InvalidSyntax(t *testing.T) {
"SELECT n FROM t ORDER BY n WITH FILL STALENESS", // STALENESS without value
"SELECT n FROM t ORDER BY n WITH FILL INTERPOLATE (x", // Missing closing paren
"SELECT n FROM t ORDER BY n WITH FILL INTERPOLATE x AS x + 1", // Missing parens around column list
"ALTER TABLE foo_mv MODIFY QUERY AS SELECT * FROM baz", // MODIFY QUERY followed by an invalid query
}
for _, sql := range invalidSQLs {
parser := NewParser(sql)
Expand Down