Skip to content

Commit

Permalink
Merge pull request #462 from tablelandnetwork/bcalza/fixreadvalidation
Browse files Browse the repository at this point in the history
fix: read query validation not considering compound select
  • Loading branch information
brunocalza authored Feb 16, 2023
2 parents 78302d1 + 3eb08f4 commit ff8d4a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/parsing/impl/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ func (pp *QueryValidator) ValidateReadQuery(query string) (parsing.ReadStmt, err
return nil, fmt.Errorf("empty-statement check: %w", err)
}

if _, ok := ast.Statements[0].(*sqlparser.Select); !ok {
if _, ok := ast.Statements[0].(sqlparser.ReadStatement); !ok {
return nil, errors.New("the query isn't a read-query")
}

Expand Down

0 comments on commit ff8d4a4

Please sign in to comment.