diff --git a/pkg/parser/parser.go b/pkg/parser/parser.go index b125d4c2f330f..5a7ca0ad6c737 100644 --- a/pkg/parser/parser.go +++ b/pkg/parser/parser.go @@ -19989,7 +19989,7 @@ yynewstate: var setOprList []ast.Node switch x := yyS[yypt-1].expr.(*ast.SubqueryExpr).Query.(type) { case *ast.SelectStmt: - setOprList = []ast.Node{&ast.SetOprSelectList{Selects: []ast.Node{x}}} + setOprList = []ast.Node{&ast.SetOprSelectList{Selects: []ast.Node{x}, With: x.With}} case *ast.SetOprStmt: setOprList = []ast.Node{&ast.SetOprSelectList{Selects: x.SelectList.Selects, With: x.With, Limit: x.Limit, OrderBy: x.OrderBy}} } @@ -20002,7 +20002,7 @@ yynewstate: var setOprList []ast.Node switch x := yyS[yypt-1].expr.(*ast.SubqueryExpr).Query.(type) { case *ast.SelectStmt: - setOprList = []ast.Node{&ast.SetOprSelectList{Selects: []ast.Node{x}}} + setOprList = []ast.Node{&ast.SetOprSelectList{Selects: []ast.Node{x}, With: x.With}} case *ast.SetOprStmt: setOprList = []ast.Node{&ast.SetOprSelectList{Selects: x.SelectList.Selects, With: x.With, Limit: x.Limit, OrderBy: x.OrderBy}} } @@ -20015,7 +20015,7 @@ yynewstate: var setOprList []ast.Node switch x := yyS[yypt-2].expr.(*ast.SubqueryExpr).Query.(type) { case *ast.SelectStmt: - setOprList = []ast.Node{&ast.SetOprSelectList{Selects: []ast.Node{x}}} + setOprList = []ast.Node{&ast.SetOprSelectList{Selects: []ast.Node{x}, With: x.With}} case *ast.SetOprStmt: setOprList = []ast.Node{&ast.SetOprSelectList{Selects: x.SelectList.Selects, With: x.With, Limit: x.Limit, OrderBy: x.OrderBy}} } diff --git a/pkg/parser/parser.y b/pkg/parser/parser.y index 152433b721bbd..73fecdca10c42 100644 --- a/pkg/parser/parser.y +++ b/pkg/parser/parser.y @@ -10368,7 +10368,7 @@ SetOprStmtWithLimitOrderBy: var setOprList []ast.Node switch x := $1.(*ast.SubqueryExpr).Query.(type) { case *ast.SelectStmt: - setOprList = []ast.Node{&ast.SetOprSelectList{Selects: []ast.Node{x}}} + setOprList = []ast.Node{&ast.SetOprSelectList{Selects: []ast.Node{x}, With: x.With}} case *ast.SetOprStmt: setOprList = []ast.Node{&ast.SetOprSelectList{Selects: x.SelectList.Selects, With: x.With, Limit: x.Limit, OrderBy: x.OrderBy}} } @@ -10381,7 +10381,7 @@ SetOprStmtWithLimitOrderBy: var setOprList []ast.Node switch x := $1.(*ast.SubqueryExpr).Query.(type) { case *ast.SelectStmt: - setOprList = []ast.Node{&ast.SetOprSelectList{Selects: []ast.Node{x}}} + setOprList = []ast.Node{&ast.SetOprSelectList{Selects: []ast.Node{x}, With: x.With}} case *ast.SetOprStmt: setOprList = []ast.Node{&ast.SetOprSelectList{Selects: x.SelectList.Selects, With: x.With, Limit: x.Limit, OrderBy: x.OrderBy}} } @@ -10420,7 +10420,7 @@ SetOprClause: var setOprList []ast.Node switch x := $1.(*ast.SubqueryExpr).Query.(type) { case *ast.SelectStmt: - setOprList = []ast.Node{&ast.SetOprSelectList{Selects: []ast.Node{x}}} + setOprList = []ast.Node{&ast.SetOprSelectList{Selects: []ast.Node{x}, With: x.With}} case *ast.SetOprStmt: setOprList = []ast.Node{&ast.SetOprSelectList{Selects: x.SelectList.Selects, With: x.With, Limit: x.Limit, OrderBy: x.OrderBy}} }