Skip to content

Commit

Permalink
fix: use fetch_add for incrementing depth when creating a savepoint
Browse files Browse the repository at this point in the history
  • Loading branch information
LucianBuzzo committed Jan 7, 2025
1 parent 8c623e2 commit 5546288
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion query-engine/driver-adapters/src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,9 @@ impl QuaintTransaction for JsTransaction {
async fn create_savepoint(&self) -> quaint::Result<()> {
let current_depth = self.depth.load(Ordering::SeqCst);
let new_depth = current_depth + 1;
self.depth.store(new_depth, Ordering::SeqCst);

// Increment the depth value
self.depth.fetch_add(1, Ordering::SeqCst);

let create_savepoint_statement = self.create_savepoint_statement(new_depth);
if self.options().use_phantom_query {
Expand Down

0 comments on commit 5546288

Please sign in to comment.