Skip to content

Commit

Permalink
[fix](auditloader plugin): fix bug for AuditLoaderPlugin that stmt ap…
Browse files Browse the repository at this point in the history
…pears truncated when stmt contains '\n'. (apache#12627)

Co-authored-by: wangxiangyu@360shuke.com <wangxiangyu@360shuke.com>
  • Loading branch information
dutyu and wangxiangyu@360shuke.com authored Sep 16, 2022
1 parent 380e369 commit 20de8ac
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ private void assembleAudit(AuditEvent event) {
auditBuffer.append(event.peakMemoryBytes).append("\t");
// trim the query to avoid too long
// use `getBytes().length` to get real byte length
String stmt = truncateByBytes(event.stmt).replace("\t", " ");
String stmt = truncateByBytes(event.stmt).replace("\n", " ").replace("\t", " ");
LOG.debug("receive audit event with stmt: {}", stmt);
auditBuffer.append(stmt).append("\n");
}
Expand Down

0 comments on commit 20de8ac

Please sign in to comment.