go-sqlite3
go-sqlite3 copied to clipboard
BeginTx does not verify TxOptions
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.
+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?