This is an automated email from the ASF dual-hosted git repository. haonan pushed a commit to branch fix_auditLogger_npe in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 7e45f4774fc0f14a0bcead29cebe10e87a8fcdf9 Author: HTHou <[email protected]> AuthorDate: Wed May 29 11:09:12 2024 +0800 Fix AuditLogger may cause IoTDB read only when session using incorrent password --- .../src/main/java/org/apache/iotdb/db/audit/AuditLogger.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/audit/AuditLogger.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/audit/AuditLogger.java index 7c17b1bfdbc..4b3882c4218 100644 --- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/audit/AuditLogger.java +++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/audit/AuditLogger.java @@ -90,9 +90,9 @@ public class AuditLogger { insertStatement.setAligned(false); insertStatement.setValues( new Object[] { - new Binary(log, TSFileConfig.STRING_CHARSET), - new Binary(username, TSFileConfig.STRING_CHARSET), - new Binary(address, TSFileConfig.STRING_CHARSET) + new Binary(log == null ? "null" : log, TSFileConfig.STRING_CHARSET), + new Binary(address == null ? "null" : address, TSFileConfig.STRING_CHARSET), + new Binary(username == null ? "null" : username, TSFileConfig.STRING_CHARSET) }); insertStatement.setDataTypes( new TSDataType[] {TSDataType.TEXT, TSDataType.TEXT, TSDataType.TEXT});
