mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-13 03:12:13 +00:00
Support single-statement conditional updates and as well as batches. This patch almost fully rewrites column_condition.cc, implementing is_satisfied_by(). Most of the remaining complications in column_condition implementation come from the need to properly handle frozen and multi-cell collection in predicates - up until now it was not possible to compare entire collection values between each other. This is further complicated since multi-cell lists and sets are returned as maps. We can no longer assume that the columns fetched by prefetch operation are non-frozen collections. IF EXISTS/IF NOT EXISTS condition fetches all columns, besides, a column may be needed to check other condition. When fetching the old row for LWT or to apply updates on list/columns, we now calculate precisely the list of columns to fetch. The primary key columns are also included in CAS batch result set, and are thus also prefetched (the user needs them to figure out which statements failed to apply). The patch is cross-checked for compatibility with cassandra-3.11.4-1545-g86812fa502 but does deviate from the origin in handling of conditions on static row cells. This is addressed in future series.