mattn / mattn/go-sqlite3

BeginTx does not verify TxOptions

Open
#685 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
9.2k
Forks
1.2k
Avg merge
19m
Merged PRs (30d)
4

Description

The documentation for ConnBeginTx.BeginTx says the following:

// This must check opts.Isolation to determine if there is a set
// isolation level. If the driver does not support a non-default
// level and one is set or if there is a non-default isolation level
// that is not supported, an error must be returned.
//
// This must also check opts.ReadOnly to determine if the read-only
// value is true to either set the read-only transaction property if supported
// or return an error if it is not supported.

However, this library simply throws away the provided TxOptions without verifying them (link). This violates the contract. This library must verify that opts.Isolation is sql.LevelDefault and that ReadOnly is false.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read sqlite3_go18.go at the linked ConnBeginTx.BeginTx entry point first, then compare its handling with the database/sql TxOptions contract. Run the repository's relevant Go tests. Done means unsupported isolation or read-only options are rejected rather than silently ignored.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, sqlite
Domain
database
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.