mirror of https://github.com/citusdata/citus.git
Add shard relation to pState in localCopy
CopyFrom expects an AccessShareLock on the table. Instead of adding an explicit lock, we do it how postgres is doing, which is to use addRangeTableEntryForRelation. Commit: c532d15dddff14b01fe9ef1d465013cb8ef186dfpg14_support_after_rebase
parent
3a64b552b9
commit
a76aec21f4
|
@ -209,10 +209,8 @@ DoLocalCopy(StringInfo buffer, Oid relationId, int64 shardId, CopyStmt *copyStat
|
||||||
Oid shardOid = GetTableLocalShardOid(relationId, shardId);
|
Oid shardOid = GetTableLocalShardOid(relationId, shardId);
|
||||||
Relation shard = table_open(shardOid, RowExclusiveLock);
|
Relation shard = table_open(shardOid, RowExclusiveLock);
|
||||||
ParseState *pState = make_parsestate(NULL);
|
ParseState *pState = make_parsestate(NULL);
|
||||||
|
(void) addRangeTableEntryForRelation(pState, shard, AccessShareLock,
|
||||||
/* p_rtable of pState is set so that we can check constraints. */
|
NULL, false, false);
|
||||||
pState->p_rtable = CreateRangeTable(shard, ACL_INSERT);
|
|
||||||
|
|
||||||
CopyFromState_compat cstate = BeginCopyFrom_compat(pState, shard, NULL, NULL, false,
|
CopyFromState_compat cstate = BeginCopyFrom_compat(pState, shard, NULL, NULL, false,
|
||||||
ReadFromLocalBufferCallback,
|
ReadFromLocalBufferCallback,
|
||||||
copyStatement->attlist,
|
copyStatement->attlist,
|
||||||
|
|
Loading…
Reference in New Issue