Skip to content

Commit c907d6e

Browse files
committed
all tests pass
1 parent c0e3513 commit c907d6e

File tree

2 files changed

+8
-15
lines changed

2 files changed

+8
-15
lines changed

expected/pathman_update_node.out

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ EXPLAIN (COSTS OFF) UPDATE test_update_node.test_range SET val = 5 WHERE val = 1
1818
QUERY PLAN
1919
-------------------------------------------------------------------
2020
Update on test_range_2
21-
-> Custom Scan (PartitionRouter)
22-
-> Custom Scan (PartitionFilter)
21+
-> Custom Scan (PartitionFilter)
22+
-> Custom Scan (PartitionRouter)
2323
-> Bitmap Heap Scan on test_range_2
2424
Recheck Cond: (val = '15'::numeric)
2525
-> Bitmap Index Scan on test_range_2_val_idx
@@ -31,8 +31,8 @@ EXPLAIN (COSTS OFF) UPDATE test_update_node.test_range SET val = 14 WHERE val =
3131
QUERY PLAN
3232
-------------------------------------------------------------------
3333
Update on test_range_2
34-
-> Custom Scan (PartitionRouter)
35-
-> Custom Scan (PartitionFilter)
34+
-> Custom Scan (PartitionFilter)
35+
-> Custom Scan (PartitionRouter)
3636
-> Bitmap Heap Scan on test_range_2
3737
Recheck Cond: (val = '15'::numeric)
3838
-> Bitmap Index Scan on test_range_2_val_idx

src/partition_router.c

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ bool pg_pathman_enable_partition_router = true;
2828
CustomScanMethods partition_router_plan_methods;
2929
CustomExecMethods partition_router_exec_methods;
3030

31-
static TupleTableSlot *ExecDeleteInternal(TupleTableSlot *slot,
31+
static TupleTableSlot *router_delete_tuple(TupleTableSlot *slot,
3232
ItemPointer tupleid,
3333
EPQState *epqstate,
3434
EState *estate);
@@ -187,23 +187,16 @@ partition_router_exec(CustomScanState *node)
187187
else
188188
elog(ERROR, UPDATE_NODE_NAME " cannot handle relkind %u", relkind);
189189

190-
elog(INFO, "deleting (%d, %d) from table: %s",
191-
ItemPointerGetBlockNumber(&ctid),
192-
ItemPointerGetOffsetNumber(&ctid),
193-
get_rel_name(RelationGetRelid(current_rri->ri_RelationDesc)));
194-
195190
/* Magic: replace parent's ResultRelInfo with ours */
196191
estate->es_result_relation_info = current_rri;
197192

198193
/* Delete tuple from old partition */
199194
Assert(ItemPointerIsValid(&ctid));
200-
slot = ExecDeleteInternal(slot, &ctid, &state->epqstate, estate);
195+
slot = router_delete_tuple(slot, &ctid, &state->epqstate, estate);
201196

197+
/* We require a tuple */
202198
if (TupIsNull(slot))
203-
{
204-
elog(INFO, "oops, deleted, taking next tuple!");
205199
goto take_next_tuple;
206-
}
207200

208201
/* Tuple will be inserted by ModifyTable */
209202
return ExecFilterJunk(state->junkfilter, slot);
@@ -244,7 +237,7 @@ partition_router_explain(CustomScanState *node, List *ancestors, ExplainState *e
244237
*/
245238

246239
static TupleTableSlot *
247-
ExecDeleteInternal(TupleTableSlot *slot,
240+
router_delete_tuple(TupleTableSlot *slot,
248241
ItemPointer tupleid,
249242
EPQState *epqstate,
250243
EState *estate)

0 commit comments

Comments
 (0)