|
64 | 64 | #include "optimizer/prep.h"
|
65 | 65 | #include "optimizer/var.h"
|
66 | 66 | #include "rewrite/rewriteDefine.h"
|
| 67 | +#include "rewrite/rowsecurity.h" |
67 | 68 | #include "storage/lmgr.h"
|
68 | 69 | #include "storage/smgr.h"
|
69 | 70 | #include "utils/array.h"
|
@@ -1052,7 +1053,7 @@ RelationBuildDesc(Oid targetRelId, bool insertIt)
|
1052 | 1053 | if (relation->rd_rel->relrowsecurity)
|
1053 | 1054 | RelationBuildRowSecurity(relation);
|
1054 | 1055 | else
|
1055 |
| - relation->rsdesc = NULL; |
| 1056 | + relation->rd_rsdesc = NULL; |
1056 | 1057 |
|
1057 | 1058 | /*
|
1058 | 1059 | * if it's an index, initialize index-related information
|
@@ -2024,8 +2025,8 @@ RelationDestroyRelation(Relation relation, bool remember_tupdesc)
|
2024 | 2025 | MemoryContextDelete(relation->rd_indexcxt);
|
2025 | 2026 | if (relation->rd_rulescxt)
|
2026 | 2027 | MemoryContextDelete(relation->rd_rulescxt);
|
2027 |
| - if (relation->rsdesc) |
2028 |
| - MemoryContextDelete(relation->rsdesc->rscxt); |
| 2028 | + if (relation->rd_rsdesc) |
| 2029 | + MemoryContextDelete(relation->rd_rsdesc->rscxt); |
2029 | 2030 | if (relation->rd_fdwroutine)
|
2030 | 2031 | pfree(relation->rd_fdwroutine);
|
2031 | 2032 | pfree(relation);
|
@@ -2200,7 +2201,7 @@ RelationClearRelation(Relation relation, bool rebuild)
|
2200 | 2201 |
|
2201 | 2202 | keep_tupdesc = equalTupleDescs(relation->rd_att, newrel->rd_att);
|
2202 | 2203 | keep_rules = equalRuleLocks(relation->rd_rules, newrel->rd_rules);
|
2203 |
| - keep_policies = equalRSDesc(relation->rsdesc, newrel->rsdesc); |
| 2204 | + keep_policies = equalRSDesc(relation->rd_rsdesc, newrel->rd_rsdesc); |
2204 | 2205 |
|
2205 | 2206 | /*
|
2206 | 2207 | * Perform swapping of the relcache entry contents. Within this
|
@@ -2250,7 +2251,7 @@ RelationClearRelation(Relation relation, bool rebuild)
|
2250 | 2251 | SWAPFIELD(MemoryContext, rd_rulescxt);
|
2251 | 2252 | }
|
2252 | 2253 | if (keep_policies)
|
2253 |
| - SWAPFIELD(RowSecurityDesc *, rsdesc); |
| 2254 | + SWAPFIELD(RowSecurityDesc *, rd_rsdesc); |
2254 | 2255 | /* toast OID override must be preserved */
|
2255 | 2256 | SWAPFIELD(Oid, rd_toastoid);
|
2256 | 2257 | /* pgstat_info must be preserved */
|
@@ -3435,11 +3436,11 @@ RelationCacheInitializePhase3(void)
|
3435 | 3436 | * RelationBuildRowSecurity will create a single default-deny policy
|
3436 | 3437 | * if there is no policy defined in pg_rowsecurity.
|
3437 | 3438 | */
|
3438 |
| - if (relation->rd_rel->relrowsecurity && relation->rsdesc == NULL) |
| 3439 | + if (relation->rd_rel->relrowsecurity && relation->rd_rsdesc == NULL) |
3439 | 3440 | {
|
3440 | 3441 | RelationBuildRowSecurity(relation);
|
3441 | 3442 |
|
3442 |
| - Assert (relation->rsdesc != NULL); |
| 3443 | + Assert (relation->rd_rsdesc != NULL); |
3443 | 3444 | restart = true;
|
3444 | 3445 | }
|
3445 | 3446 |
|
@@ -4815,7 +4816,7 @@ load_relcache_init_file(bool shared)
|
4815 | 4816 | rel->rd_rules = NULL;
|
4816 | 4817 | rel->rd_rulescxt = NULL;
|
4817 | 4818 | rel->trigdesc = NULL;
|
4818 |
| - rel->rsdesc = NULL; |
| 4819 | + rel->rd_rsdesc = NULL; |
4819 | 4820 | rel->rd_indexprs = NIL;
|
4820 | 4821 | rel->rd_indpred = NIL;
|
4821 | 4822 | rel->rd_exclops = NULL;
|
|
0 commit comments