Skip to content

[fix](doc) DROP-DATABASE / DROP-ROLE / data-bucketing: add CREATE setup so examples are self-contained#3842

Merged
morningman merged 1 commit into
apache:masterfrom
boluor:fix/drop-pages-and-data-bucketing-add-setup
May 30, 2026
Merged

[fix](doc) DROP-DATABASE / DROP-ROLE / data-bucketing: add CREATE setup so examples are self-contained#3842
morningman merged 1 commit into
apache:masterfrom
boluor:fix/drop-pages-and-data-bucketing-add-setup

Conversation

@boluor
Copy link
Copy Markdown
Contributor

@boluor boluor commented May 29, 2026

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

-- 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

…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 morningman merged commit a03391b into apache:master May 30, 2026
3 checks passed
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