You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
148576: sql: enable create_table_with_schema_locked by default r=fqazi a=fqazi
To achieve more optimal change feed behavior, users previously had to manually enable the `schema_locked` setting on every new table.
This change simplifies the process by enabling the `create_table_with_schema_locked session` variable by default. The SQL package is also updated to automatically disable `schema_locked` when explicit transactions or the legacy schema changer are used.
In support of this change, tests and workloads across various packages have been updated to handle tables as schema-locked by default. This includes updates to tests in:
- workload/movr
- kvfollowereadccl
- telemetryccl
- spanconfigccl
- crosscluster
- acceptance
- importccl
- partitionccl
- rttanalysis
- multiregion
- changefeedccl
- backup
Note: The test updates have a commit per package to make things easier to follow. They will be squashed before merging.
Fixes: #129694
Release note (SQL changes): The `create_table_with_schema_locked` session variable is now enabled by default. As a result, all new tables will be created as `schema-locked`. This setting must be manually disabled before running operations that do not support schema-locking automatically, such as explicit transactions or `ALTER TABLE ... SET LOCALITY`.
148796: workflows: run update_releases on release-25.3 r=jlinder a=rail
Release note: none
Epic: none
Co-authored-by: Faizan Qazi <[email protected]>
Co-authored-by: Rail Aliiev <[email protected]>
showBackupRows=sqlDBRestore.QueryStr(t, fmt.Sprintf(`SELECT create_statement FROM [SHOW BACKUP SCHEMAS FROM LATEST IN '%s'] WHERE object_type='table'`, includedFK))
275
275
createStmtSameDB:=showBackupRows[1][0]
@@ -293,7 +293,7 @@ ORDER BY object_type, object_name`, full)
293
293
a INT8 NOT NULL,
294
294
b INT8 NULL,
295
295
CONSTRAINT fkreftable_pkey PRIMARY KEY (a ASC)
296
-
)`
296
+
) WITH (schema_locked = true)`
297
297
298
298
showBackupRows=sqlDBRestore.QueryStr(t, fmt.Sprintf(`SELECT create_statement FROM [SHOW BACKUP SCHEMAS FROM LATEST IN '%s'] WHERE object_type='table'`, missingFK))
Copy file name to clipboardExpand all lines: pkg/backup/testdata/backup-restore/row_level_ttl
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,7 @@ CREATE TABLE public.t (
39
39
id INT8 NOT NULL,
40
40
crdb_internal_expiration TIMESTAMPTZ NOT VISIBLE NOT NULL DEFAULT current_timestamp():::TIMESTAMPTZ + '00:10:00':::INTERVAL ON UPDATE current_timestamp():::TIMESTAMPTZ + '00:10:00':::INTERVAL,
41
41
CONSTRAINT t_pkey PRIMARY KEY (id ASC)
42
-
) WITH (ttl = 'on', ttl_expire_after = '00:10:00':::INTERVAL);
crdb_internal_expiration TIMESTAMPTZ NOT VISIBLE NOT NULL DEFAULT current_timestamp():::TIMESTAMPTZ + '00:10:00':::INTERVAL ON UPDATE current_timestamp():::TIMESTAMPTZ + '00:10:00':::INTERVAL,
74
74
CONSTRAINT t_pkey PRIMARY KEY (id ASC)
75
-
) WITH (ttl = 'on', ttl_expire_after = '00:10:00':::INTERVAL);
crdb_internal_expiration TIMESTAMPTZ NOT VISIBLE NOT NULL DEFAULT current_timestamp():::TIMESTAMPTZ + '00:10:00':::INTERVAL ON UPDATE current_timestamp():::TIMESTAMPTZ + '00:10:00':::INTERVAL,
111
111
CONSTRAINT t_pkey PRIMARY KEY (id ASC)
112
-
) WITH (ttl = 'on', ttl_expire_after = '00:10:00':::INTERVAL);
0 commit comments