Skip to content

Commit 7c43cb2

Browse files
littlestar642rafiss
authored andcommitted
sql/crdb_internal: rename alter_statements to fk_statements
Release note: None
1 parent 30bcd20 commit 7c43cb2

File tree

8 files changed

+12
-12
lines changed

8 files changed

+12
-12
lines changed

pkg/ccl/logictestccl/testdata/logic_test/crdb_internal_tenant

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ function signature category details schema oid
190190
query ITTITTTTTTTTTBBBB colnames
191191
SELECT * FROM crdb_internal.create_statements WHERE database_name = ''
192192
----
193-
database_id database_name schema_name descriptor_id descriptor_type descriptor_name create_statement state create_nofks rls_statements alter_statements validate_statements create_redactable has_partitions is_multi_region is_virtual is_temporary
193+
database_id database_name schema_name descriptor_id descriptor_type descriptor_name create_statement state create_nofks rls_statements fk_statements validate_statements create_redactable has_partitions is_multi_region is_virtual is_temporary
194194

195195
query ITITTBTB colnames
196196
SELECT * FROM crdb_internal.table_columns WHERE descriptor_name = ''

pkg/cli/zip_table_registry.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ var zipInternalTablesPerCluster = DebugZipTableRegistry{
307307
"is_virtual",
308308
"is_temporary",
309309
"crdb_internal.hide_sql_constants(create_statement) as create_statement",
310-
"crdb_internal.hide_sql_constants(alter_statements) as alter_statements",
310+
"crdb_internal.hide_sql_constants(fk_statements) as fk_statements",
311311
"crdb_internal.hide_sql_constants(create_nofks) as create_nofks",
312312
"crdb_internal.redact(create_redactable) as create_redactable",
313313
},

pkg/sql/crdb_internal.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3960,7 +3960,7 @@ CREATE TABLE crdb_internal.create_statements (
39603960
state STRING NOT NULL,
39613961
create_nofks STRING NOT NULL,
39623962
rls_statements STRING[] NOT NULL,
3963-
alter_statements STRING[] NOT NULL,
3963+
fk_statements STRING[] NOT NULL,
39643964
validate_statements STRING[] NOT NULL,
39653965
create_redactable STRING NOT NULL,
39663966
has_partitions BOOL NOT NULL,

pkg/sql/logictest/testdata/logic_test/crdb_internal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ function signature category details schema oid
377377
query ITTITTTTTTTTTBBBB colnames
378378
SELECT * FROM crdb_internal.create_statements WHERE database_name = ''
379379
----
380-
database_id database_name schema_name descriptor_id descriptor_type descriptor_name create_statement state create_nofks rls_statements alter_statements validate_statements create_redactable has_partitions is_multi_region is_virtual is_temporary
380+
database_id database_name schema_name descriptor_id descriptor_type descriptor_name create_statement state create_nofks rls_statements fk_statements validate_statements create_redactable has_partitions is_multi_region is_virtual is_temporary
381381

382382
query ITITTBTB colnames
383383
SELECT * FROM crdb_internal.table_columns WHERE descriptor_name = ''

pkg/sql/logictest/testdata/logic_test/create_statements

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ query TTTT colnames
3737
SELECT
3838
regexp_replace(create_statement, '\n', ' ', 'g'),
3939
regexp_replace(create_nofks, '\n', ' ', 'g'),
40-
alter_statements,
40+
fk_statements,
4141
validate_statements
4242
FROM
4343
crdb_internal.create_statements
@@ -47,7 +47,7 @@ AND
4747
schema_name NOT IN ('pg_catalog', 'pg_extension', 'crdb_internal', 'information_schema')
4848
ORDER BY descriptor_id
4949
----
50-
regexp_replace regexp_replace alter_statements validate_statements
50+
regexp_replace regexp_replace fk_statements validate_statements
5151
CREATE TABLE public.t ( a INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), CONSTRAINT t_pkey PRIMARY KEY (rowid ASC), CONSTRAINT t_a_fkey FOREIGN KEY (a) REFERENCES public.t(rowid) ) CREATE TABLE public.t ( a INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), CONSTRAINT t_pkey PRIMARY KEY (rowid ASC) ) {"ALTER TABLE public.t ADD CONSTRAINT t_a_fkey FOREIGN KEY (a) REFERENCES public.t(rowid)"} {"ALTER TABLE public.t VALIDATE CONSTRAINT t_a_fkey"}
5252
CREATE TABLE public.v ( "'" INT8 NULL, s STRING NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), CONSTRAINT v_pkey PRIMARY KEY (rowid ASC), CONSTRAINT "v_'_fkey" FOREIGN KEY ("'") REFERENCES public.t(rowid), CONSTRAINT v_s_fkey FOREIGN KEY (s) REFERENCES public.v(s), UNIQUE INDEX v_s_key (s ASC) ) CREATE TABLE public.v ( "'" INT8 NULL, s STRING NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), CONSTRAINT v_pkey PRIMARY KEY (rowid ASC), UNIQUE INDEX v_s_key (s ASC) ) {"ALTER TABLE public.v ADD CONSTRAINT \"v_'_fkey\" FOREIGN KEY (\"'\") REFERENCES public.t(rowid)","ALTER TABLE public.v ADD CONSTRAINT v_s_fkey FOREIGN KEY (s) REFERENCES public.v(s)"} {"ALTER TABLE public.v VALIDATE CONSTRAINT \"v_'_fkey\"","ALTER TABLE public.v VALIDATE CONSTRAINT v_s_fkey"}
5353
CREATE TABLE public.c ( a INT8 NOT NULL, b INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), CONSTRAINT c_pkey PRIMARY KEY (rowid ASC), INDEX c_a_b_idx (a ASC, b ASC), FAMILY fam_0_a_rowid (a, rowid), FAMILY fam_1_b (b) ); COMMENT ON TABLE public.c IS 'table'; COMMENT ON COLUMN public.c.a IS 'column'; COMMENT ON INDEX public.c@c_a_b_idx IS 'index' CREATE TABLE public.c ( a INT8 NOT NULL, b INT8 NULL, rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(), CONSTRAINT c_pkey PRIMARY KEY (rowid ASC), INDEX c_a_b_idx (a ASC, b ASC), FAMILY fam_0_a_rowid (a, rowid), FAMILY fam_1_b (b) ); COMMENT ON TABLE public.c IS 'table'; COMMENT ON COLUMN public.c.a IS 'column'; COMMENT ON INDEX public.c@c_a_b_idx IS 'index' {} {}

