Repository navigation
Description
Is there an existing issue for the same feature request?
- I have checked the existing issues.
Is your feature request related to a problem?
SHOW PUBLICATIONS LIKE 'pattern' can be prepared and executed with a literal pattern, but a parameter marker is currently rejected at PREPARE:
PREPARE pub_show FROM 'SHOW PUBLICATIONS LIKE ?';
-- not supported: prepared SHOW PUBLICATIONS requires a string literal LIKE patternApplications that filter publications using a dynamic pattern cannot reuse a server-side prepared statement. This is a separate follow-up to #16543 and #29386; #29386 intentionally rejects nonliteral patterns rather than advertising zero parameters.
Describe the feature you'd like
Support a single string parameter in SHOW PUBLICATIONS LIKE ? for both SQL PREPARE / EXECUTE ... USING and MySQL binary protocol COM_STMT_PREPARE / COM_STMT_EXECUTE.
Expected example:
PREPARE pub_show FROM 'SHOW PUBLICATIONS LIKE ?';
SET @pattern = 'team_%';
EXECUTE pub_show USING @pattern;
SET @pattern = 'other_%';
EXECUTE pub_show USING @pattern;
DEALLOCATE PREPARE pub_show;Acceptance criteria:
- PREPARE reports exactly one string parameter and the existing eight result columns, without querying or changing publication state.
- Each EXECUTE evaluates the current bound pattern using the same LIKE semantics as a literal
SHOW PUBLICATIONS LIKE '...'; different bindings on one handle yield the corresponding rows, including an empty result with the same column metadata. - Both SQL and binary protocol execution work. Missing or invalid parameter bindings return an error without corrupting the prepared handle; it remains reusable on a later valid execution.
- Authorization and publication visibility are evaluated at execution time.
- Literal LIKE and
SHOW PUBLICATIONSwithout LIKE keep their current behavior.
Describe implementation you've considered
The current frontend handler reads the LIKE right operand only when it is a string tree.NumVal; the planner explicitly rejects other forms in getPreparePlan. Parameter support needs the parameter metadata and an execution-time bound value to reach that frontend handler. Please use the existing prepared-parameter lifecycle and keep the SHOW result schema shared between PREPARE metadata and execution. This issue requests only the parameter marker; general arbitrary LIKE expressions are outside scope.
Documentation, Adoption, Use Case, Migration Strategy
Useful for JDBC and other clients that use server-side prepared statements to list publications by a user-supplied pattern, without constructing SQL text for each pattern.
Additional information
Related: #16543 and #29386. No dedicated existing issue was found by searching open and closed MatrixOne issues for prepared publication parameters or SHOW PUBLICATIONS LIKE ?.
Activity
feat(frontend): support prepared SHOW PUBLICATIONS LIKE parameters (#…
Ariznawlll commentedon Sep 27, 2026
测试版本
main5be6cd90b501da225be591ffffe6000bf01f515e原问题验证
按 issue 原始 SQL 在最新 main 上独立执行 3 次,结果 3/3 符合修复预期;确认修复提交
630afbe96cbbbfecc83d1f891256efb5d02df30b已包含在当前 main。Happy Path 覆盖
SHOW PUBLICATIONS LIKE ?在motr_pub_a%与motr_pub_b%两次绑定中各只返回对应 publication,空模式返回空集。Unhappy Path 覆盖
白盒验证
核对修复提交
630afbe96cbbbfecc83d1f891256efb5d02df30b、对应 BVT/UT 以及当前 main 的祖先关系;本次同时完成公开 SQL 协议验收。回归测试
已加入 MOTR PR #204 的
issue_29388_prepared_show_publications.test,MOTR 提交c7aeb11c;本地基线比对连续 3 次通过。测试证据
5be6cd90b501da225be591ffffe6000bf01f515e测试结论
测试通过。