Repository navigation
Conversation
XuPeng-SH
requested changes
Aug 13, 2026
XuPeng-SH
left a comment
Contributor
There was a problem hiding this comment.
Request changes.
The current UT is failing in the test added by this PR: TestImplicitStringCastPreservesBinaryCharsetMetadata. It panics with type mismatch: casting VARCHAR vector to []types.Type at func_cast_test.go:2737. Please fix the vector/test setup or implementation, then rerun UT/BVT. The Coverage failure is only a downstream cascade.
# Conflicts: # pkg/frontend/util.go # pkg/sql/plan/base_binder.go # pkg/sql/plan/function/list_builtIn.go # pkg/sql/plan/function/type_check.go
This branch had an error being deployed
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.
What type of PR is this?
Which issue(s) this PR fixes:
issue #25299
What this PR does / why we need it:
MySQL 8.4 rejects incompatible static binary/nonbinary operand combinations used by
REGEXP,NOT REGEXP, and theREGEXP_*functions with error 3995 (HY000). It does not reject every binary regexp expression: binary/binary expressions are valid and use byte semantics, and parameter markers are exempt from the static incompatibility check. An ordinary untypedNULLis also exempt, while a statically binary expression such asCAST(NULL AS BINARY)is not.MatrixOne previously let the generic fixed-type matcher cast
BINARY,VARBINARY, andBLOBoperands toVARCHARbefore regexp compatibility validation, so incompatible static binary/nonbinary expressions executed instead of failing.This change:
REGEXP_LIKE,REGEXP_INSTR,REGEXP_SUBSTR, andREGEXP_REPLACE;HY000, including the correct function name and operand order;PARAM_ITEMand ordinaryNULL_ITEMexceptions, so SQL/binary-protocol parameter markers and untypedNULLare not rejected by the static check;CAST(NULL AS BINARY)when paired with a nonbinary operand;match_typeoverloads forREGEXP_INSTR,REGEXP_SUBSTR, andREGEXP_REPLACE, includingc,i,m,n, andubehavior;return_option, and replacement capture expansion;Examples of the intended contract:
An explicit empty
match_typepreserves MatrixOne's existing case-sensitive default. Matching MySQL's collation-derived default would require propagating collation metadata into the function executor and is outside this change.Validation:
make build.agents/skills/mo-dev/scripts/mo-cgo-test ./pkg/common/moerr ./pkg/sql/plan/function ./pkg/sql/plan ./pkg/frontend -count=1.agents/skills/mo-dev/scripts/mo-cgo-test ./pkg/tests/issues -run '^TestIssue25299RegexpRejectsBinaryCharset$' -count=1 -timeout 5mgit diff --checkmo-self-reviewon the complete diff