pkg/sql/logictest/testdata/logic_test/row_level_security

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ select rls_statements from crdb_internal.create_statements where descriptor_name
688688
{"CREATE POLICY p1 ON public.flying_roaches AS PERMISSIVE FOR ALL TO public USING ('flying':::public.roach_type = 'crawling':::public.roach_type)"}
689689

690690
query T
691-
select alter_statements from crdb_internal.create_statements where descriptor_name='flying_roaches'
691+
select fk_statements from crdb_internal.create_statements where descriptor_name='flying_roaches'
692692
----
693693
{}
694694

@@ -805,7 +805,7 @@ CREATE TABLE public.roaches (
805805
)
806806

807807
query TTT
808-
select rls_statements, alter_statements, create_nofks from crdb_internal.create_statements where descriptor_name='roaches'
808+
select rls_statements, fk_statements, create_nofks from crdb_internal.create_statements where descriptor_name='roaches'
809809
----
810810
{"ALTER TABLE public.roaches ENABLE ROW LEVEL SECURITY, FORCE ROW LEVEL SECURITY"} {} CREATE TABLE public.roaches (
811811
rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(),
@@ -829,7 +829,7 @@ select rls_statements from crdb_internal.create_statements where descriptor_name
829829
{}
830830

831831
query T
832-
select alter_statements from crdb_internal.create_statements where descriptor_name='roaches'
832+
select fk_statements from crdb_internal.create_statements where descriptor_name='roaches'
833833
----
834834
{}
835835

pkg/sql/logictest/testdata/logic_test/sequences

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ CREATE SEQUENCE show_create_test
136136
query ITTITTTTTTTTTBBBB colnames
137137
SELECT * FROM crdb_internal.create_statements WHERE descriptor_name = 'show_create_test'
138138
----
139-
database_id database_name schema_name descriptor_id descriptor_type descriptor_name create_statement state create_nofks rls_statements alter_statements validate_statements create_redactable has_partitions is_multi_region is_virtual is_temporary
139+
database_id database_name schema_name descriptor_id descriptor_type descriptor_name create_statement state create_nofks rls_statements fk_statements validate_statements create_redactable has_partitions is_multi_region is_virtual is_temporary
140140
104 test public 111 sequence show_create_test CREATE SEQUENCE public.show_create_test MINVALUE 1 MAXVALUE 9223372036854775807 INCREMENT 1 START 1 PUBLIC CREATE SEQUENCE public.show_create_test MINVALUE 1 MAXVALUE 9223372036854775807 INCREMENT 1 START 1 {} {} {} CREATE SEQUENCE public.show_create_test MINVALUE 1 MAXVALUE 9223372036854775807 INCREMENT 1 START 1 false false false false
141141

142142
query TT colnames

pkg/sql/sem/builtins/show_create_all_tables_builtin.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ import (
2727
// hashAggregatorSizeOfBucketsItem
2828
const mapEntryOverhead = 64
2929

30-
// alterAddFKStatements represents the column name for alter_statements in
30+
// alterAddFKStatements represents the column name for fk_statements in
3131
// crdb_internal.create_statements.
32-
const alterAddFKStatements = "alter_statements"
32+
const alterAddFKStatements = "fk_statements"
3333

3434
// alterValidateFKStatements represents the column name for validate_statements in
3535
// crdb_internal.create_statements.

0 commit comments

Comments
 (0)