From 3eb08f485907f160389514816fcf9d0053568887 Mon Sep 17 00:00:00 2001 From: Bruno Calza Date: Thu, 16 Feb 2023 15:44:27 -0300 Subject: [PATCH] fix: read query validation not considering compound select [testnetdeploy] Signed-off-by: Bruno Calza --- pkg/parsing/impl/validator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/parsing/impl/validator.go b/pkg/parsing/impl/validator.go index a329cd32..a7012e18 100644 --- a/pkg/parsing/impl/validator.go +++ b/pkg/parsing/impl/validator.go @@ -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") }