Skip to content

Commit 6c96308

Browse files
committed
Enable Session.ExecuteBatchCAS() to return underlying scan errors
The patch enables Session.ExecuteBatchCAS() to return an error which may happen during rows scanning. Patch by Bohdan Siryk; reviewed by <> for CASSGO-47
1 parent 37030fb commit 6c96308

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1818

1919
- Change Batch API to be consistent with Query() (CASSGO-7)
2020

21+
- Enable Session.ExecuteBatchCAS() to return underlying scan errors (CASSGO-47)
22+
2123
### Fixed
2224

2325
- Retry policy now takes into account query idempotency (CASSGO-27)

session.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ func (s *Session) ExecuteBatch(batch *Batch) error {
769769
// ExecuteBatchCAS executes a batch operation and returns true if successful and
770770
// an iterator (to scan additional rows if more than one conditional statement)
771771
// was sent.
772-
// Further scans on the interator must also remember to include
772+
// Further scans on the iterator must also remember to include
773773
// the applied boolean as the first argument to *Iter.Scan
774774
func (s *Session) ExecuteBatchCAS(batch *Batch, dest ...interface{}) (applied bool, iter *Iter, err error) {
775775
iter = s.executeBatch(batch)
@@ -785,7 +785,7 @@ func (s *Session) ExecuteBatchCAS(batch *Batch, dest ...interface{}) (applied bo
785785
iter.Scan(&applied)
786786
}
787787

788-
return applied, iter, nil
788+
return applied, iter, iter.err
789789
}
790790

791791
// MapExecuteBatchCAS executes a batch operation much like ExecuteBatchCAS,

0 commit comments

Comments
 (0)