Repository navigation
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Reviewed target bff80fa30846707eaab4de137cf49d4c2d39ed35 against main@a0770f5dc4a296f8407bbebf6a2664bac9972e53.
[P1] Supply and approve the versioned design for the REGEXP domain refactor before implementation acceptance. The complete change materially restructures the core contract across binder classification, prepared specialization, operand decoding, result encoding and error precedence: new StringDomainCheck modes, the regexpStringParameter conversion abstraction, marker-specific return-type derivation, and consumer-local source rewriting. It is approximately 700 changed non-generated production lines across the error/planner/function boundaries. This triggers the repository's design-first requirement for a major core-abstraction/compatibility refactor, both by size and by the cross-boundary contract changes; the BUG label does not exempt the actual scope.
The implementation PR, comments/reviews, issue #27217 and linked preceding #26907/#25299 provide requirements and extensive implementation/testing descriptions, but do not link an exact stable versioned design with a traceable design approval. An issue acceptance matrix or coverage percentage does not replace that mandatory artifact.
Suggested closure: add/link a design revision covering the separate static/decode/result matrices, source ownership through folding and prepared reuse, typed NULL/error precedence, charset conversion and offset/anchor invariants, alternatives, compatibility across CN versions, bounded conversion/cache/output costs, and the explicit exclusions for materialized aliases and large-text metadata. Record a distinct design review decision, then check implementation alignment against that revision. No RFC format or redundant blanket test rerun is required.
Review scope/limits: inventoried all 16 changed files and inspected production changes sufficiently to establish the trigger and critical boundaries. The design gate stops implementation approval; I am not claiming a completed runtime correctness/performance PASS or a reproduced runtime defect. Author-reported MySQL 8.4.8 oracle, package tests, real COM_STMT tests and BVT/coverage evidence are substantial and may be reused after the design gate; this finding is not based on optional evidence being absent. I did not run native tests or wait for CI. Exact live head/base rechecked before posting.
fengttt
left a comment
There was a problem hiding this comment.
Just like the other PR, #28428 , I don't understand WHY this param binding/cast has anything to do with one, or several particular functions. I don't understand all the stringdomains, why are they necessary.
Regexp is a strange animal, so the param may need some handling, sure, but why isn't this happen in the functions execution time? Handling depends on whether the param comes from session var or prepared statement, is really strange.
| // SQL EXECUTE can substitute a literal before this consumer binds. | ||
| // Preserve the marker owner on this REGEXP argument only, rather | ||
| // than changing the shared parameter used by unrelated consumers. | ||
| boundArgs[i] = DeepCopyExpr(boundArgs[i]) |
There was a problem hiding this comment.
What is this DeepCopy doing? Why?
aptend
left a comment
There was a problem hiding this comment.
Reviewed exact head e925266a4e17841c581c7d176682a9497220ffc2 against exact base 4f9d170a22deaabc2eee6b239a51a8cb40a39f9f.
The design gate is still blocking. This change establishes a cross-boundary REGEXP contract across binder item classification, prepared-plan specialization, vector provenance, operand decoding, result encoding, error precedence, and release routing. The immutable r1 itself still says “待独立设计审批;实现验收仍阻塞” at lines 3/7 and leaves the approver/SHA/link pending at lines 127-133. The newly added decision document does not supply independently reviewable approval: it transcribes two phrases from an unidentified private development conversation, gives no source link, and explicitly says it is not GitHub reviewer approval. This is material because the decision purportedly accepts the function-specific planner/rebind architecture, an operational same-version-CN routing constraint with no enforcement mechanism, and explicit scope exclusions. A current owner review still has the architecture question open.
Closure: have the appropriate design owner review an immutable r1 (or a new revision) in a traceable venue and record the approver identity, exact design SHA, decision link, and explicit acceptance/rejection of the planner coupling, release constraint, resource tradeoff, and exclusions. Then update the r1 status/approval record and perform the promised implementation-alignment review, including resolution of the current architecture thread. A PR-local transcript written by the implementation side cannot replace that independent decision.
I inspected the complete 18-file diff, all review/inline history and the unresolved thread, issue #27217, static/execute-time domain matrices, prepared reuse/source isolation (including the DeepCopy path), per-operand conversion, invalid-UTF-8/NULL/error ordering, offsets/anchors, output domains, cache and failure paths. Exact-head focused tests passed for pkg/sql/plan/function, pkg/sql/plan, pkg/frontend, pkg/common/moerr, and the real TestRegexpPreparedProtocolSources protocol test; diff-check and gofmt are clean. The current CI failures reproduce only the unrelated pkg/vectorindex TestAppendColumnBuffer_AllTypes/json failure. I am not asserting an additional runtime defect beyond this blocking design/ownership issue.
| - 日期:2026-09-12。 | ||
| - 设计:[r1 固定版本](https://github.com/ck89119/matrixone/blob/931f646eb986221e34285e14f35ce85dc515e2a0/docs/design/CLAUDE_REGEXP_DOMAINS_27217_r1.md)。 | ||
| - 文档内容 SHA-256:`bdb3dc057ebf620b17b899dd39b5eeff51e9303b9e9d097ba194b231ba3d1ba2`。 | ||
| - 审批来源:项目用户在开发会话中明确回复「确认 r1 设计」,随后回复「go ahead」授权交付。 |
There was a problem hiding this comment.
[P1] This is not an independently verifiable approval record.
Trigger/reproduction: follow the claimed approval in lines 8-10. It points only to two quoted phrases in a private development conversation, without an approver identity or source link, while the immutable r1 still says approval is pending and requires an approver, exact SHA, and link. The record also explicitly says it is not GitHub reviewer approval.
Impact: these lines currently purport to authorize the new function-specific binder/rebind architecture, same-version routing release constraint, resource tradeoff, and exclusions. Without a reviewable decision from the appropriate design owner, reviewers/operators cannot establish who accepted those contracts, and the implementation-side transcript can self-close the very independent gate it is meant to satisfy.
Please replace this with a traceable independent approval (identity, exact immutable design SHA, decision URL, and explicit disposition of those material choices), update the r1 pending status, and complete implementation alignment after that decision.
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #27217
What this PR does / why we need it:
Separate three REGEXP decisions that cannot share an OR-of-IsBin shortcut:
Also correct SUBSTR/REPLACE terminal-position handling and the independently verified occurrence boundary rules.
Validation
make -j8passed.pkg/sql/plan/function,pkg/sql/plan, andpkg/frontendtests passed with the repository CGo wrapper,-count=1, and coverage instrumentation.TestRegexpPreparedProtocolSourcespassed: actual COM_STMT type descriptors 252/254, COM PREPARE error 3995, fresh-versus-reused statements, metadata stability, invalid pattern recovery, and typed NULL followed by text/BLOB reuse.-coverpkgblocks across test binaries are merged before counting.StringSourceis not treated as UTF-8 validity provenance: VARCHAR columns and every expression source preserve MySQL's text conversion behavior. Text decoding follows MySQL's lead-byte input-width rule before validating continuation bytes: C2–DF require 2 bytes, E0–EF require 3, and F0–FF require 4. Insufficient input truncates at the valid prefix; a complete but ill-formed continuation, overlong, surrogate, or out-of-range sequence returns MySQL error 3854 (utf8mb4toutf16le).pos, so malformed/truncatable bytes beforeposcannot affect matching. INSTR/SUBSTR preserve malformed-pattern 3854 even with NULL subjects. SUBSTR then lets NULL position/occurrence determine NULL before rejecting non-positive position and processing NULL subject/pattern. REGEXP_REPLACE follows observable precedence: compile non-NULL pattern, return NULL for NULL position/occurrence, reject non-positive position, validate replacement in its original text domain, apply remaining nullable arguments, then validate subject. A text replacement for binary BLOB-column matching is converted only after validation. Predicate/INSTR/SUBSTR/REPLACE reject ill-formed sequences even when an early regexp match precedes them. Without independent validity provenance this requires validating the relevant complete text value/suffix; the PR no longer claims that source ownership proves validity or that every large early match can skip conversion validation.mo-testergenerated and verified both changed result files. Nine related BVT scripts passed consecutively on one fresh instance; the final source matrix (63/63) and INSTR suite (187/187) passed with zero database residue. The permissive-VARCHAR case changes sessionsql_modeonly around INSERT, restores it before querying, and the following eight scripts verify no state leakage.Scope notes
QueryContext/PrepareContext; loop bodies use per-operation helpers so defers do not accumulate. Conversion errors preserve printable source bytes, escape invalid bytes as uppercase\\xNN, preserve DEL0x7F, and follow MySQL's first-six-source-bytes plus...formatting.TEXTrepresentation is retained; MySQL reportsLONGTEXTfor REPLACE's expansion bound. This PR fixes text-versus-binary result semantics, not global large-text protocol mapping.mo-tester; this also updates its result-header formatting.Versioned design and separate design decision
The project user explicitly approved r1 in the development conversation on 2026-09-12, then authorized delivery. This is a separately recorded design decision, not a claim that the design preceded the existing implementation or that the GitHub reviewer has approved it. The record maps the implementation to the design and preserves the mixed-version, resource-budget, materialized-alias and large-text exclusions.
This update publishes design artifacts and synchronizes the upstream base; it makes no REGEXP implementation changes. Earlier runtime/coverage evidence is historical and is not claimed as an exact-head pass after the upstream merge. The PR remains draft pending implementation acceptance.