Skip to content

[fix](doc) dev: backport 4.x string-function example expansions and corner-case adds (en+zh)#3848

Merged
morningman merged 1 commit into
apache:masterfrom
boluor:fix/dev-backport-string-function-example-expansions
May 30, 2026
Merged

[fix](doc) dev: backport 4.x string-function example expansions and corner-case adds (en+zh)#3848
morningman merged 1 commit into
apache:masterfrom
boluor:fix/dev-backport-string-function-example-expansions

Conversation

@boluor
Copy link
Copy Markdown
Contributor

@boluor boluor commented May 29, 2026

Summary

Mechanical port of the 4.x fixes in #3833, #3837, #3838, #3839 to dev/master. Verified against today's master build (selectdb-qa-test tarball).

Skipped (already applied on dev):

Files (13)

EN string-functions

EN other-functions

ZH

Verification

Verified end-to-end against today's master cluster — all added / modified examples behave identically on master as on 4.1.1, so the doc fixes apply unchanged.

Related 4.x PRs

#3833 #3837 #3838 #3839 (and #3789 for the field.md setup blocks).

🤖 Generated with Claude Code

…orner-case adds (en+zh)

Mechanical port of the 4.x fixes in apache#3833,
apache#3837, apache#3838, apache#3839 to dev/master.

  * strleft.md ZH (apache#3837) — already without the redundant example
    on dev, skipped.

  * milliseconds-add.md EN BIGINT-range example (apache#3834) —
    already in dev, skipped (the ZH duplicate-removal + expected-
    output fix is in the sibling PR).

Files changed:

EN (docs/sql-manual/sql-functions/scalar-functions/string-functions/):

  * from-base64.md, instr.md, length.md, locate.md, lpad.md
    — backport the corner-case examples (NULL / empty / multi-byte
       UTF-8 / numeric / etc.) added in 4.x apache#3833.
  * rtrim.md
    — add the LENGTH-based 'default-only-strips-ASCII-space'
      example that exposes the (intentional) behavior gap with
      \t and \n (4.x apache#3837).
  * substring.md
    — add the corner case 'empty source string' example that 4.x
      had but dev never did, plus the 'NULL passed directly'
      example added in 4.x apache#3839.
  * trim.md
    — replace example 2's prose + expected output with the
      version that says 'trim repeatedly strips from both ends',
      matching cluster behavior (`trim('ababccaab', 'ab') = 'cca'`
      not `'ababcca'`). Plus the UTF-8 multi-byte-pattern example
      from 4.x apache#3839.

EN (docs/sql-manual/sql-functions/scalar-functions/other-functions/):

  * field.md
    — replace the page with the 4.x post-apache#3789 + apache#3839 version:
      adds CREATE TABLE setup for `baseall` and `class_test` (which
      the page references but never created), adds a NULL row to
      the `class_test` data, adds DESC and NULLS FIRST examples
      that exercise NULL handling under custom FIELD ordering.

ZH (i18n/zh-CN/.../current/):

  * field.md
    — add the simple `SELECT FIELD(2, 3, 1, 2, 5)` example that
      introduces the 1-based-index semantics before the ORDER BY
      use case.
  * ltrim.md
    — rewrite example 3 ('多种空白字符处理') so its expected
      output matches reality: by default LTRIM only strips ASCII
      space, not \t / \n, so the result still contains the tab
      and newline. Switched to a LENGTH() comparison for clarity.
  * substring.md
    — add the SUBSTR alias example.
  * trim.md
    — add three examples (no-match returns original; repeated
      pattern strips until exhausted; asymmetric removal with
      multi-char pattern). Also drop a trailing ';;' typo.

Verified end-to-end against today's master cluster — all added /
modified examples behave identically on master and on 4.1.1 so
the doc fixes apply unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@morningman morningman merged commit 304e8ea into apache:master May 30, 2026
3 checks passed
@boluor boluor deleted the fix/dev-backport-string-function-example-expansions 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