[fix](doc) ALTER-USER.md: add CREATE USER setup so examples are runnable end-to-end#3840
Merged
morningman merged 1 commit intoMay 30, 2026
Conversation
…ble end-to-end The Examples section ran four ALTER USER statements against jack@'%' without ever showing the CREATE USER statement that puts jack in place. Anyone copy-pasting from the doc into a fresh cluster hits 'User \"jack\"@\"%\" does not exist' on the very first example. Added a setup block at the top of the Examples section that creates jack first. Verified end-to-end on Doris 4.1.1: CREATE USER followed by all four ALTER USER variants now all succeed. Mirrored the change in both EN and ZH. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 29, 2026
morningman
pushed a commit
that referenced
this pull request
May 30, 2026
…up so examples are self-contained (#3842) ## 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. | Page | Missing setup added | |------|---------------------| | `DROP-DATABASE.md` | `CREATE DATABASE db_test;` | | `DROP-ROLE.md` | `CREATE ROLE role1;` | | `data-bucketing.md` | `CREATE DATABASE IF NOT EXISTS demo;` (the examples qualify `hash_bucket_tbl` / `random_bucket_tbl` / `dynamic_partition_tbl` with `demo.`) | Mirrored each change in EN and ZH. Verified end-to-end on Doris 4.1.1. ## Scope note `REVOKE-FROM.md` regressed 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 group `g1`, …) 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 ```sql -- DROP-DATABASE.md flow CREATE DATABASE db_test; DROP DATABASE db_test; -- DROP-ROLE.md flow CREATE ROLE role1; DROP ROLE role1; -- data-bucketing.md flow CREATE DATABASE IF NOT EXISTS demo; CREATE TABLE demo.hash_bucket_tbl(oid BIGINT, dt DATE, region VARCHAR(10), amount INT) DUPLICATE KEY(oid) DISTRIBUTED BY HASH(oid) BUCKETS 1 PROPERTIES("replication_num"="1"); DROP TABLE demo.hash_bucket_tbl; ``` All succeed on Doris 4.1.1. 🤖 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
…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
The Examples section on both EN and ZH runs four
ALTER USERstatements againstjack@'%'without ever showing theCREATE USERstatement that putsjackin place. Anyone copy-pasting from the doc into a fresh cluster hitsUser 'jack'@'%' does not existon the very first example.Added a setup block at the top of the Examples section that creates
jackfirst. This mirrors the pattern used by other Account Management pages and by the recently merged Bucket-1 missing-setup fixes.Verification
End-to-end on a fresh Doris 4.1.1 cluster:
Related
Surfaced by the doc verifier re-sweep on 2026-05-29 against a freshly redeployed cluster. The other three "P0" pages on that triage (
sql-blocking.md,PLAN-REPLAYER-DUMP.md,CREATE-ROLE.md) are not in this PR — they work cleanly on a fresh cluster on first run, and their re-run failures are tool-harness pollution against shared global namespaces (SQL_BLOCK_RULE, top-level DATABASE, ROLE) rather than doc bugs. That class of issue is already recorded indoris-verify/ISSUES.mdfor tool follow-up.🤖 Generated with Claude Code