Skip to content

Commit

Permalink
Merge #138651
Browse files Browse the repository at this point in the history
138651: sql/schemachanger: Implement CREATE/DROP POLICY in the DSC r=spilchen a=spilchen

Prior to this commit, attempts to create or drop a policy succeeded but did not write any metadata to the table descriptor. This commit introduces the first step in persisting policy metadata by storing the policy name. Future PRs will handle storing additional policy details.

The policy name is now stored in a new field within the table descriptor, and each policy is assigned a unique ID specific to the table. This commit also adds elements to the DSC to support adding and removing policy information in the descriptor. Support in the legacy schema changer has been intentionally left out.

Epic: CRDB-11724
Informs #136696
Release note: none

Co-authored-by: Matt Spilchen <[email protected]>
  • Loading branch information
craig[bot] and spilchen committed Jan 13, 2025
2 parents bffe1f1 + f42bcea commit 91a08e7
Show file tree
Hide file tree
Showing 61 changed files with 1,474 additions and 178 deletions.
56 changes: 56 additions & 0 deletions pkg/ccl/schemachangerccl/backup_base_generated_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/cli/testdata/doctor/test_recreate_zipdir
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ SELECT crdb_internal.unsafe_upsert_namespace_entry(100, 0, 'public', 101, true);
SELECT crdb_internal.unsafe_upsert_descriptor(102, decode('125a0a08706f73746772657310661a300a0b0a0561646d696e100218020a0d0a067075626c696310801018000a0a0a04726f6f74100218021204726f6f741803220028013a0c0a067075626c69631202086740004a005a0210007000', 'hex'), true);
SELECT crdb_internal.unsafe_upsert_namespace_entry(0, 0, 'postgres', 102, true);
SELECT crdb_internal.unsafe_upsert_descriptor(103, decode('2249086612067075626c6963186722310a0b0a0561646d696e100218020a0d0a067075626c696310840418000a0a0a04726f6f7410021802120561646d696e18032a00300140004a007000', 'hex'), true);
SELECT crdb_internal.unsafe_upsert_descriptor(104, decode('0af7020a01741868206428013a0042260a016910011a0c08011040180030005014600020013000680070007800800100880100980100423a0a05726f77696410021a0c08011040180030005014600020002a0e756e697175655f726f77696428293001680070007800800100880100980100480352720a06745f706b6579100118012205726f7769642a0169300240004a10080010001a00200028003000380040005a0070017a0408002000800100880100900104980101a20106080012001800a80100b20100ba0100c00100c801d88aed86ddb7c5e517d00101e00100e901000000000000000060026a210a0b0a0561646d696e100218020a0a0a04726f6f74100218021204726f6f741803800101880103980100b2011b0a077072696d61727910001a01691a05726f776964200120022801b80101c20100e80100f2010408001200f801008002009202009a0200b20200b80200c00265c80200e00200800300880302a80300b00300d00300d80300e00300f80300880400', 'hex'), true);
SELECT crdb_internal.unsafe_upsert_descriptor(104, decode('0afa020a01741868206428013a0042260a016910011a0c08011040180030005014600020013000680070007800800100880100980100423a0a05726f77696410021a0c08011040180030005014600020002a0e756e697175655f726f77696428293001680070007800800100880100980100480352720a06745f706b6579100118012205726f7769642a0169300240004a10080010001a00200028003000380040005a0070017a0408002000800100880100900104980101a20106080012001800a80100b20100ba0100c00100c801d88aed86ddb7c5e517d00101e00100e901000000000000000060026a210a0b0a0561646d696e100218020a0a0a04726f6f74100218021204726f6f741803800101880103980100b2011b0a077072696d61727910001a01691a05726f776964200120022801b80101c20100e80100f2010408001200f801008002009202009a0200b20200b80200c00265c80200e00200800300880302a80300b00300d00300d80300e00300f80300880400980400', 'hex'), true);
COMMIT;
Loading

0 comments on commit 91a08e7

Please sign in to comment.