Commit fe638dc
committed
sql/schemachanger: implement TRUNCATE in declarative schema changer
Previously, we only supported truncate in the legacy schema changer,
which meant that automatic toggling o schema_locked was not supported.
This meant certain ORM tests were failing attempting to truncate tables
with automatic schema locked enabled. This patch adds support for
TRUNCATE in the declarative schema changer in majority of cases, as long
as the index does not have references via index hints.
Fixes: #153241
Fixes: #153248
Release note: None1 parent eb447f5 commit fe638dc
File tree
33 files changed
+1161
-157
lines changed- pkg
- bench/rttanalysis/testdata
- ccl
- logictestccl/testdata/logic_test
- schemachangerccl/sctestbackupccl
- server/application_api
- sql
- logictest/testdata/logic_test
- schemachanger
- scbuild
- internal/scbuildstmt
- scdeps/sctestdeps
- scexec
- scmutationexec
- scop
- scplan/internal
- opgen
- rules/current
- testdata
- testdata/end_to_end/truncate
- sem/tree
- tests
33 files changed
+1161
-157
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1563 | 1563 | | |
1564 | 1564 | | |
1565 | 1565 | | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
1566 | 1569 | | |
1567 | 1570 | | |
1568 | 1571 | | |
| |||
1572 | 1575 | | |
1573 | 1576 | | |
1574 | 1577 | | |
| 1578 | + | |
| 1579 | + | |
1575 | 1580 | | |
1576 | 1581 | | |
1577 | 1582 | | |
| |||
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 | |
|---|---|---|---|
| |||
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
341 | | - | |
| 341 | + | |
342 | 342 | | |
343 | 343 | | |
344 | 344 | | |
| |||
376 | 376 | | |
377 | 377 | | |
378 | 378 | | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
384 | 382 | | |
385 | 383 | | |
386 | 384 | | |
| |||
569 | 567 | | |
570 | 568 | | |
571 | 569 | | |
572 | | - | |
573 | | - | |
574 | | - | |
575 | | - | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
576 | 573 | | |
577 | 574 | | |
578 | 575 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
199 | | - | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
200 | 203 | | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
205 | 212 | | |
206 | 213 | | |
207 | 214 | | |
| |||
210 | 217 | | |
211 | 218 | | |
212 | 219 | | |
213 | | - | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
214 | 225 | | |
215 | 226 | | |
216 | 227 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
248 | | - | |
| 248 | + | |
249 | 249 | | |
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
| 255 | + | |
255 | 256 | | |
256 | | - | |
| 257 | + | |
257 | 258 | | |
258 | 259 | | |
259 | 260 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
753 | 753 | | |
754 | 754 | | |
755 | 755 | | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
756 | 769 | | |
757 | 770 | | |
758 | 771 | | |
| 772 | + | |
759 | 773 | | |
760 | 774 | | |
761 | 775 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| 48 | + | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| |||
67 | 69 | | |
68 | 70 | | |
69 | 71 | | |
| 72 | + | |
70 | 73 | | |
71 | 74 | | |
72 | 75 | | |
73 | 76 | | |
74 | 77 | | |
75 | 78 | | |
| 79 | + | |
76 | 80 | | |
77 | 81 | | |
78 | 82 | | |
| |||
95 | 99 | | |
96 | 100 | | |
97 | 101 | | |
| 102 | + | |
98 | 103 | | |
99 | 104 | | |
100 | 105 | | |
101 | 106 | | |
102 | 107 | | |
103 | 108 | | |
| 109 | + | |
104 | 110 | | |
105 | 111 | | |
106 | 112 | | |
| |||
138 | 144 | | |
139 | 145 | | |
140 | 146 | | |
| 147 | + | |
141 | 148 | | |
142 | 149 | | |
143 | 150 | | |
| |||
212 | 219 | | |
213 | 220 | | |
214 | 221 | | |
| 222 | + | |
215 | 223 | | |
216 | 224 | | |
217 | 225 | | |
218 | 226 | | |
219 | 227 | | |
220 | 228 | | |
| 229 | + | |
221 | 230 | | |
222 | 231 | | |
223 | 232 | | |
| |||
0 commit comments