[fix](doc) DROP-DATABASE / DROP-ROLE / data-bucketing: add CREATE setup so examples are self-contained#3842
Merged
morningman merged 1 commit intoMay 30, 2026
Conversation
…up so examples are self-contained
Three pages whose examples reference an object the page itself never
creates. On a fresh cluster the very first example fails -- they only
ever worked by accident when an earlier page in the sweep had left
the object behind. Same shape as the earlier Bucket-1 / ALTER-USER
missing-setup work; just newly exposed once the verifier started
cleaning up global namespaces between pages.
* DROP-DATABASE.md — add `CREATE DATABASE db_test` before the DROP
* DROP-ROLE.md — add `CREATE ROLE role1` before the DROP
* data-bucketing.md — the examples qualify table names with `demo.`
and the doc never creates `demo`. Added
`CREATE DATABASE IF NOT EXISTS demo` at the
top of the example section.
Mirrored each change in EN and ZH. Verified end-to-end on Doris 4.1.1.
Note: REVOKE-FROM.md was on the same regression list but its examples
reference six separate objects (jack@192.%, role1/role2/my_role/
test_role, workload group g1, …) plus one parser-rejected REVOKE-FROM-
ROLE syntax. That needs more thought than a one-line setup; left for
later.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
morningman
pushed a commit
that referenced
this pull request
May 30, 2026
…TABASE / DROP-ROLE / data-bucketing (en+zh) (#3846) ## Summary Five pages document a `<verb> <object>` operation but never show the matching `CREATE` / `GRANT` that establishes the object. On a fresh cluster every one of them fails on the very first example. The 4.x branch is fixing this in #3840 (ALTER-USER), #3842 (DROP-DATABASE / DROP-ROLE / data-bucketing), and #3850 (REVOKE-FROM). This PR ports the exact same fixes to **dev/master**, where the bugs are also present — verified against today's master build. ## Changes | Page | Setup added | |---|---| | `ALTER-USER.md` (en+zh) | `CREATE USER jack@'%' IDENTIFIED BY ...` | | `DROP-DATABASE.md` (en+zh) | `CREATE DATABASE db_test;` | | `DROP-ROLE.md` (en+zh) | `CREATE ROLE role1;` | | `data-bucketing.md` (en+zh) | `CREATE DATABASE IF NOT EXISTS demo;` (table examples qualify with `demo.`) | | `REVOKE-FROM.md` (en+zh) | full prereq block (users / roles / db / workload group + GRANTs for every REVOKE target); EN also drops one example whose `REVOKE roles FROM ROLE` syntax contradicts the page's own Syntax block and is parser-rejected by 4.1.1 | ## Verification End-to-end verified on freshly deployed clusters (4.1.1 + today's master build): ``` CREATE USER jack@'%' ... → 4 ALTER USER variants → DROP USER OK CREATE DATABASE db_test → DROP DATABASE db_test OK CREATE ROLE role1 → DROP ROLE role1 OK CREATE DATABASE demo → CREATE TABLE demo.hash_bucket_tbl → DROP OK REVOKE-FROM setup block (CREATE+GRANT chain) → all 10 EN REVOKE OK REVOKE-FROM setup block (with test_role) → all 11 ZH REVOKE OK ``` ## Related 4.x: #3840 · #3842 · #3850 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
morningman
pushed a commit
that referenced
this pull request
May 30, 2026
…xample (en+zh) (#3850) ## Summary The Examples section ran a dozen `REVOKE` statements against users, roles, workload group `g1`, compute group `group1`, storage vault `vault1`, etc. **without ever showing a single CREATE / GRANT**. On a fresh cluster every example fails — same shape as the earlier Bucket-1 / ALTER-USER / DROP-DATABASE / DROP-ROLE / data-bucketing missing-setup family. ## Changes **Added** at the top of the Examples section: a single Setup block that 1. creates the users (`jack@'192.%'`, `jack@'%'`), roles (`role1`, `role2`, `my_role`, plus `test_role` on the ZH side), the `db1` database, and workload group `g1`; 2. runs the prerequisite `GRANT` statements so each subsequent `REVOKE` has something to remove (you can't revoke a privilege that was never granted). **Removed** (EN only): the example ```sql REVOKE 'role1','role2' FROM ROLE 'test_role'; ``` The page's own Syntax block (line 43) only documents: ``` REVOKE <role_list> FROM <user_identity> ``` That syntax does **not** allow `FROM ROLE <name>` for the role-list form, and 4.1.1's parser rejects the statement as `extraneous input 'ROLE'`. The example contradicted the page's spec and didn't work on the documented version. The ZH page also has an example with `FROM ROLE` at the same position, but it's a **different** statement (`REVOKE USAGE_PRIV ON WORKLOAD GROUP 'g1' FROM ROLE 'test_role'`) — that one **is** supported and is kept. ## Verification End-to-end on a fresh Doris 4.1.1 cluster: ``` Setup block: OK All 10 EN REVOKE examples: OK All 11 ZH REVOKE examples: OK ``` ## Related 4.x missing-setup PRs (now closed) #3821-#3827 (Bucket 1) · #3840 (ALTER-USER) · #3842 (DROP-DATABASE / DROP-ROLE / data-bucketing) · **#this** (REVOKE-FROM). Same set has been backported to dev/master in #3846. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three pages whose examples reference an object the page itself never creates. On a fresh cluster the very first example fails — they only ever worked by accident when an earlier page in the sweep had left the object behind. Same shape as the earlier Bucket-1 /
ALTER-USER.md(#3840) missing-setup work; newly exposed once the verifier started cleaning up cluster-global namespaces (users / roles / SQL block rules / top-level databases) between pages.DROP-DATABASE.mdCREATE DATABASE db_test;DROP-ROLE.mdCREATE ROLE role1;data-bucketing.mdCREATE DATABASE IF NOT EXISTS demo;(the examples qualifyhash_bucket_tbl/random_bucket_tbl/dynamic_partition_tblwithdemo.)Mirrored each change in EN and ZH. Verified end-to-end on Doris 4.1.1.
Scope note
REVOKE-FROM.mdregressed on the same triage but is not in this PR — its examples reference six different cluster-scoped objects (jack@'192.%',role1/role2/my_role/test_role, workload groupg1, …) plus one statement (REVOKE 'role1','role2' FROM ROLE 'test_role') whose syntax 4.1.1's parser rejects. Properly fixing that page is a larger piece of work and is deferred.Verification
All succeed on Doris 4.1.1.
🤖 Generated with Claude Code