File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
main/java/com/alibaba/druid/sql/visitor
test/resources/bvt/parser/sqlserver Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -4927,7 +4927,12 @@ public boolean visit(SQLAllExpr x) {
4927
4927
4928
4928
@ Override
4929
4929
public boolean visit (SQLInSubQueryExpr x ) {
4930
- x .getExpr ().accept (this );
4930
+ if (x .getExpr () instanceof SQLIdentifierExpr ) {
4931
+ String columnName = replaceQuota (((SQLIdentifierExpr ) x .getExpr ()).getName ());
4932
+ printName0 (columnName );
4933
+ } else {
4934
+ x .getExpr ().accept (this );
4935
+ }
4931
4936
if (x .isNot ()) {
4932
4937
if (x .isGlobal ()) {
4933
4938
print0 (ucase ? " GLOBAL NOT IN (" : " global not in (" );
Original file line number Diff line number Diff line change
1
+ select * from [test].[test] where [a] in (select [c] from [test])
2
+ --------------------
3
+ SELECT *
4
+ FROM [test].[test]
5
+ WHERE [a] IN (
6
+ SELECT [c]
7
+ FROM [test]
8
+ )
9
+ ------------------------------------------------------------------------------------------------------------------------
1
10
select * from [test].[test]
2
11
--------------------
3
12
SELECT *
You can’t perform that action at this time.
0 commit comments