Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release-24.2: schemachanger: add PartitionName to IndexZoneConfig attr #134472

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions pkg/ccl/logictestccl/testdata/logic_test/multi_region_zone_configs
Original file line number Diff line number Diff line change
Expand Up @@ -1864,3 +1864,27 @@ SELECT crdb_internal.reset_multi_region_zone_configs_for_table($tbl11_id)

query error user testuser must be owner of test or have CREATE privilege on database test
SELECT crdb_internal.validate_multi_region_zone_configs()

subtest drop_all_backrefs

user root

statement ok
CREATE DATABASE db1 PRIMARY REGION "ca-central-1" REGIONS "ap-southeast-2", "us-east-1" SURVIVE REGION FAILURE

statement ok
CREATE TABLE db1.t1_with_index_zone(x INT, j INT REFERENCES db1.t1_with_index_zone(x), PRIMARY KEY(x)) LOCALITY REGIONAL BY ROW

statement ok
ALTER PARTITION "ap-southeast-2" OF INDEX db1.t1_with_index_zone@t1_with_index_zone_pkey CONFIGURE ZONE USING gc.ttlseconds = 32000;

statement ok
ALTER PARTITION "ca-central-1" OF INDEX db1.t1_with_index_zone@t1_with_index_zone_pkey CONFIGURE ZONE USING gc.ttlseconds = 34000;

statement ok
ALTER PARTITION "us-east-1" OF INDEX db1.t1_with_index_zone@t1_with_index_zone_pkey CONFIGURE ZONE USING gc.ttlseconds = 38000;

statement ok
DROP TABLE db1.t1_with_index_zone CASCADE;

subtest end
4 changes: 4 additions & 0 deletions pkg/sql/schemachanger/screl/attr.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ const (
// Expr corresponds to the string representation of a SQL expression for an element.
Expr

// PartitionName corresponds to the name of a partition.
PartitionName

// AttrMax is the largest possible Attr value.
// Note: add any new enum values before TargetStatus, leave these at the end.
AttrMax = iota - 1
Expand Down Expand Up @@ -385,6 +388,7 @@ var elementSchemaOptions = []rel.SchemaOption{
rel.EntityMapping(t((*scpb.IndexZoneConfig)(nil)),
rel.EntityAttr(DescID, "TableID"),
rel.EntityAttr(IndexID, "IndexID"),
rel.EntityAttr(PartitionName, "PartitionName"),
),
rel.EntityMapping(t((*scpb.DatabaseData)(nil)),
rel.EntityAttr(DescID, "DatabaseID"),
Expand Down
5 changes: 4 additions & 1 deletion pkg/sql/schemachanger/screl/attr_string.go

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