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) }