warn_grant
Hadi Moshayedi 2019-03-22 14:51:06 -07:00 committed by Philip Dubé
parent 823c561ea9
commit 9b3ee66a27
1 changed files with 17 additions and 17 deletions

View File

@ -44,33 +44,33 @@ PreprocessGrantStmt(Node *node, const char *queryString)
#else #else
case ACL_OBJECT_DATABASE: case ACL_OBJECT_DATABASE:
#endif #endif
{ {
showPropagationWarning = true; showPropagationWarning = true;
break; break;
} }
#if (PG_VERSION_NUM >= 110000) #if (PG_VERSION_NUM >= 110000)
case OBJECT_TABLE: case OBJECT_TABLE:
#else #else
case ACL_OBJECT_RELATION: case ACL_OBJECT_RELATION:
#endif #endif
{
ListCell *rangeVarCell = NULL;
foreach(rangeVarCell, grantStmt->objects)
{ {
RangeVar *rangeVar = (RangeVar *) lfirst(rangeVarCell); ListCell *rangeVarCell = NULL;
Oid relationId = RangeVarGetRelid(rangeVar, NoLock, false); foreach(rangeVarCell, grantStmt->objects)
if (OidIsValid(relationId) && IsDistributedTable(relationId))
{ {
showPropagationWarning = true; RangeVar *rangeVar = (RangeVar *) lfirst(rangeVarCell);
break;
}
}
break; Oid relationId = RangeVarGetRelid(rangeVar, NoLock, false);
} if (OidIsValid(relationId) && IsDistributedTable(relationId))
{
showPropagationWarning = true;
break;
}
}
break;
}
/* no need to warn when object is sequence, domain, function, etc. */ /* no need to warn when object is sequence, domain, function, etc. */
default: default: