Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BeginTx does not verify TxOptions #685

Open
rittneje opened this issue Jan 20, 2019 · 2 comments
Open

BeginTx does not verify TxOptions #685

rittneje opened this issue Jan 20, 2019 · 2 comments

Comments

@rittneje
Copy link
Collaborator

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.

@nevivurn
Copy link

+1 to this. Is there some reasoning behind the current behavior, like breaking code that (wrongly) assumes that go-sqlite3 supports these kinds of transactions?

@brandond
Copy link

brandond commented Nov 8, 2024

Just ran into this myself.

brandond added a commit to brandond/kine that referenced this issue Nov 8, 2024
brandond added a commit to k3s-io/kine that referenced this issue Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants