Skip to content

Commit 9478edc

Browse files
authored
server: fix stats report out of bounds (#1087)
1 parent ece9ebf commit 9478edc

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

libsql-server/src/connection/libsql.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -928,11 +928,17 @@ impl<W: Wal> Connection<W> {
928928
let rows_written = stmt.get_status(StatementStatus::RowsWritten) as u64;
929929

930930
if rows_read >= 10_000 || rows_written >= 1_000 {
931+
let sql = if sql.len() >= 512 {
932+
&sql[..512]
933+
} else {
934+
&sql[..]
935+
};
936+
931937
tracing::info!(
932938
"high read ({}) or write ({}) query: {}",
933939
rows_read,
934940
rows_written,
935-
&sql[..512]
941+
sql
936942
);
937943
}
938944

0 commit comments

Comments
 (0)