matrixorigin / matrixorigin/matrixone

[Subtask]: Complete ordinary binary-string and charset/collation semantics

Open
#27,216 1 comment 0 reactions 1 assignee Claimed by @Ariznawlll View on GitHub
kind/subtask
Dominant language
Go
Stars
1.9k
Forks
311
Avg merge
1d 3h
Merged PRs (30d)
768

Description

### Parent Issue

Primary issues: #25295, #25300, and #25301. Related source-category work: #25299.

Related implementation: #26907.

### Detail of Subtask

Complete ordinary binary-string byte semantics together with charset and collation reporting.

#### Invariant

Binary strings operate on bytes and report the binary charset/collation. Text strings operate on characters and retain their resolved text charset/collation. Equivalent values from different reachable sources must not silently switch domains.

#### Scope

- Length and position: CHAR_LENGTH, LENGTH, BIT_LENGTH, OCTET_LENGTH, LOCATE, INSTR, and position-returning variants.
- Slicing and ordering: SUBSTRING, LEFT, RIGHT, REVERSE, trim functions, case conversion, and byte-preserving transforms.
- Charset/collation consumers: CHARSET, COLLATION, comparison/coercion metadata, and result metadata exposed to SQL clients.
- Inputs: raw literals, _binary literals, BINARY, VARBINARY, BLOB, explicit casts, columns, bare user variables, SQL PREPARE, COM_STMT, mixed rows, typed NULL, and invalid UTF-8 bytes.

#### Acceptance criteria

- [ ] A function matrix records whether each argument is a subject, auxiliary argument, delimiter, or domain selector.
- [ ] Every retained case has a nearest text control and a nearest binary control.
- [ ] Public SQL results are differential-tested against the intended MySQL 8.4 behavior where compatibility is the contract.
- [ ] Mixed-row vectors preserve per-row results without changing the statically declared domain.
- [ ] CHARSET and COLLATION agree with expression metadata, protocol metadata, and materialized column metadata.
- [ ] Invalid UTF-8 is processed as bytes in binary mode and never repaired or truncated implicitly.
- [ ] Focused function tests and public SQL regression tests both cover the matrix.

#### Out of scope

REGEXP source rules and output-width/CTAS sizing are tracked separately.

### Describe implementation you've considered

Classify every argument by semantic role and derive byte/text mode from the owning subject/domain rule. Do not let an auxiliary binary argument accidentally switch the subject's interpretation unless the function contract requires it.

### Additional information

This subtask deliberately includes #25300 even though that parent issue currently carries the deferred label. Creating this subtask does not change that label or the parent's lifecycle state.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.