Skip to content

Commit b8c764f

Browse files
committed
Removed assertion during ExecCheckPermissions which has been reverted by
community Signed-off-by: Ayush Shah <ayushdsh@amazon.com>
1 parent 6d38b81 commit b8c764f

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

src/backend/executor/execMain.c

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,6 @@ ExecCheckPermissions(List *rangeTable, List *rteperminfos,
598598
foreach(l, rangeTable)
599599
{
600600
RangeTblEntry *rte = lfirst_node(RangeTblEntry, l);
601-
bool is_enr = (sql_dialect == SQL_DIALECT_TSQL && GetENRTempTableWithOid(rte->relid));
602601

603602
if (rte->perminfoindex != 0)
604603
{
@@ -612,22 +611,6 @@ ExecCheckPermissions(List *rangeTable, List *rteperminfos,
612611
(rte->rtekind == RTE_SUBQUERY &&
613612
rte->relkind == RELKIND_VIEW));
614613

615-
/*
616-
* Ensure that we have at least an AccessShareLock on relations
617-
* whose permissions need to be checked.
618-
*
619-
* Skip this check in a parallel worker because locks won't be
620-
* taken until ExecInitNode() performs plan initialization.
621-
*
622-
* Skip this check if this relation is in ENR since we don't hold
623-
* locks for relations in ENRs
624-
*
625-
* XXX: ExecCheckPermissions() in a parallel worker may be
626-
* redundant with the checks done in the leader process, so this
627-
* should be reviewed to ensure it’s necessary.
628-
*/
629-
Assert(IsParallelWorker() || is_enr || CheckRelationOidLockedByMe(rte->relid, AccessShareLock, true));
630-
631614
(void) getRTEPermissionInfo(rteperminfos, rte);
632615
/* Many-to-one mapping not allowed */
633616
Assert(!bms_is_member(rte->perminfoindex, indexset));

0 commit comments

Comments
 (0)