Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: disallow readonly mode for snowflake driver (#3980)

Tianzhou (天舟)414ea304cc26
diff --git a/plugin/db/util/driverutil.go b/plugin/db/util/driverutil.go
index 002cf144ea..8e7c82592f 100644
--- a/plugin/db/util/driverutil.go
+++ b/plugin/db/util/driverutil.go
@@ -343,7 +343,9 @@ func Query(ctx context.Context, dbType db.Type, sqldb *sql.DB, statement string,
// TiDB doesn't support READ ONLY transactions. We have to skip the flag for it.
// https://github.com/pingcap/tidb/issues/34626
// Clickhouse doesn't support READ ONLY transactions (Error: sql: driver does not support read-only transactions).
- if dbType == db.TiDB || dbType == db.ClickHouse {
+ // Snowflake doesn't support READ ONLY transactions.
+ // https://github.com/snowflakedb/gosnowflake/blob/0450f0b16a4679b216baecd3fd6cdce739dbb683/connection.go#L166
+ if dbType == db.TiDB || dbType == db.ClickHouse || dbType == db.Snowflake {
readOnly = false
}
tx, err := sqldb.BeginTx(ctx, &sql.TxOptions{ReadOnly: readOnly})