[fix](audit) The time field in the audit log table is set to the millisecond level (#31096)

This commit is contained in:
lw112
2024-02-22 00:01:42 +08:00
committed by yiguolei
parent f2a38e6345
commit 70dc40ab3c
2 changed files with 2 additions and 2 deletions

View File

@ -68,7 +68,7 @@ public class InternalSchema {
// audit table
AUDIT_SCHEMA = new ArrayList<>();
AUDIT_SCHEMA.add(new ColumnDef("query_id", TypeDef.createVarchar(48), true));
AUDIT_SCHEMA.add(new ColumnDef("time", TypeDef.create(PrimitiveType.DATETIME), true));
AUDIT_SCHEMA.add(new ColumnDef("time", TypeDef.createDatetimeV2(3), true));
AUDIT_SCHEMA.add(new ColumnDef("client_ip", TypeDef.createVarchar(128), true));
AUDIT_SCHEMA.add(new ColumnDef("user", TypeDef.createVarchar(128), true));
AUDIT_SCHEMA.add(new ColumnDef("catalog", TypeDef.createVarchar(128), true));

View File

@ -148,7 +148,7 @@ public class AuditLoaderPlugin extends Plugin implements AuditPlugin {
private void fillLogBuffer(AuditEvent event, StringBuilder logBuffer) {
logBuffer.append(event.queryId).append("\t");
logBuffer.append(TimeUtils.longToTimeString(event.timestamp)).append("\t");
logBuffer.append(TimeUtils.longToTimeStringWithms(event.timestamp)).append("\t");
logBuffer.append(event.clientIp).append("\t");
logBuffer.append(event.user).append("\t");
logBuffer.append(event.ctl).append("\t");