Skip to content

Commit b7cc2b8

Browse files
PThorpe92penberg
authored andcommitted
libsql: Fix total_changes accumulation for SQL over HTTP batch execution
The batch_inner() updates affected_row_count but never adds it to total_changes. Only finalize() did, so total_changes was missing the contributions of all intermediate batch/execute operations.
1 parent 99e6ad3 commit b7cc2b8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

libsql/src/hrana/stream.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,9 @@ where
163163
self.inner
164164
.affected_row_count
165165
.store(result.affected_row_count, Ordering::SeqCst);
166+
self.inner
167+
.total_changes
168+
.fetch_add(result.affected_row_count, Ordering::SeqCst);
166169
if let Some(last_insert_rowid) = result.last_insert_rowid {
167170
self.inner
168171
.last_insert_rowid

0 commit comments

Comments
 (0)