This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris-website.git
The following commit(s) were added to refs/heads/master by this push:
new e15551eeb87 [fix](doc) ltrim.md zh example 3: correct expected output
(LTRIM does NOT strip \t / \n by default) (#3838)
e15551eeb87 is described below
commit e15551eeb876d6c65a6e9c69f67bf8898f806d52
Author: boluor <[email protected]>
AuthorDate: Fri May 29 19:59:10 2026 -0700
[fix](doc) ltrim.md zh example 3: correct expected output (LTRIM does NOT
strip \t / \n by default) (#3838)
## Summary
The original ZH example 3 ("多种空白字符处理") in `ltrim.md` ran:
```sql
SELECT LTRIM(' \t\n hello world');
```
and claimed the result was `hello world`. That's wrong: by default
`LTRIM` strips only ASCII space, not tab (`\t`) or newline (`\n`), so
the actual result is `\t\n hello world` — two characters shorter than
the input (the two leading spaces), not six chars shorter.
Rewrote the example along the same lines as the corresponding RTRIM
"默认只剥除 ASCII 空格" example: compare `LENGTH()` before and after the call
so the behavior is unambiguous and the doc renders cleanly without
embedded tabs/newlines in the result table.
## Verification
On Doris 4.1.1:
```
LENGTH(' \t\n hello world') -> 17
LENGTH(LTRIM(' \t\n hello world')) -> 15
```
So only 2 chars (the two leading spaces) are removed, as documented now.
## Context
Originally flagged when this example was excluded from the bulk ZH→EN
backport in PR #3833 (the only zh-only ltrim example whose expected
output didn't match reality on the cluster).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
---
.../scalar-functions/string-functions/ltrim.md | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-functions/scalar-functions/string-functions/ltrim.md
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-functions/scalar-functions/string-functions/ltrim.md
index 27387e43557..61910ae87a7 100644
---
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-functions/scalar-functions/string-functions/ltrim.md
+++
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-functions/scalar-functions/string-functions/ltrim.md
@@ -65,16 +65,16 @@ SELECT LTRIM('ababccaab', 'ab');
+----------------------------+
```
-3. 多种空白字符处理
+3. 默认只剥除 ASCII 空格 —— `LTRIM` 不带第二个参数时只剥除前导 ASCII 空格,**不**剥除制表符 (`\t`) 或换行符
(`\n`)。通过比较原串与 LTRIM 后字符串的长度可以验证:只有开头的两个 ASCII 空格被剥掉,`\t\n` 保留在结果中。
```sql
-SELECT LTRIM(' \t\n hello world');
+SELECT LENGTH(' \t\n hello world'), LENGTH(LTRIM(' \t\n hello world'));
```
```text
-+--------------------------------+
-| LTRIM(' \t\n hello world') |
-+--------------------------------+
-| hello world |
-+--------------------------------+
++-------------------------------+--------------------------------------+
+| LENGTH(' \t\n hello world') | LENGTH(LTRIM(' \t\n hello world')) |
++-------------------------------+--------------------------------------+
+| 17 | 15 |
++-------------------------------+--------------------------------------+
```
4. NULL 值处理
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]