[fix](doc) trim-in.md en: trim('ababccaab','ab') now returns 'cca', not 'ababccaab'#3811
Open
boluor wants to merge 1 commit into
Open
[fix](doc) trim-in.md en: trim('ababccaab','ab') now returns 'cca', not 'ababccaab'#3811boluor wants to merge 1 commit into
boluor wants to merge 1 commit into
Conversation
… 4.x, not 'ababccaab'
The "Comparison with TRIM" example in the EN page claimed that
`trim('ababccaab', 'ab')` returns the input unchanged. On Apache
Doris 4.1.1 `trim(str, rhs)` strips the literal `<rhs>` from both
ends and repeats until neither end matches, so it returns 'cca'.
The point of the side-by-side example (trim_in treats the 2nd arg
as a char SET; trim treats it as a literal SUBSTRING) still holds,
but with different output. Update the expected output and the intro
prose to call out the contrast more precisely.
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
Doc page (4.x): `scalar-functions/string-functions/trim-in.md` (EN).
The "Comparison with TRIM" example claimed that:
```sql
SELECT trim_in('ababccaab', 'ab'), trim('ababccaab', 'ab');
```
returns:
On Apache Doris 4.1.1 the second column is `cca`, not the input unchanged. `trim(, )` peels the literal `` from both ends and repeats until neither end matches, so `'ababccaab'` peels `'ab'` twice from the front and once from the back, leaving `'cca'`.
The side-by-side example's pedagogical point still works — `trim_in` treats the 2nd arg as a character set (peels any `a` or `b`) while `trim` treats it as a literal substring (peels exact `ab`) — just with different output. Update the result row to match cluster reality and tighten the intro prose to call out the char-set-vs-substring contrast more clearly. See PR #3810 for the companion fix on trim.md's own page.
Verification
```
mysql> SELECT trim_in('ababccaab', 'ab'), trim('ababccaab', 'ab');
+----------------------------+-------------------------+
| trim_in('ababccaab', 'ab') | trim('ababccaab', 'ab') |
+----------------------------+-------------------------+
| cc | cca |
+----------------------------+-------------------------+
```
Test plan
🤖 Generated with Claude Code