From e03a83055d0457d0c58a9382b5791018f5674f52 Mon Sep 17 00:00:00 2001 From: Andres Taylor Date: Tue, 4 Feb 2025 12:15:58 +0100 Subject: [PATCH] check if SelectExprs exists before using Signed-off-by: Andres Taylor --- go/vt/sqlparser/ast_funcs.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/go/vt/sqlparser/ast_funcs.go b/go/vt/sqlparser/ast_funcs.go index 2b062d780c5..47806e4afd4 100644 --- a/go/vt/sqlparser/ast_funcs.go +++ b/go/vt/sqlparser/ast_funcs.go @@ -1273,6 +1273,9 @@ func (node *Select) IsDistinct() bool { // GetColumnCount return SelectExprs count. func (node *Select) GetColumnCount() int { + if node.SelectExprs == nil { + return 0 + } return len(node.SelectExprs.Exprs) }