Fix style

talha_testpg14
Sait Talha Nisanci 2021-08-25 17:17:16 +03:00
parent 42e41900b3
commit 23131a52cd
17 changed files with 56 additions and 40 deletions

View File

@ -233,6 +233,7 @@ AppendStatTypes(StringInfo buf, CreateStatsStmt *stmt)
appendStringInfoString(buf, ")"); appendStringInfoString(buf, ")");
} }
#if PG_VERSION_NUM >= PG_VERSION_14 #if PG_VERSION_NUM >= PG_VERSION_14
static void static void
AppendColumnNames(StringInfo buf, CreateStatsStmt *stmt) AppendColumnNames(StringInfo buf, CreateStatsStmt *stmt)
@ -251,6 +252,8 @@ AppendColumnNames(StringInfo buf, CreateStatsStmt *stmt)
} }
} }
} }
#else #else
static void static void
AppendColumnNames(StringInfo buf, CreateStatsStmt *stmt) AppendColumnNames(StringInfo buf, CreateStatsStmt *stmt)
@ -277,6 +280,8 @@ AppendColumnNames(StringInfo buf, CreateStatsStmt *stmt)
} }
} }
} }
#endif #endif
static void static void

View File

@ -286,6 +286,7 @@ ExplainSubPlans(DistributedPlan *distributedPlan, ExplainState *es)
PlannedStmt *plan = subPlan->plan; PlannedStmt *plan = subPlan->plan;
IntoClause *into = NULL; IntoClause *into = NULL;
ParamListInfo params = NULL; ParamListInfo params = NULL;
/* /*
* With PG14, we need to provide a string here, * With PG14, we need to provide a string here,
* for now we put an empty string, which is valid according to postgres. * for now we put an empty string, which is valid according to postgres.

View File

@ -643,22 +643,27 @@ ModifyPartialQuerySupported(Query *queryTree, bool multiShardQuery,
} }
else else
{ {
if (commandType == CMD_UPDATE) { if (commandType == CMD_UPDATE)
{
/* /*
* For * For
*/ */
RangeTblEntry* resultRTE = ExtractResultRelationRTE(queryTree); RangeTblEntry *resultRTE = ExtractResultRelationRTE(queryTree);
/* /*
* FirstLowInvalidHeapAttributeNumber is added as an offset to rte->updatedCols. * FirstLowInvalidHeapAttributeNumber is added as an offset to rte->updatedCols.
* So we substract that to get the column no for an updated column that matches * So we substract that to get the column no for an updated column that matches
* resultRTE->updatedcols. * resultRTE->updatedcols.
*/ */
int updatedColNoWithOffset = partitionColumn->varattno - FirstLowInvalidHeapAttributeNumber; int updatedColNoWithOffset = partitionColumn->varattno -
if (bms_is_member(updatedColNoWithOffset, resultRTE->updatedCols)) { FirstLowInvalidHeapAttributeNumber;
if (bms_is_member(updatedColNoWithOffset, resultRTE->updatedCols))
{
targetEntryPartitionColumn = true; targetEntryPartitionColumn = true;
} }
}
}else if (targetEntry->resno == partitionColumn->varattno) { else if (targetEntry->resno == partitionColumn->varattno)
{
targetEntryPartitionColumn = true; targetEntryPartitionColumn = true;
} }
} }
@ -679,8 +684,8 @@ ModifyPartialQuerySupported(Query *queryTree, bool multiShardQuery,
NULL, NULL); NULL, NULL);
} }
//TODO:: targetEntry->resno is wrong here, we SHOULD think about /*TODO:: targetEntry->resno is wrong here, we SHOULD think about */
//TargetEntryChangesValue for update case based on 86dc90056dfdbd9d1b891718d2e5614e3e432f35. /*TargetEntryChangesValue for update case based on 86dc90056dfdbd9d1b891718d2e5614e3e432f35. */
if (commandType == CMD_UPDATE && targetEntryPartitionColumn && if (commandType == CMD_UPDATE && targetEntryPartitionColumn &&
TargetEntryChangesValue(targetEntry, partitionColumn, TargetEntryChangesValue(targetEntry, partitionColumn,
queryTree->jointree)) queryTree->jointree))
@ -1137,15 +1142,19 @@ ErrorIfOnConflictNotSupported(Query *queryTree)
bool setTargetEntryPartitionColumn = false; bool setTargetEntryPartitionColumn = false;
if (partitionColumn) { if (partitionColumn)
RangeTblEntry* resultRTE = ExtractResultRelationRTE(queryTree); {
RangeTblEntry *resultRTE = ExtractResultRelationRTE(queryTree);
/* /*
* FirstLowInvalidHeapAttributeNumber is added as an offset to rte->updatedCols. * FirstLowInvalidHeapAttributeNumber is added as an offset to rte->updatedCols.
* So we substract that to get the column no for an updated column that matches * So we substract that to get the column no for an updated column that matches
* resultRTE->updatedcols. * resultRTE->updatedcols.
*/ */
int updatedColNoWithOffset = partitionColumn->varattno - FirstLowInvalidHeapAttributeNumber; int updatedColNoWithOffset = partitionColumn->varattno -
if (bms_is_member(updatedColNoWithOffset, resultRTE->updatedCols)) { FirstLowInvalidHeapAttributeNumber;
if (bms_is_member(updatedColNoWithOffset, resultRTE->updatedCols))
{
setTargetEntryPartitionColumn = true; setTargetEntryPartitionColumn = true;
} }
} }

