Skip to content

Dummy PR to test fix for BABEL-5703 #559

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: BABEL_5_X_DEV__PG_17_X
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/backend/executor/execMain.c
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,9 @@ ExecCheckPermissions(List *rangeTable, List *rteperminfos,
{
RTEPermissionInfo *perminfo = lfirst_node(RTEPermissionInfo, l);

if (IsBabelfishParallelWorker() && perminfo->permChecked)
continue;

Assert(OidIsValid(perminfo->relid));
result = ExecCheckOneRelPerms(perminfo);
if (!result)
Expand All @@ -624,6 +627,7 @@ ExecCheckPermissions(List *rangeTable, List *rteperminfos,
get_rel_name(perminfo->relid));
return false;
}
perminfo->permChecked = (sql_dialect == SQL_DIALECT_TSQL);
}

if (ExecutorCheckPerms_hook)
Expand Down Expand Up @@ -840,10 +844,9 @@ InitPlan(QueryDesc *queryDesc, int eflags)
int i;

/*
* Do permissions checks if not Babelfish parallel worker
* Do permissions checks
*/
if (!IsBabelfishParallelWorker())
ExecCheckPermissions(rangeTable, plannedstmt->permInfos, true);
ExecCheckPermissions(rangeTable, plannedstmt->permInfos, true);

/*
* initialize the node's execution state
Expand Down
1 change: 1 addition & 0 deletions src/include/nodes/parsenodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -1297,6 +1297,7 @@ typedef struct RTEPermissionInfo
Bitmapset *selectedCols; /* columns needing SELECT permission */
Bitmapset *insertedCols; /* columns needing INSERT permission */
Bitmapset *updatedCols; /* columns needing UPDATE permission */
bool permChecked; /* Permission check is done for given relid? */
} RTEPermissionInfo;

/*
Expand Down