Repository navigation
Closed
Closed
Copy link
Description
Is there an existing issue for the same bug?
- I have checked the existing issues.
Branch Name
main
Commit ID
Other Environment Information
- MatrixOne was built from the commit above and started locally with etc/launch/launch.toml.
- MySQL comparison version: 8.0.45.
- Every query was repeated three times with the same result.Actual Behavior
MatrixOne implements only part of MySQL's REGEXP match_type API:
REGEXP_INSTRhas no six-argument overload,REGEXP_SUBSTRhas no
five-argument overload, andREGEXP_REPLACEhas no six-argument overload.
Validcandimatch modes are therefore rejected as invalid function
signatures.REGEXP_LIKEacceptsc,i,m, andn, including MySQL's rightmost
c/iprecedence, but rejects the valid MySQLumatch mode as invalid
input. A row-dependent match_type column containinguaborts the complete
query.
Representative errors are:
invalid argument function regexp_instr, bad value [VARCHAR VARCHAR BIGINT BIGINT BIGINT VARCHAR]
invalid argument function regexp_substr, bad value [VARCHAR VARCHAR BIGINT BIGINT VARCHAR]
invalid argument function regexp_replace, bad value [VARCHAR VARCHAR VARCHAR BIGINT BIGINT VARCHAR]
invalid input: regexp_like got invalid match_type input!
Expected Behavior
MatrixOne should accept the MySQL 8.0 match_type signatures and flags. For
the examples below, MySQL 8.0.45 returns:
REGEXP_INSTR(..., 'i') 1
REGEXP_INSTR(..., 'c') 5
REGEXP_SUBSTR(..., 'i') Abc
REGEXP_SUBSTR(..., 'c') abc
REGEXP_REPLACE(..., 'i') X X
REGEXP_REPLACE(..., 'c') Abc X
REGEXP_LIKE(..., 'u') 1
Steps to Reproduce
SELECT REGEXP_INSTR('Abc abc','abc',1,1,0,'i');
SELECT REGEXP_INSTR('Abc abc','abc',1,1,0,'c');
SELECT REGEXP_SUBSTR('Abc abc','abc',1,1,'i');
SELECT REGEXP_SUBSTR('Abc abc','abc',1,1,'c');
SELECT REGEXP_REPLACE('Abc abc','abc','X',1,0,'i');
SELECT REGEXP_REPLACE('Abc abc','abc','X',1,0,'c');
SELECT REGEXP_LIKE('abc','abc','u');
CREATE DATABASE codex_regexp_match_type_0907;
USE codex_regexp_match_type_0907;
CREATE TABLE r(
id INT PRIMARY KEY,
s VARCHAR(40),
p VARCHAR(20),
mt VARCHAR(8)
);
INSERT INTO r VALUES
(1,'Abc abc','abc','i'),
(2,'Abc abc','abc','c'),
(3,'abc','abc','u');
SELECT id, REGEXP_LIKE(s,p,mt) AS matched
FROM r
ORDER BY id;
-- Controls already supported by MatrixOne.
SELECT REGEXP_LIKE('Abc','abc','ic');
SELECT REGEXP_LIKE('Abc','abc','ci');
SELECT REGEXP_LIKE('a\nb','a.b','n');
SELECT REGEXP_LIKE('a\nb','^b','m');Additional information
The available overloads are registered in
pkg/sql/plan/function/list_builtIn.go. getPureMatchType in
pkg/sql/plan/function/func_builtin_regexp.go recognizes only c, i, m,
and n.
This is distinct from #27217, which covers text/binary source provenance and
prepared-parameter execution rather than the match_type function signatures
and u flag.
Activity
XuPeng-SH commentedon Sep 14, 2026
已由已合并的 PR #28794 完成:该 PR 包含原关闭 PR #28787 的 match_type overload 实现,并覆盖 REGEXP_INSTR/REGEXP_SUBSTR/REGEXP_REPLACE。关闭为 completed。