Skip to content

Commit

Permalink
Properly reset prepared statement before reuse
Browse files Browse the repository at this point in the history
Otherwise we'll get a misuse.
  • Loading branch information
helje5 committed Jun 25, 2024
1 parent c6fe35d commit f7a3dd9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Sources/Lighter/Operations/SQLDatabaseChangeOperations.swift
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ extension SQLDatabaseChangeOperations { // MARK: - Update

for record in records {
try bindUpdateAndExecute(record, using: statement, in: db)
sqlite3_reset(statement)
}
}

Expand Down Expand Up @@ -383,6 +384,8 @@ extension SQLDatabaseChangeOperations { // MARK: - Insert
in: db
)
results.append(result)
sqlite3_reset(statement)
sqlite3_reset(fetchStatement)
}
return results
}
Expand Down

0 comments on commit f7a3dd9

Please sign in to comment.