diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c
index 4d7c92d63c..8bda54f6e5 100644
--- a/src/backend/executor/execMain.c
+++ b/src/backend/executor/execMain.c
@@ -2279,8 +2279,9 @@ ExecBuildSlotValueDescription(Oid reloid,
 			 */
 			aclresult = pg_attribute_aclcheck(reloid, att->attnum,
 											  GetUserId(), ACL_SELECT);
-			if (bms_is_member(att->attnum - FirstLowInvalidHeapAttributeNumber,
-							  modifiedCols) || aclresult == ACLCHECK_OK)
+			if (aclresult == ACLCHECK_OK ||
+				bms_is_member(att->attnum - FirstLowInvalidHeapAttributeNumber,
+							  modifiedCols))
 			{
 				column_perm = any_perm = true;
 