diff options
author | Robert Haas <rhaas@postgresql.org> | 2016-12-13 10:54:52 -0500 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2016-12-13 10:59:14 -0500 |
commit | 4b9a98e154cec81849af24091443747a6057c968 (patch) | |
tree | 10523af2176f83d4e4c25c62bce502bb018652db /src/backend/executor/nodeModifyTable.c | |
parent | acddbe221b084956a0efd6e4b6c6586e8fd994d7 (diff) | |
download | postgresql-4b9a98e154cec81849af24091443747a6057c968.tar.gz postgresql-4b9a98e154cec81849af24091443747a6057c968.zip |
Clean up code, comments, and formatting for table partitioning.
Amit Langote, plus pgindent-ing by me. Inspired in part by review
comments from Tomas Vondra.
Diffstat (limited to 'src/backend/executor/nodeModifyTable.c')
-rw-r--r-- | src/backend/executor/nodeModifyTable.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/backend/executor/nodeModifyTable.c b/src/backend/executor/nodeModifyTable.c index c0b58d1841c..ec440b353d0 100644 --- a/src/backend/executor/nodeModifyTable.c +++ b/src/backend/executor/nodeModifyTable.c @@ -1718,26 +1718,26 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags) if (operation == CMD_INSERT && rel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE) { - PartitionDispatch *pd; int i, j, - num_parted, - num_leaf_parts; + num_parted; List *leaf_parts; ListCell *cell; ResultRelInfo *leaf_part_rri; - /* Form the partition node tree and lock partitions */ - pd = RelationGetPartitionDispatchInfo(rel, RowExclusiveLock, - &num_parted, &leaf_parts); - mtstate->mt_partition_dispatch_info = pd; + /* Get the tuple-routing information and lock partitions */ + mtstate->mt_partition_dispatch_info = + RelationGetPartitionDispatchInfo(rel, RowExclusiveLock, + &num_parted, + &leaf_parts); mtstate->mt_num_dispatch = num_parted; - num_leaf_parts = list_length(leaf_parts); - mtstate->mt_num_partitions = num_leaf_parts; + mtstate->mt_num_partitions = list_length(leaf_parts); mtstate->mt_partitions = (ResultRelInfo *) - palloc0(num_leaf_parts * sizeof(ResultRelInfo)); + palloc0(mtstate->mt_num_partitions * + sizeof(ResultRelInfo)); mtstate->mt_partition_tupconv_maps = (TupleConversionMap **) - palloc0(num_leaf_parts * sizeof(TupleConversionMap *)); + palloc0(mtstate->mt_num_partitions * + sizeof(TupleConversionMap *)); leaf_part_rri = mtstate->mt_partitions; i = j = 0; |