LockRows paths were not preserving the subpath's distribution, so fix
that. Also update minor plan difference (VERBOSE now shows sort key
for the redistribution step).
pathnode->path.parallel_workers = 0;
pathnode->path.rows = subpath->rows;
+ pathnode->path.distribution = copyObject(subpath->distribution);
+
/*
* The result cannot be assumed sorted, since locking might cause the sort
* key columns to be replaced with new values.
-> Remote Subquery Scan on all
Output: t3.val, t3.val2
Distribute results by H: val2
+ Sort Key: t3.val2
-> Sort
Output: t3.val, t3.val2
Sort Key: t3.val2
-> Remote Subquery Scan on all
Output: t1.val, t1.val2
Distribute results by H: val2
+ Sort Key: t1.val2
-> Sort
Output: t1.val, t1.val2
Sort Key: t1.val2
-> Remote Subquery Scan on all
Output: t2.val, t2.val2
Distribute results by H: val2
+ Sort Key: t2.val2
-> Sort
Output: t2.val, t2.val2
Sort Key: t2.val2
-> Seq Scan on public.t2
Output: t2.val, t2.val2
-(36 rows)
+(39 rows)
explain (costs off, num_nodes off, nodes off, verbose on) select * from t1 join t2 on (t1.val2 = t2.val2) join t3 on (t1.val2 = t3.val2) for update;
ERROR: FOR UPDATE is not allowed with joins
select * from p1 order by 1 for update;
a | b
-----+-----
- 77 | 88
55 | 66
+ 77 | 88
111 | 222
123 | 345
(4 rows)