Commit 44921a5
152895: schemachanger: implement ALTER TABLE .. RENAME in declarative schemachanger r=rafiss a=rafiss
See individual commits to make this easier to review.
This preserves all the validations and error handling from the legacy schema
changer.
### scexec: add deferred mutation to rename TTL schedule
This will make sure the TTL schedule name matches the new table name
when a table is renamed, just as the legacy schema changer does.
### scbuild: handle trigger/procedure dependencies for table renames
### lease_test: fix tests that rely on legacy testing knobs
Since RENAME now works in the declarative schema changer, we need to
force these tests to use the legacy schema changer to test the desired
behavior.
fixes #148339
Release note: None
153737: sql: make inspect a system privilege r=bghal a=bghal
Previously the inspect privilege was tied to specific objects (tables
and databases). For simplicity, it has been changed to a system
privilege. This has no user impact as the commands associated with the
privilege are as yet unimplemented.
Epic: CRDB-30356
Part of: #148925
Release note: None
153787: sql/schemachanger: fix lost dependencies in ALTER POLICY expressions r=spilchen a=spilchen
When altering only the USING expression of a policy that also had a WITH CHECK expression, dependencies from the WITH CHECK expression were incorrectly lost. This occurred because the upsertPolicyExpressions function overwrote dependency sets instead of unioning them.
Fixes #153191
Epic: none
Release note (bug fix): Fixed ALTER POLICY incorrectly dropping dependency tracking for functions, sequences, or types in policy expressions.
Co-authored-by: Rafi Shamim <rafi@cockroachlabs.com>
Co-authored-by: Brendan Gerrity <brendan.gerrity@cockroachlabs.com>
Co-authored-by: Matt Spilchen <matt.spilchen@cockroachlabs.com>
File tree
78 files changed
+791
-126
lines changed- pkg
- backup/testdata/backup-restore
- ccl
- changefeedccl
- logictestccl/testdata/logic_test
- schemachangerccl/sctestbackupccl
- sql
- catalog
- catpb
- lease
- descmetadata
- logictest/testdata/logic_test
- privilege
- schemachanger
- scbuild
- internal/scbuildstmt
- scdecomp
- scdeps/sctestdeps
- scexec
- scmutationexec
- scop
- scplan
- internal
- opgen
- rules/current
- testdata
- testdata
- testdata/end_to_end
- add_column_generated
- add_column_serial_simple_sequence_cached_node
- add_column_serial_simple_sequence_cached
- add_column_serial_simple_sequence_virtual
- add_column_serial_simple_sequence
- alter_table_rename
- create_complex
- create_sequence_add_column
- create_sequence_drop_sequence
- create_sequence
- create_temp_sequence
- ttl/ttlbase
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
78 files changed
+791
-126
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
185 | | - | |
186 | 185 | | |
187 | 186 | | |
188 | 187 | | |
189 | | - | |
| 188 | + | |
190 | 189 | | |
191 | 190 | | |
192 | 191 | | |
| |||
384 | 383 | | |
385 | 384 | | |
386 | 385 | | |
387 | | - | |
| 386 | + | |
388 | 387 | | |
389 | 388 | | |
390 | 389 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
250 | | - | |
| 250 | + | |
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
| |||
463 | 463 | | |
464 | 464 | | |
465 | 465 | | |
466 | | - | |
| 466 | + | |
467 | 467 | | |
468 | 468 | | |
469 | 469 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
172 | 171 | | |
173 | 172 | | |
174 | 173 | | |
175 | | - | |
| 174 | + | |
176 | 175 | | |
177 | 176 | | |
178 | 177 | | |
| |||
356 | 355 | | |
357 | 356 | | |
358 | 357 | | |
359 | | - | |
| 358 | + | |
360 | 359 | | |
361 | 360 | | |
362 | 361 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
221 | | - | |
| 221 | + | |
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
| 168 | + | |
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| |||
352 | 352 | | |
353 | 353 | | |
354 | 354 | | |
355 | | - | |
| 355 | + | |
356 | 356 | | |
357 | 357 | | |
358 | 358 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1273 | 1273 | | |
1274 | 1274 | | |
1275 | 1275 | | |
1276 | | - | |
| 1276 | + | |
| 1277 | + | |
1277 | 1278 | | |
1278 | 1279 | | |
1279 | 1280 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
929 | 929 | | |
930 | 930 | | |
931 | 931 | | |
| 932 | + | |
932 | 933 | | |
933 | 934 | | |
934 | 935 | | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
935 | 940 | | |
936 | 941 | | |
937 | 942 | | |
| |||
Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
91 | 90 | | |
92 | 91 | | |
93 | 92 | | |
| |||
616 | 615 | | |
617 | 616 | | |
618 | 617 | | |
619 | | - | |
| 618 | + | |
620 | 619 | | |
621 | 620 | | |
622 | 621 | | |
| |||
650 | 649 | | |
651 | 650 | | |
652 | 651 | | |
653 | | - | |
654 | | - | |
| 652 | + | |
| 653 | + | |
655 | 654 | | |
656 | 655 | | |
657 | 656 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1298 | 1298 | | |
1299 | 1299 | | |
1300 | 1300 | | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
1301 | 1305 | | |
| 1306 | + | |
1302 | 1307 | | |
1303 | 1308 | | |
1304 | 1309 | | |
| |||
1404 | 1409 | | |
1405 | 1410 | | |
1406 | 1411 | | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
1407 | 1416 | | |
| 1417 | + | |
1408 | 1418 | | |
1409 | 1419 | | |
1410 | 1420 | | |
| |||
1524 | 1534 | | |
1525 | 1535 | | |
1526 | 1536 | | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
1527 | 1541 | | |
| 1542 | + | |
1528 | 1543 | | |
1529 | 1544 | | |
1530 | 1545 | | |
| |||
0 commit comments