Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ internal struct AgentTransactionGuard: Sendable {
)
case .oracle:
return Savepoint(open: savepointStatement, release: nil, rollback: rollbackStatement)
case .redshift, .duckdb, .redis, .other:
// Teradata has no savepoint.
case .redshift, .duckdb, .redis, .teradata, .other:
return nil
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ internal enum TransactionEngineFamily: String, Hashable, Sendable, CaseIterable
switch self {
case .postgres, .redshift, .cockroach, .duckdb:
return true
case .mysql, .sqlite, .sqlServer, .oracle, .redis, .other:
// Teradata mode rolls back the whole transaction on a failed request and ANSI mode only the request; the
// family cannot see the session's mode, so Teradata keeps the answer it had before it had a family.
case .mysql, .sqlite, .sqlServer, .oracle, .redis, .teradata, .other:
return false
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ struct ManualCommitTests {
#expect(AgentTransactionGuard.protection(family: .duckdb, sessionState: .inTransaction, controlsTransaction: false) == .refuse)
#expect(AgentTransactionGuard.protection(family: .redshift, sessionState: .inTransaction, controlsTransaction: false) == .refuse)
#expect(AgentTransactionGuard.protection(family: .mysql, sessionState: .inTransaction, controlsTransaction: false) == .none)
#expect(AgentTransactionGuard.protection(family: .teradata, sessionState: .inTransaction, controlsTransaction: false) == .none)
#expect(AgentTransactionGuard.protection(family: .postgres, sessionState: .idle, controlsTransaction: false) == .none)
#expect(AgentTransactionGuard.protection(family: .postgres, sessionState: .inTransaction, controlsTransaction: true) == .none)
}
Expand Down
Loading