Skip to content

[fix](doc) ALTER-USER.md: add CREATE USER setup so examples are runnable end-to-end#3840

Merged
morningman merged 1 commit into
apache:masterfrom
boluor:fix/alter-user-add-create-user-setup
May 30, 2026
Merged

[fix](doc) ALTER-USER.md: add CREATE USER setup so examples are runnable end-to-end#3840
morningman merged 1 commit into
apache:masterfrom
boluor:fix/alter-user-add-create-user-setup

Conversation

@boluor
Copy link
Copy Markdown
Contributor

@boluor boluor commented May 29, 2026

Summary

The Examples section on both EN and ZH runs 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. 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:

CREATE USER jack@'%' IDENTIFIED BY "12345";
ALTER USER jack@'%' IDENTIFIED BY "abcde";
ALTER USER jack@'%' FAILED_LOGIN_ATTEMPTS 3 PASSWORD_LOCK_TIME 1 DAY;
ALTER USER jack@'%' ACCOUNT_UNLOCK;
ALTER USER jack@'%' COMMENT "this is my first user";
-- all five statements succeed

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 in doris-verify/ISSUES.md for tool follow-up.

🤖 Generated with Claude Code

…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>
@morningman morningman merged commit d508a45 into apache:master May 30, 2026
3 checks passed
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants