SQL Expressions: allow ParenSelect in queries (#102807)

sql_expressions: allow ParenSelect
This commit is contained in:
Kyle Brandt
2025-03-25 12:19:52 -04:00
committed by GitHub
parent 13058d2715
commit 0f6aff2057
2 changed files with 6 additions and 1 deletions
+1 -1
View File
@@ -96,7 +96,7 @@ func allowedNode(node sqlparser.SQLNode) (b bool) {
case *sqlparser.JoinTableExpr, sqlparser.JoinCondition:
return
case *sqlparser.Select, sqlparser.SelectExprs:
case *sqlparser.Select, sqlparser.SelectExprs, *sqlparser.ParenSelect:
return
case *sqlparser.SetOp:
+5
View File
@@ -32,6 +32,11 @@ func TestAllowQuery(t *testing.T) {
q: example_all_allowed_functions,
err: nil,
},
{
name: "paren select allowed",
q: `(SELECT * FROM a_table) UNION ALL (SELECT * FROM a_table2)`,
err: nil,
},
}
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {