mirror of
https://github.com/postgres/postgres.git
synced 2025-06-27 23:21:58 +03:00
Reindent table partitioning code.
We've accumulated quite a bit of stuff with which pgindent is not quite happy in this code; clean it up to provide a less-annoying base for future pgindent runs.
This commit is contained in:
@ -263,7 +263,7 @@ ExecInsert(ModifyTableState *mtstate,
|
||||
Oid newId;
|
||||
List *recheckIndexes = NIL;
|
||||
TupleTableSlot *oldslot = slot,
|
||||
*result = NULL;
|
||||
*result = NULL;
|
||||
|
||||
/*
|
||||
* get the heap tuple out of the tuple table slot, making sure we have a
|
||||
@ -279,19 +279,19 @@ ExecInsert(ModifyTableState *mtstate,
|
||||
/* Determine the partition to heap_insert the tuple into */
|
||||
if (mtstate->mt_partition_dispatch_info)
|
||||
{
|
||||
int leaf_part_index;
|
||||
int leaf_part_index;
|
||||
TupleConversionMap *map;
|
||||
|
||||
/*
|
||||
* Away we go ... If we end up not finding a partition after all,
|
||||
* ExecFindPartition() does not return and errors out instead.
|
||||
* Otherwise, the returned value is to be used as an index into
|
||||
* arrays mt_partitions[] and mt_partition_tupconv_maps[] that
|
||||
* will get us the ResultRelInfo and TupleConversionMap for the
|
||||
* partition, respectively.
|
||||
* Otherwise, the returned value is to be used as an index into arrays
|
||||
* mt_partitions[] and mt_partition_tupconv_maps[] that will get us
|
||||
* the ResultRelInfo and TupleConversionMap for the partition,
|
||||
* respectively.
|
||||
*/
|
||||
leaf_part_index = ExecFindPartition(resultRelInfo,
|
||||
mtstate->mt_partition_dispatch_info,
|
||||
mtstate->mt_partition_dispatch_info,
|
||||
slot,
|
||||
estate);
|
||||
Assert(leaf_part_index >= 0 &&
|
||||
@ -308,7 +308,7 @@ ExecInsert(ModifyTableState *mtstate,
|
||||
if (resultRelInfo->ri_FdwRoutine)
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
|
||||
errmsg("cannot route inserted tuples to a foreign table")));
|
||||
errmsg("cannot route inserted tuples to a foreign table")));
|
||||
|
||||
/* For ExecInsertIndexTuples() to work on the partition's indexes */
|
||||
estate->es_result_relation_info = resultRelInfo;
|
||||
@ -320,14 +320,14 @@ ExecInsert(ModifyTableState *mtstate,
|
||||
map = mtstate->mt_partition_tupconv_maps[leaf_part_index];
|
||||
if (map)
|
||||
{
|
||||
Relation partrel = resultRelInfo->ri_RelationDesc;
|
||||
Relation partrel = resultRelInfo->ri_RelationDesc;
|
||||
|
||||
tuple = do_convert_tuple(tuple, map);
|
||||
|
||||
/*
|
||||
* We must use the partition's tuple descriptor from this
|
||||
* point on, until we're finished dealing with the partition.
|
||||
* Use the dedicated slot for that.
|
||||
* We must use the partition's tuple descriptor from this point
|
||||
* on, until we're finished dealing with the partition. Use the
|
||||
* dedicated slot for that.
|
||||
*/
|
||||
slot = mtstate->mt_partition_tuple_slot;
|
||||
Assert(slot != NULL);
|
||||
@ -1730,12 +1730,12 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags)
|
||||
if (operation == CMD_INSERT &&
|
||||
rel->rd_rel->relkind == RELKIND_PARTITIONED_TABLE)
|
||||
{
|
||||
PartitionDispatch *partition_dispatch_info;
|
||||
ResultRelInfo *partitions;
|
||||
PartitionDispatch *partition_dispatch_info;
|
||||
ResultRelInfo *partitions;
|
||||
TupleConversionMap **partition_tupconv_maps;
|
||||
TupleTableSlot *partition_tuple_slot;
|
||||
int num_parted,
|
||||
num_partitions;
|
||||
TupleTableSlot *partition_tuple_slot;
|
||||
int num_parted,
|
||||
num_partitions;
|
||||
|
||||
ExecSetupPartitionTupleRouting(rel,
|
||||
&partition_dispatch_info,
|
||||
@ -1784,7 +1784,7 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags)
|
||||
{
|
||||
TupleTableSlot *slot;
|
||||
ExprContext *econtext;
|
||||
List *returningList;
|
||||
List *returningList;
|
||||
|
||||
/*
|
||||
* Initialize result tuple slot and assign its rowtype using the first
|
||||
@ -1821,9 +1821,9 @@ ExecInitModifyTable(ModifyTable *node, EState *estate, int eflags)
|
||||
/*
|
||||
* Build a projection for each leaf partition rel. Note that we
|
||||
* didn't build the returningList for each partition within the
|
||||
* planner, but simple translation of the varattnos for each
|
||||
* partition will suffice. This only occurs for the INSERT case;
|
||||
* UPDATE/DELETE are handled above.
|
||||
* planner, but simple translation of the varattnos for each partition
|
||||
* will suffice. This only occurs for the INSERT case; UPDATE/DELETE
|
||||
* are handled above.
|
||||
*/
|
||||
resultRelInfo = mtstate->mt_partitions;
|
||||
returningList = linitial(node->returningLists);
|
||||
@ -2095,7 +2095,8 @@ ExecEndModifyTable(ModifyTableState *node)
|
||||
resultRelInfo);
|
||||
}
|
||||
|
||||
/* Close all the partitioned tables, leaf partitions, and their indices
|
||||
/*
|
||||
* Close all the partitioned tables, leaf partitions, and their indices
|
||||
*
|
||||
* Remember node->mt_partition_dispatch_info[0] corresponds to the root
|
||||
* partitioned table, which we must not try to close, because it is the
|
||||
|
Reference in New Issue
Block a user