mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bug fixed for concurrent & sql schema stat
This commit is contained in:
@@ -39,7 +39,7 @@ public final class ConnectionHolder {
|
||||
private final List<ConnectionEventListener> connectionEventListeners = new CopyOnWriteArrayList<ConnectionEventListener>();
|
||||
private final List<StatementEventListener> statementEventListeners = new CopyOnWriteArrayList<StatementEventListener>();
|
||||
private final long connecttimeMillis;
|
||||
private long lastActiveTimeMillis;
|
||||
private transient long lastActiveTimeMillis;
|
||||
private long useCount = 0;
|
||||
|
||||
private PreparedStatementPool statementPool;
|
||||
@@ -67,14 +67,15 @@ public final class ConnectionHolder {
|
||||
this.lastActiveTimeMillis = connecttimeMillis;
|
||||
|
||||
this.underlyingAutoCommit = conn.getAutoCommit();
|
||||
this.underlyingHoldability = conn.getHoldability();
|
||||
this.underlyingHoldability = conn.getHoldability();
|
||||
this.underlyingReadOnly = conn.isReadOnly();
|
||||
try {
|
||||
this.underlyingTransactionIsolation = conn.getTransactionIsolation();
|
||||
} catch (SQLException e) {
|
||||
if ("com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException".equals(e.getClass().getName()));
|
||||
if ("com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException".equals(e.getClass().getName()))
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
this.defaultHoldability = underlyingHoldability;
|
||||
this.defaultTransactionIsolation = underlyingTransactionIsolation;
|
||||
this.defaultAutoCommit = underlyingAutoCommit;
|
||||
|
||||
-3
@@ -318,7 +318,6 @@ public class OracleSchemaStatVisitor extends SchemaStatVisitor implements Oracle
|
||||
}
|
||||
|
||||
public void endVisit(OracleUpdateStatement x) {
|
||||
clearAliasMap();
|
||||
}
|
||||
|
||||
public boolean visit(OracleDeleteStatement x) {
|
||||
@@ -326,7 +325,6 @@ public class OracleSchemaStatVisitor extends SchemaStatVisitor implements Oracle
|
||||
}
|
||||
|
||||
public void endVisit(OracleDeleteStatement x) {
|
||||
clearAliasMap();
|
||||
}
|
||||
|
||||
public boolean visit(OracleSelectQueryBlock x) {
|
||||
@@ -1035,7 +1033,6 @@ public class OracleSchemaStatVisitor extends SchemaStatVisitor implements Oracle
|
||||
|
||||
@Override
|
||||
public void endVisit(OracleMergeStatement x) {
|
||||
clearAliasMap();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -723,7 +723,6 @@ public class SchemaStatVisitor extends SQLASTVisitorAdapter {
|
||||
}
|
||||
|
||||
public void endVisit(SQLSelectStatement x) {
|
||||
clearAliasMap();
|
||||
}
|
||||
|
||||
public boolean visit(SQLSubqueryTableSource x) {
|
||||
@@ -897,11 +896,10 @@ public class SchemaStatVisitor extends SQLASTVisitorAdapter {
|
||||
}
|
||||
|
||||
public void endVisit(SQLDeleteStatement x) {
|
||||
clearAliasMap();
|
||||
|
||||
}
|
||||
|
||||
public void endVisit(SQLUpdateStatement x) {
|
||||
clearAliasMap();
|
||||
}
|
||||
|
||||
public boolean visit(SQLCreateTableStatement x) {
|
||||
|
||||
@@ -337,7 +337,26 @@ public class TableStat {
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return this.column.toString() + " " + this.operator;
|
||||
StringBuffer buf = new StringBuffer();
|
||||
buf.append(this.column.toString());
|
||||
buf.append(' ');
|
||||
buf.append(this.operator);
|
||||
|
||||
if (values.size() == 1) {
|
||||
buf.append(' ');
|
||||
buf.append(String.valueOf(this.values.get(0)));
|
||||
} else if (values.size() > 0) {
|
||||
buf.append(" (");
|
||||
for (int i = 0; i < values.size(); ++i) {
|
||||
if (i != 0) {
|
||||
buf.append(", ");
|
||||
}
|
||||
buf.append(String.valueOf(values.get(i)));
|
||||
}
|
||||
buf.append(")");
|
||||
}
|
||||
|
||||
return buf.toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user