mirror of https://github.com/citusdata/citus.git
Merge branch 'main' into citus_pause_node
commit
d10eb05b31
|
@ -169,7 +169,11 @@ ColumnarStorageInit(SMgrRelation srel, uint64 storageId)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* create two pages */
|
/* create two pages */
|
||||||
|
#if PG_VERSION_NUM >= PG_VERSION_16
|
||||||
|
PGIOAlignedBlock block;
|
||||||
|
#else
|
||||||
PGAlignedBlock block;
|
PGAlignedBlock block;
|
||||||
|
#endif
|
||||||
Page page = block.data;
|
Page page = block.data;
|
||||||
|
|
||||||
/* write metapage */
|
/* write metapage */
|
||||||
|
|
|
@ -901,15 +901,7 @@ RouterModifyTaskForShardInterval(Query *originalQuery,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
shardRestrictionList = make_simple_restrictinfo(restriction->plannerInfo,
|
||||||
/*
|
|
||||||
* passing NULL for plannerInfo will be problematic if we have placeholder
|
|
||||||
* vars. However, it won't be the case here because we are building
|
|
||||||
* the expression from shard intervals which don't have placeholder vars.
|
|
||||||
* Note that this is only the case with PG14 as the parameter doesn't exist
|
|
||||||
* prior to that.
|
|
||||||
*/
|
|
||||||
shardRestrictionList = make_simple_restrictinfo(NULL,
|
|
||||||
(Expr *) shardOpExpressions);
|
(Expr *) shardOpExpressions);
|
||||||
extendedBaseRestrictInfo = lappend(extendedBaseRestrictInfo,
|
extendedBaseRestrictInfo = lappend(extendedBaseRestrictInfo,
|
||||||
shardRestrictionList);
|
shardRestrictionList);
|
||||||
|
|
|
@ -171,6 +171,8 @@ static bool FindQueryContainingRTEIdentityInternal(Node *node,
|
||||||
|
|
||||||
static int ParentCountPriorToAppendRel(List *appendRelList, AppendRelInfo *appendRelInfo);
|
static int ParentCountPriorToAppendRel(List *appendRelList, AppendRelInfo *appendRelInfo);
|
||||||
|
|
||||||
|
static bool IsVarRelOptOuterJoin(PlannerInfo *root, Var *varToBeAdded);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* AllDistributionKeysInQueryAreEqual returns true if either
|
* AllDistributionKeysInQueryAreEqual returns true if either
|
||||||
|
@ -1238,6 +1240,12 @@ AddToAttributeEquivalenceClass(AttributeEquivalenceClass *attributeEquivalenceCl
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* outer join checks in PG16 */
|
||||||
|
if (IsVarRelOptOuterJoin(root, varToBeAdded))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
RangeTblEntry *rangeTableEntry = root->simple_rte_array[varToBeAdded->varno];
|
RangeTblEntry *rangeTableEntry = root->simple_rte_array[varToBeAdded->varno];
|
||||||
if (rangeTableEntry->rtekind == RTE_RELATION)
|
if (rangeTableEntry->rtekind == RTE_RELATION)
|
||||||
{
|
{
|
||||||
|
@ -1379,6 +1387,30 @@ GetTargetSubquery(PlannerInfo *root, RangeTblEntry *rangeTableEntry, Var *varToB
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* IsVarRelOptOuterJoin returns true if the Var to be added
|
||||||
|
* is an outer join, false otherwise.
|
||||||
|
*/
|
||||||
|
static bool
|
||||||
|
IsVarRelOptOuterJoin(PlannerInfo *root, Var *varToBeAdded)
|
||||||
|
{
|
||||||
|
#if PG_VERSION_NUM >= PG_VERSION_16
|
||||||
|
if (root->simple_rel_array_size <= varToBeAdded->varno)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
RelOptInfo *rel = root->simple_rel_array[varToBeAdded->varno];
|
||||||
|
if (rel == NULL)
|
||||||
|
{
|
||||||
|
/* must be an outer join */
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* AddUnionAllSetOperationsToAttributeEquivalenceClass recursively iterates on all the
|
* AddUnionAllSetOperationsToAttributeEquivalenceClass recursively iterates on all the
|
||||||
* append rels, sets the varno's accordingly and adds the
|
* append rels, sets the varno's accordingly and adds the
|
||||||
|
|
|
@ -1530,7 +1530,23 @@ CreateSubscriptions(MultiConnection *sourceConnection,
|
||||||
appendStringInfo(createSubscriptionCommand,
|
appendStringInfo(createSubscriptionCommand,
|
||||||
"CREATE SUBSCRIPTION %s CONNECTION %s PUBLICATION %s "
|
"CREATE SUBSCRIPTION %s CONNECTION %s PUBLICATION %s "
|
||||||
"WITH (citus_use_authinfo=true, create_slot=false, "
|
"WITH (citus_use_authinfo=true, create_slot=false, "
|
||||||
|
#if PG_VERSION_NUM >= PG_VERSION_16
|
||||||
|
|
||||||
|
/*
|
||||||
|
* password_required specifies whether connections to the publisher
|
||||||
|
* made as a result of this subscription must use password authentication.
|
||||||
|
* However, this setting is ignored when the subscription is owned
|
||||||
|
* by a superuser.
|
||||||
|
* Given that this command is executed below with superuser
|
||||||
|
* ExecuteCriticalRemoteCommand(target->superuserConnection,
|
||||||
|
* createSubscriptionCommand->data);
|
||||||
|
* We are safe to pass password_required as false because
|
||||||
|
* it will be ignored anyway
|
||||||
|
*/
|
||||||
|
"copy_data=false, enabled=false, slot_name=%s, password_required=false",
|
||||||
|
#else
|
||||||
"copy_data=false, enabled=false, slot_name=%s",
|
"copy_data=false, enabled=false, slot_name=%s",
|
||||||
|
#endif
|
||||||
quote_identifier(target->subscriptionName),
|
quote_identifier(target->subscriptionName),
|
||||||
quote_literal_cstr(conninfo->data),
|
quote_literal_cstr(conninfo->data),
|
||||||
quote_identifier(target->publication->name),
|
quote_identifier(target->publication->name),
|
||||||
|
|
|
@ -294,3 +294,12 @@ s/\/\*\{"cId":.*\*\///g
|
||||||
|
|
||||||
# Notice message that contains current columnar version that makes it harder to bump versions
|
# Notice message that contains current columnar version that makes it harder to bump versions
|
||||||
s/(NOTICE: issuing CREATE EXTENSION IF NOT EXISTS citus_columnar WITH SCHEMA pg_catalog VERSION )"[0-9]+\.[0-9]+-[0-9]+"/\1 "x.y-z"/
|
s/(NOTICE: issuing CREATE EXTENSION IF NOT EXISTS citus_columnar WITH SCHEMA pg_catalog VERSION )"[0-9]+\.[0-9]+-[0-9]+"/\1 "x.y-z"/
|
||||||
|
|
||||||
|
# pg16 changes
|
||||||
|
# can be removed when dropping PG14&15 support
|
||||||
|
#if PG_VERSION_NUM < PG_VERSION_16
|
||||||
|
# (This is not preprocessor directive, but a reminder for the developer that will drop PG14&15 support )
|
||||||
|
|
||||||
|
s/, password_required=false//g
|
||||||
|
|
||||||
|
#endif /* PG_VERSION_NUM < PG_VERSION_16 */
|
||||||
|
|
Loading…
Reference in New Issue