mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bug fixed for issue #2089
This commit is contained in:
@@ -20,7 +20,9 @@ import java.util.List;
|
||||
|
||||
import com.alibaba.druid.sql.SQLUtils;
|
||||
import com.alibaba.druid.sql.ast.*;
|
||||
import com.alibaba.druid.sql.dialect.oracle.ast.OracleSQLObject;
|
||||
import com.alibaba.druid.sql.visitor.SQLASTVisitor;
|
||||
import com.alibaba.druid.util.JdbcConstants;
|
||||
|
||||
public class SQLSelect extends SQLObjectImpl {
|
||||
|
||||
@@ -150,6 +152,18 @@ public class SQLSelect extends SQLObjectImpl {
|
||||
return SQLUtils.toSQLString(this, dbType);
|
||||
}
|
||||
}
|
||||
|
||||
if (parent instanceof OracleSQLObject) {
|
||||
return SQLUtils.toSQLString(this, JdbcConstants.ORACLE);
|
||||
}
|
||||
|
||||
if (query instanceof SQLSelectQueryBlock) {
|
||||
String dbType = ((SQLSelectQueryBlock) query).dbType;
|
||||
|
||||
if (dbType != null) {
|
||||
return SQLUtils.toSQLString(this, dbType);
|
||||
}
|
||||
}
|
||||
|
||||
return super.toString();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user