Fix typo in relcache's equalPolicy()
authorStephen Frost <[email protected]>
Fri, 17 Apr 2015 20:37:11 +0000 (16:37 -0400)
committerStephen Frost <[email protected]>
Fri, 17 Apr 2015 20:37:11 +0000 (16:37 -0400)
The USING policies were not being checked for differences as the same
policy was being passed in to both sides of the equal().  This could
result in backends not realizing that a policy had been changed, if
none of the other attributes had been changed.

Fix by passing to equal() the policy1 and policy2 using quals for
comparison.

No need to back-patch as this is not yet released.  Noticed while
testing changes to RLS proposed by Dean Rasheed.

src/backend/utils/cache/relcache.c

index 4ea01d1ad639eec11cb33e889a5f221b93bd7501..e745006b73bbea37a5ececf296dbb836d4159dbf 100644 (file)
@@ -887,7 +887,7 @@ equalPolicy(RowSecurityPolicy *policy1, RowSecurityPolicy *policy2)
                                return false;
                }
 
-               if (!equal(policy1->qual, policy1->qual))
+               if (!equal(policy1->qual, policy2->qual))
                        return false;
                if (!equal(policy1->with_check_qual, policy2->with_check_qual))
                        return false;