File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -114,7 +114,8 @@ impl<'a> SyncOperation<'a> {
114
114
if self . data_tables . contains ( & table_name) {
115
115
let quoted = quote_internal_name ( type_name, false ) ;
116
116
117
- // is_err() is essentially a NULL check here
117
+ // is_err() is essentially a NULL check here.
118
+ // NULL data means no PUT operations found, so we delete the row.
118
119
if data. is_err ( ) {
119
120
// DELETE
120
121
let delete_statement = self
@@ -190,6 +191,7 @@ impl<'a> SyncOperation<'a> {
190
191
"\
191
192
-- 1. Filter oplog by the ops added but not applied yet (oplog b).
192
193
-- We do not do any DISTINCT operation here, since that introduces a temp b-tree.
194
+ -- We filter out duplicates using the GROUP BY below.
193
195
WITH updated_rows AS (
194
196
SELECT b.row_type, b.row_id FROM ps_buckets AS buckets
195
197
CROSS JOIN ps_oplog AS b ON b.bucket = buckets.id
@@ -224,6 +226,7 @@ SELECT
224
226
"\
225
227
-- 1. Filter oplog by the ops added but not applied yet (oplog b).
226
228
-- We do not do any DISTINCT operation here, since that introduces a temp b-tree.
229
+ -- We filter out duplicates using the GROUP BY below.
227
230
WITH
228
231
involved_buckets (id) AS MATERIALIZED (
229
232
SELECT id FROM ps_buckets WHERE ?1 IS NULL
You can’t perform that action at this time.
0 commit comments