Commit 5346432
authored
feat: add tag DDL support (CREATE/DROP/SHOW only) (#19109)
* feat: add tag DDL support (CREATE/DROP/SHOW only)
* fix conversation
* add tag <-> object ref
* refactor
* rename some struct
* extract TagError
* fix conversation
* add reserved TagMeta::drop_on
* split TagError, TagMetaError; add some comments
* retry set_object_tags and drop concurrent tag error
- set_object_tags now perform an optimistic retry with txn_backoff to keep allowed_values consistent with the latest tag meta.
- remove the TagMetaConcurrentModification errors and corresponding exception code, instead retry logic processing.
* meta: add explicit tag allowed_values enforcement flag
- Proto3 `repeated` fields can’t distinguish `None` from `Some(Vec::new())`, so
extending TagMeta with a dedicated `enforce_allowed_values` flag lets us tell
whether a tag declared `ALLOWED_VALUES` even when the list is empty.
- Split the semantics in Rust too: keep `allowed_values: Vec<String>` strictly
for ordered values, and use the boolean to record if the constraint is active
instead of overloading `Option<Vec<_>>`.
- Update CREATE TAG interpreter, tag validation, error text, and system.tags
display to respect the new structure, and refresh the proto conversion tests.
* optimize
- represent tag allowed_values as Option<Vec<String>> without an enforce flag
- update tag.proto + conversions to the new AllowedValues message
- simplify validation/error paths and keep system.tags display consistent1 parent 119f87d commit 5346432
File tree
49 files changed
+2162
-21
lines changed- src
- common/exception/src
- meta
- api/src
- app/src/schema
- tag
- proto-conv
- src
- tests/it
- protos/proto
- query
- ast
- src
- ast/statements
- parser
- tests/it
- testdata
- management/src/procedure
- service
- src
- databases/system
- interpreters
- access
- table_functions/policy_references
- tests/it/storages/testdata
- sql/src/planner
- binder
- ddl
- format
- plans
- ddl
- storages/system
- src
- tests/sqllogictests/suites/base/05_ddl
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
49 files changed
+2162
-21
lines changedSome 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 | |
|---|---|---|---|
| |||
373 | 373 | | |
374 | 374 | | |
375 | 375 | | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
376 | 388 | | |
377 | 389 | | |
378 | 390 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
132 | 134 | | |
133 | 135 | | |
134 | 136 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
220 | | - | |
| 220 | + | |
221 | 221 | | |
222 | 222 | | |
223 | | - | |
| 223 | + | |
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| 76 | + | |
75 | 77 | | |
76 | 78 | | |
77 | 79 | | |
| |||
102 | 104 | | |
103 | 105 | | |
104 | 106 | | |
| 107 | + | |
105 | 108 | | |
106 | 109 | | |
107 | 110 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
277 | | - | |
| 277 | + | |
278 | 278 | | |
279 | | - | |
| 279 | + | |
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
| |||
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
289 | | - | |
| 289 | + | |
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
| |||
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
302 | 301 | | |
303 | 302 | | |
304 | 303 | | |
| |||
308 | 307 | | |
309 | 308 | | |
310 | 309 | | |
311 | | - | |
| 310 | + | |
312 | 311 | | |
313 | 312 | | |
314 | 313 | | |
| |||
0 commit comments