View File

@ -140,7 +140,8 @@ ListToHashSet(List *itemList, Size keySize, bool isStringList)
flags |= HASH_BLOBS; flags |= HASH_BLOBS;
} }
#if PG_VERSION_NUM >= PG_VERSION_14 #if PG_VERSION_NUM >= PG_VERSION_14
else { else
{
flags |= HASH_STRINGS; flags |= HASH_STRINGS;
} }
#endif #endif

View File

@ -63,7 +63,7 @@ typedef struct DDLJob
} DDLJob; } DDLJob;
extern void multi_ProcessUtility(PlannedStmt *pstmt, const char *queryString, extern void multi_ProcessUtility(PlannedStmt * pstmt, const char *queryString,
#if PG_VERSION_NUM >= PG_VERSION_14 #if PG_VERSION_NUM >= PG_VERSION_14
bool readOnlyTree, bool readOnlyTree,
#endif #endif

View File

@ -139,7 +139,7 @@ SELECT * FROM multi_extension.print_extension_changes();
| function alter_role_if_exists(text,text) boolean | function alter_role_if_exists(text,text) boolean
| function any_value(anyelement) anyelement | function any_value(anyelement) anyelement
| function any_value_agg(anyelement,anyelement) anyelement | function any_value_agg(anyelement,anyelement) anyelement
| function array_cat_agg(anycompatiblearray) anycompatiblearray | function array_cat_agg(anyarray) anycompatiblearray
| function assign_distributed_transaction_id(integer,bigint,timestamp with time zone) void | function assign_distributed_transaction_id(integer,bigint,timestamp with time zone) void
| function authinfo_valid(text) boolean | function authinfo_valid(text) boolean
| function broadcast_intermediate_result(text,text) bigint | function broadcast_intermediate_result(text,text) bigint

View File

@ -26,7 +26,7 @@ ORDER BY 1;
function alter_table_set_access_method(regclass,text) function alter_table_set_access_method(regclass,text)
function any_value(anyelement) function any_value(anyelement)
function any_value_agg(anyelement,anyelement) function any_value_agg(anyelement,anyelement)
function array_cat_agg(anycompatiblearray) function array_cat_agg(anyarray)
function assign_distributed_transaction_id(integer,bigint,timestamp with time zone) function assign_distributed_transaction_id(integer,bigint,timestamp with time zone)
function authinfo_valid(text) function authinfo_valid(text)
function broadcast_intermediate_result(text,text) function broadcast_intermediate_result(text,text)

View File

@ -23,7 +23,7 @@ ORDER BY 1;
function alter_table_set_access_method(regclass,text) function alter_table_set_access_method(regclass,text)
function any_value(anyelement) function any_value(anyelement)
function any_value_agg(anyelement,anyelement) function any_value_agg(anyelement,anyelement)
function array_cat_agg(anycompatiblearray) function array_cat_agg(anyarray)
function assign_distributed_transaction_id(integer,bigint,timestamp with time zone) function assign_distributed_transaction_id(integer,bigint,timestamp with time zone)
function authinfo_valid(text) function authinfo_valid(text)
function broadcast_intermediate_result(text,text) function broadcast_intermediate_result(text,text)