mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
Merge pull request #3925 from ldming/master
Use isPgsqlDbType to check all pg-like database
This commit is contained in:
@@ -891,9 +891,7 @@ public class SQLUtils {
|
||||
if (MySqlUtils.isKeyword(normalizeName)) {
|
||||
return name;
|
||||
}
|
||||
} else if (JdbcUtils.isPgsqlDbType(dbType)
|
||||
|| JdbcConstants.ENTERPRISEDB.equals(dbType)
|
||||
|| JdbcConstants.POLARDB.equals(dbType)) {
|
||||
} else if (JdbcUtils.isPgsqlDbType(dbType)) {
|
||||
if (PGUtils.isKeyword(normalizeName)) {
|
||||
return name;
|
||||
}
|
||||
|
||||
@@ -84,9 +84,7 @@ public class SQLParserUtils {
|
||||
return new MySqlStatementParser(sql, features);
|
||||
}
|
||||
|
||||
if (JdbcUtils.isPgsqlDbType(dbType)
|
||||
|| JdbcUtils.ENTERPRISEDB.equals(dbType)
|
||||
|| JdbcUtils.POLARDB.equals(dbType)) {
|
||||
if (JdbcUtils.isPgsqlDbType(dbType)) {
|
||||
return new PGSQLStatementParser(sql);
|
||||
}
|
||||
|
||||
@@ -126,9 +124,7 @@ public class SQLParserUtils {
|
||||
return new MySqlExprParser(sql);
|
||||
}
|
||||
|
||||
if (JdbcUtils.isPgsqlDbType(dbType)
|
||||
|| JdbcUtils.ENTERPRISEDB.equals(dbType)
|
||||
|| JdbcUtils.POLARDB.equals(dbType)) {
|
||||
if (JdbcUtils.isPgsqlDbType(dbType)) {
|
||||
return new PGExprParser(sql);
|
||||
}
|
||||
|
||||
@@ -160,9 +156,7 @@ public class SQLParserUtils {
|
||||
return new MySqlLexer(sql);
|
||||
}
|
||||
|
||||
if (JdbcUtils.isPgsqlDbType(dbType)
|
||||
|| JdbcUtils.ENTERPRISEDB.equals(dbType)
|
||||
|| JdbcUtils.POLARDB.equals(dbType)) {
|
||||
if (JdbcUtils.isPgsqlDbType(dbType)) {
|
||||
return new PGLexer(sql);
|
||||
}
|
||||
|
||||
@@ -194,8 +188,7 @@ public class SQLParserUtils {
|
||||
return new MySqlSelectQueryBlock();
|
||||
}
|
||||
|
||||
if (JdbcUtils.POSTGRESQL.equals(dbType)
|
||||
|| JdbcUtils.ENTERPRISEDB.equals(dbType)) {
|
||||
if (JdbcUtils.isPgsqlDbType(dbType)) {
|
||||
return new PGSelectQueryBlock();
|
||||
}
|
||||
|
||||
|
||||
@@ -75,9 +75,7 @@ public final class ExportParameterVisitorUtils {
|
||||
return new MySqlExportParameterVisitor(out);
|
||||
}
|
||||
|
||||
if (JdbcUtils.POSTGRESQL.equals(dbType)
|
||||
|| JdbcUtils.ENTERPRISEDB.equals(dbType)
|
||||
|| JdbcUtils.POLARDB.equals(dbType)) {
|
||||
if (JdbcUtils.POSTGRESQL.equals(dbType)) {
|
||||
return new PGExportParameterVisitor(out);
|
||||
}
|
||||
|
||||
|
||||
@@ -274,9 +274,7 @@ public class ParameterizedOutputVisitorUtils {
|
||||
}
|
||||
|
||||
|
||||
if (JdbcUtils.isPgsqlDbType(dbType)
|
||||
|| JdbcUtils.ENTERPRISEDB.equals(dbType)
|
||||
|| JdbcUtils.POLARDB.equals(dbType)) {
|
||||
if (JdbcUtils.isPgsqlDbType(dbType)) {
|
||||
return new PGOutputVisitor(out, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -168,9 +168,7 @@ public class SQLEvalVisitorUtils {
|
||||
return new OracleEvalVisitor();
|
||||
}
|
||||
|
||||
if (JdbcUtils.isPgsqlDbType(dbType)
|
||||
|| JdbcConstants.ENTERPRISEDB.equals(dbType)
|
||||
|| JdbcConstants.POLARDB.equals(dbType)) {
|
||||
if (JdbcUtils.isPgsqlDbType(dbType)) {
|
||||
return new PGEvalVisitor();
|
||||
}
|
||||
|
||||
|
||||
@@ -906,7 +906,8 @@ public final class JdbcUtils implements JdbcConstants {
|
||||
|
||||
public static boolean isPgsqlDbType(String dbType) {
|
||||
return JdbcUtils.POSTGRESQL.equals(dbType) || //
|
||||
JdbcUtils.ENTERPRISEDB.equals(dbType);
|
||||
JdbcUtils.ENTERPRISEDB.equals(dbType) || //
|
||||
JdbcUtils.POLARDB.equals(dbType);
|
||||
}
|
||||
|
||||
public static boolean isSqlserverDbType(String dbType) {
|
||||
|
||||
@@ -148,9 +148,7 @@ public class WallFilter extends FilterAdapter implements WallFilterMBean {
|
||||
}
|
||||
|
||||
provider = new SQLServerWallProvider(config);
|
||||
} else if (JdbcUtils.isPgsqlDbType(dbType)
|
||||
|| JdbcUtils.ENTERPRISEDB.equals(dbType)
|
||||
|| JdbcUtils.POLARDB.equals(dbType)) {
|
||||
} else if (JdbcUtils.isPgsqlDbType(dbType)) {
|
||||
if (config == null) {
|
||||
config = new WallConfig(PGWallProvider.DEFAULT_CONFIG_DIR);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user