Force metadata retrieval for CAS queries

... otherwise the [applied] column is not noticed
and setting of Iter.applied is skipped.
This commit is contained in:
Drahflow
2022-02-21 15:15:05 +01:00
committed by Michal Jan Matczuk
parent 8054b9d47b
commit 4c67e8b586

View File

@@ -237,6 +237,7 @@ func (q *Queryx) ExecRelease() error {
// ExecCAS executes the Lightweight Transaction query, returns whether query was applied.
// See: https://docs.scylladb.com/using-scylla/lwt/ for more details.
func (q *Queryx) ExecCAS() (applied bool, err error) {
q.NoSkipMetadata()
iter := q.Iter().StructOnly()
if err := iter.Get(&struct{}{}); err != nil {
return false, err
@@ -287,6 +288,7 @@ func (q *Queryx) GetCAS(dest interface{}) (applied bool, err error) {
return false, q.err
}
q.NoSkipMetadata()
iter := q.Iter()
if err := iter.Get(dest); err != nil {
return false, err