Skip to content

[fix](doc) v3.x: fix ZH APPEND_TRAILING_CHAR_IF_ABSENT examples#3855

Merged
morningman merged 1 commit into
apache:masterfrom
boluor:fix/append-trailing-char-zh-sync-3.x
May 30, 2026
Merged

[fix](doc) v3.x: fix ZH APPEND_TRAILING_CHAR_IF_ABSENT examples#3855
morningman merged 1 commit into
apache:masterfrom
boluor:fix/append-trailing-char-zh-sync-3.x

Conversation

@boluor
Copy link
Copy Markdown
Contributor

@boluor boluor commented May 29, 2026

Problem

The ZH page kept an older combined example whose third call, APPEND_TRAILING_CHAR_IF_ABSENT('ac', 'cd'), was documented as returning accd. That is wrong: <trailing_char> is a single trailing character, and passing a 2-character string returns NULL on the server.

The EN page was already rewritten into five focused single-character examples; this PR brings ZH in line with EN (EN is the reference and is unchanged).

Cluster verification (Doris 3.1.4-rc02)

Actual output, pasted into the doc:

SELECT APPEND_TRAILING_CHAR_IF_ABSENT('a', 'c');    -> ac
SELECT APPEND_TRAILING_CHAR_IF_ABSENT('ac', 'c');   -> ac
SELECT APPEND_TRAILING_CHAR_IF_ABSENT('', '/');     -> /
SELECT APPEND_TRAILING_CHAR_IF_ABSENT(NULL, 'c');   -> NULL
SELECT APPEND_TRAILING_CHAR_IF_ABSENT('acf', 'ṛ');  -> acfṛ

Confirming the removed case is genuinely wrong:

SELECT APPEND_TRAILING_CHAR_IF_ABSENT('ac', 'cd');  -> NULL   (doc previously said 'accd')

🤖 Generated with Claude Code

The ZH page kept an older combined example whose third call,
APPEND_TRAILING_CHAR_IF_ABSENT('ac', 'cd'), was documented as returning
'accd'. That is wrong: `<trailing_char>` is a single trailing character, and
passing a 2-character string returns NULL on the server. The EN page was
already rewritten into five focused single-character examples; this brings ZH
in line with EN.

Cluster verification (Doris 3.1.4-rc02) — actual output pasted into the doc:

    SELECT APPEND_TRAILING_CHAR_IF_ABSENT('a', 'c');    -> ac
    SELECT APPEND_TRAILING_CHAR_IF_ABSENT('ac', 'c');   -> ac
    SELECT APPEND_TRAILING_CHAR_IF_ABSENT('', '/');     -> /
    SELECT APPEND_TRAILING_CHAR_IF_ABSENT(NULL, 'c');   -> NULL
    SELECT APPEND_TRAILING_CHAR_IF_ABSENT('acf', 'ṛ');  -> acfṛ

    -- and confirming the removed case is wrong:
    SELECT APPEND_TRAILING_CHAR_IF_ABSENT('ac', 'cd');  -> NULL   (doc said 'accd')

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@morningman morningman merged commit e3890fe into apache:master May 30, 2026
3 checks passed
morningman pushed a commit that referenced this pull request May 30, 2026
…3858)

Backport of #3855 to `version-2.1`.

## Problem

On v2.1 **both** the EN and ZH pages keep the old combined example whose
third call, `APPEND_TRAILING_CHAR_IF_ABSENT('ac', 'cd')`, is documented
as returning `accd`. That is wrong: `<trailing_char>` is a **single**
trailing character, and passing a 2-character string returns `NULL`.

(On v3.x only ZH needed this — EN had already been rewritten. On v2.1
neither language was rewritten, so this PR fixes both.)

## Fix

Replace the combined example with five focused single-character
examples, matching the corrected v3.x EN page.

## Cluster verification (Doris 2.1.11-rc01)

```
SELECT APPEND_TRAILING_CHAR_IF_ABSENT('a', 'c');    -> ac
SELECT APPEND_TRAILING_CHAR_IF_ABSENT('ac', 'c');   -> ac
SELECT APPEND_TRAILING_CHAR_IF_ABSENT('', '/');     -> /
SELECT APPEND_TRAILING_CHAR_IF_ABSENT(NULL, 'c');   -> NULL
SELECT APPEND_TRAILING_CHAR_IF_ABSENT('acf', 'ṛ');  -> acfṛ

-- and confirming the removed case is wrong:
SELECT APPEND_TRAILING_CHAR_IF_ABSENT('ac', 'cd');  -> NULL   (doc previously said 'accd')
```

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@boluor boluor deleted the fix/append-trailing-char-zh-sync-3.x branch May 30, 2026 08:25
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