fix: inner 637(cherry pick from master #2239) (#2254)

* fix: inner 637
add the judgment of connection

* fix: inner 637
The connection is closed and the column value is null
This commit is contained in:
LUA
2020-11-06 10:48:34 +08:00
committed by GitHub
parent 984b353718
commit ab7bb3b096

View File

@@ -213,13 +213,15 @@ public final class ShowBackend {
row.add(c.getCharsetName().getClient().getBytes());
row.add(c.getCharsetName().getCollation().getBytes());
row.add(c.getCharsetName().getResults().getBytes());
row.add((c.getBackendService().getTxIsolation() + "").getBytes());
row.add((c.getBackendService().isAutocommit() + "").getBytes());
row.add(StringUtil.encode(c.getBackendService().getStringOfSysVariables(), charset));
row.add(StringUtil.encode(c.getBackendService().getStringOfUsrVariables(), charset));
row.add(StringUtil.encode(c.getBackendService().getXaStatus().toString(), charset));
row.add(c.isClosed() ? null : (c.getBackendService().getTxIsolation() + "").getBytes());
row.add(c.isClosed() ? null : (c.getBackendService().isAutocommit() + "").getBytes());
row.add(c.isClosed() ? null : StringUtil.encode(c.getBackendService().getStringOfSysVariables(), charset));
row.add(c.isClosed() ? null : StringUtil.encode(c.getBackendService().getStringOfUsrVariables(), charset));
row.add(c.isClosed() ? null : StringUtil.encode(c.getBackendService().getXaStatus().toString(), charset));
row.add(StringUtil.encode(FormatUtil.formatDate(c.getPoolDestroyedTime()), charset));
if (state == PooledConnection.INITIAL) {
if (c.isClosed()) {
row.add(null);
} else if (state == PooledConnection.INITIAL) {
ResponseHandler handler = c.getBackendService().getResponseHandler();
row.add(handler instanceof HeartbeatSQLJob ? "true".getBytes() : "false".getBytes());
} else {