This is an automated email from the ASF dual-hosted git repository.
jackietien pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new 5cd607bb5e8 Change database in SessionConnection while using db
5cd607bb5e8 is described below
commit 5cd607bb5e83b37b62a6643c003b1c7638f88da0
Author: Jackie Tien <[email protected]>
AuthorDate: Tue Oct 8 18:01:07 2024 +0800
Change database in SessionConnection while using db
---
.../src/main/java/org/apache/iotdb/session/SessionConnection.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git
a/iotdb-client/session/src/main/java/org/apache/iotdb/session/SessionConnection.java
b/iotdb-client/session/src/main/java/org/apache/iotdb/session/SessionConnection.java
index d9871d4b4e2..ef2b69baf6c 100644
---
a/iotdb-client/session/src/main/java/org/apache/iotdb/session/SessionConnection.java
+++
b/iotdb-client/session/src/main/java/org/apache/iotdb/session/SessionConnection.java
@@ -108,7 +108,7 @@ public class SessionConnection {
private final String sqlDialect;
- private final String database;
+ private String database;
// ms is 1_000, us is 1_000_000, ns is 1_000_000_000
private int timeFactor = 1_000;
@@ -520,7 +520,9 @@ public class SessionConnection {
request.setStatementId(statementId);
TSExecuteStatementResp resp = client.executeUpdateStatementV2(request);
if (resp.isSetDatabase()) {
- session.changeDatabase(resp.getDatabase());
+ String dbName = resp.getDatabase();
+ session.changeDatabase(dbName);
+ this.database = dbName;
}
return resp.status;
}