Repository navigation
Description
Summary
CREATE TABLE ... CLONE, database CLONE, and DATA BRANCH cannot handle a valid table identifier that contains an embedded backtick. The source table can be created, written, and queried normally when the embedded delimiter is doubled, but clone/branch resolution either looks for a different table name or emits malformed internal SQL.
Tested revision
2eb7f523e5a10f352d3e258183ed8440510388de
Reproduction
drop database if exists g4d_backtick_probe;
create database g4d_backtick_probe;
use g4d_backtick_probe;
create table `src``one` (id int primary key, v varchar(20));
insert into `src``one` values (1, 'row-one');
-- The source table is valid and readable.
select count(*), min(v) from `src``one`;
-- Both table-level paths fail.
create table ordinary_clone clone `src``one`;
data branch create table branch_clone from `src``one`;The same result was reproduced independently with src``two and src``three.
Database-level paths fail as well:
create database g4d_backtick_scope;
use g4d_backtick_scope;
create table `src``table` (id int primary key, v varchar(20));
insert into `src``table` values (1, 'source-row');
data branch create database g4d_backtick_scope_branch from g4d_backtick_scope;
create database g4d_backtick_scope_clone clone g4d_backtick_scope;Actual result
The table-level paths resolve a non-existent name:
ERROR 1146 (HY000): no such table g4d_backtick_probe.src``one
The database-level paths generate malformed SQL while reading the source table definition:
ERROR 1105 (HY000): ... syntax error ... near "table`"
Afterward, DROP DATABASE g4d_backtick_scope also fails while processing the same table. Dropping the table explicitly with DROP TABLE `srctable` `` and then dropping the database succeeds.
Expected result
All clone and Data Branch paths should resolve the catalog name as src + backtick + one, quote it as `srcone` ``, and preserve the source rows. Database cleanup should not require dropping such tables one by one.
Code observations
-
cloneTableRestoreSQLserializes the parsed clone AST with identifier quoting, but the table-level clone path behaves as if the doubled delimiter is retained in the identifier value. -
getCreateTableSqlbuildsshow create tablewith:fmt.Sprintf("show create table `%s`.`%s`", dbName, tblName)
without doubling embedded backticks in either identifier. This affects database clone/Data Branch source collection.
This is distinct from apostrophes inside SQL string literals: the failure here is identifier delimiter round-tripping.
Activity
VioletQwQ-0 commentedon Jul 29, 2026
PR #26317 merged as
1ce594dada6cae7feccd643078e0efc8f027636f(reviewed headb01486c8a3583dabc6901bf9531b2aaaf7d61fd4). Required CI and quoted-identifier regressions passed.QA handoff on main
f6dab28046d70412cec132f0068840896852101c:Pass: every quoted-identifier path creates, reads, and cleans up the intended objects only. Fail: syntax error, wrong object resolution, missing dependencies, or cleanup failure.
Ariznawlll commentedon Jul 29, 2026
已在最新
main分支完成验证。测试版本:
52ea9f874f492c368a20efef16b46ab8ced2de37测试拓扑:Proxy + 2 CN
重复次数:3 轮
测试过程:
测试结果:
结论:该问题在上述最新 main commit 上验证通过。
Ariznawlll commentedon Jul 29, 2026
在最新
main上补充依赖对象的扩展验证后,确认该问题尚未完全修复,补充更正上一条验证结论。测试版本:
0ebba1c0c96bbcf0ff4091236e10df7b97e24a0c测试拓扑:单 TN + 单 CN
基础路径验证通过:
CREATE TABLE ... CLONE和表级DATA BRANCH CREATE TABLE均成功;继续扩展到“依赖 View 自身的名称也包含 embedded backtick”时,仍可稳定复现失败:
实际结果:
失败后检查:
repro_embedded_view_src.base仍可读,数据为(1, 'source');repro_embedded_view_src.\viewv\也会返回ERROR 20101: internal error: invalid input。结论:
稳定通过的表名、普通 FK/View、隔离性和清理路径已扩展到 motr#69。失败路径没有作为 expected error 写入回归,待产品修复后再补充成功基线。
Ariznawlll commentedon Jul 30, 2026
补充本轮黑盒和白盒验证结果,测试版本为
main@0ebba1c0c96bbcf0ff4091236e10df7b97e24a0c。黑盒已通过的范围:
上述 MOTR case
25/25条 SQL/断言通过;本轮 Data Branch 全集13/13case、280/280条 SQL/断言通过。白盒验证:
但扩展边界仍未通过:
ERROR 20101: internal error: invalid input;Unhappy path / 依赖与失败边界:
ERROR 20101,因此该边界明确判定为未修复。结论:原始 embedded-backtick 表名路径已经通过黑盒与白盒验证,但 embedded-backtick View 名称/依赖路径仍未修复,因此 issue 暂不建议关闭。稳定通过部分已加入 motr#69,失败部分没有录成 expected error。
Ariznawlll commentedon Jul 30, 2026
Unhappy Path / 未修复边界专项验证
测试版本:
main@0ebba1c0c96bbcf0ff4091236e10df7b97e24a0c已通过的异常路径:
仍失败的扩展路径:
ERROR 20101: internal error: invalid input。ERROR 20101。结论:embedded-backtick 表名路径通过;embedded-backtick View 名称/依赖路径仍未修复。该失败没有录成 expected result,当前 issue 不建议关闭。详细最小复现见 comment。
6 remaining items
Ariznawlll commentedon Aug 1, 2026
测试版本
main15a2d07c687a62a0984cf62846b092912a28c0f1原问题验证
创建合法的嵌入反引号源表
`srcone`` 后,分别执行表级CREATE TABLE ... CLONE与DATA BRANCH CREATE TABLE;另建含 ``srcscope`的数据库,执行数据库级CLONE与DATA BRANCH CREATE DATABASE。四条复制路径均保留原行和原始标识符语义,连续 3 轮一致。Happy Path 覆盖
(2, backtick-source)。(3, database-scope)。Unhappy Path 覆盖
1;用于确认异常 DML 不影响复制后的表状态。白盒验证
不适用。本轮回归只使用公开 DDL/DML/查询接口验证标识符 round-trip。
回归测试
已加入 motr#74:
issue_26194_26127_quoted_identifiers.test。测试证据
./motr --repeat 3 --do-test 'issue_(26194|26144|26113|24924|26095|26280|25625)':21/21 成功;12_git4datasuite:69/69 成功。详细变更和可复跑基线见 motr#74。测试结论
测试通过。
VioletQwQ-0 commentedon Aug 12, 2026
Correction to the previous lifecycle assessment: the dependent-View failure cited there was observed on pre-fix MatrixOne
0ebba1c0c96bbcf0ff4091236e10df7b97e24a0c, before #26443 merged as38ce3a774af775dd05f988decc1927fd3eaa3b69.The tester subsequently reported PASS on
main@15a2d07c687a62a0984cf62846b092912a28c0f1, which contains the #26443 merge commit. There is no post-#26443 QA failure in this issue. The fact that the PASS report did not restate every handoff tuple does not turn the older pre-fix failure into a current failure.The exact ordinary-base-table plus embedded-backtick View fixture also passes through the authenticated cluster regression on current code. Draft PR #26995 is test-only regression hardening for that historical tuple; it is not a production fix and introduces no new QA gate.
Therefore the
test-verification-failedandphase/testingstates introduced on August 12 were incorrect. The issue is restored to completed based on the existing post-fix QA PASS. This comment supersedes the earlier statement that QA remained failed.fix: quote view identifiers in auth and restore paths (matrixorigin#2…
fix: quote view identifiers in auth and restore paths (matrixorigin#2…
fix: quote view identifiers in auth and restore paths (matrixorigin#2…