Copilot commented on code in PR #15275:
URL: https://github.com/apache/iotdb/pull/15275#discussion_r2052316029
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/connector/protocol/writeback/WriteBackConnector.java:
##########
@@ -310,9 +361,14 @@ public void close() throws Exception {
}
}
- private TSStatus executeStatementForTableModel(Statement statement, String
dataBaseName) {
+ private TSStatus executeStatementForTableModel(
+ Statement statement, String dataBaseName, final String userName) {
session.setDatabaseName(dataBaseName);
session.setSqlDialect(IClientSession.SqlDialect.TABLE);
+ final String originalUerName = session.getDatabaseName();
Review Comment:
In executeStatementForTableModel, the variable 'originalUerName' is assigned
using session.getDatabaseName() instead of session.getUsername(), which may
lead to incorrect restoration of the username. Please change it to
session.getUsername().
```suggestion
final String originalUerName = session.getUsername();
```
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/connector/protocol/writeback/WriteBackConnector.java:
##########
@@ -310,9 +361,14 @@ public void close() throws Exception {
}
}
- private TSStatus executeStatementForTableModel(Statement statement, String
dataBaseName) {
+ private TSStatus executeStatementForTableModel(
+ Statement statement, String dataBaseName, final String userName) {
session.setDatabaseName(dataBaseName);
session.setSqlDialect(IClientSession.SqlDialect.TABLE);
+ final String originalUerName = session.getDatabaseName();
Review Comment:
[nitpick] The variable name 'originalUerName' appears to be misspelled. It
should be renamed to 'originalUserName' for improved clarity.
```suggestion
final String originalUserName = session.getDatabaseName();
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]