SQLiteStmt.execSync should reset the statement on the normal path
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 9.2k
- Forks
- 1.2k
- Avg merge
- 19m
- Merged PRs (30d)
- 4
Description
Should call C.sqlite3_reset(s.s) on the normal return path as well as abnormal. This is because implicit transactions are committed when the statement is reset: https://sqlite.org/lang_transaction.html#implicit_versus_explicit_transactions. If we don't reset the statement, then if the user executes the code like the following:
stmt, _ := conn.PrepareContext(ctx, "INSERT ...")
for ... {
stmt.Exec()
time.Sleep(time.Hour)
}
the INSERT statement may remain uncommitted for one hour, which violates the principle of least astonishment.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in sqlite3.go around lines 1991-2008 and inspect SQLiteStmt.execSync, including its existing abnormal return handling. Confirm the normal path calls C.sqlite3_reset(s.s), then verify the driver tests cover repeated Exec calls on a prepared INSERT and that the transaction is committed before the next iteration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, sqlite
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100