Repository navigation
Description
Description
The ordinary (no explicit ALGORITHM) ALTER TABLE ... ADD INDEX path fails with an internal SQL syntax error for a valid table name containing an embedded backtick. Plain, space-containing, and reserved-word table-name controls succeed. The same operation succeeds with explicit ALGORITHM=COPY, which isolates the failure to the default alter path. This report records behavior on current main; it does not claim that PR #30646 introduced it.
Environment
- MatrixOne source SHA:
aeaa273daf588a9988ba423915d3ae6b8c82124a - Isolated single-process local service, MySQL port 61320
- Service binary SHA-256:
450363d5ec5e693bdd7ded44565b3b0ab1addcb807d3f9569c5d5eedeb1486e4
Reproduction
CREATE DATABASE qa_round2_30646_inplace;
USE qa_round2_30646_inplace;
CREATE TABLE plain(id INT PRIMARY KEY, v INT);
INSERT INTO plain VALUES(1,10);
ALTER TABLE plain ADD INDEX idx_v(v); -- succeeds
CREATE TABLE `has space`(id INT PRIMARY KEY, v INT);
INSERT INTO `has space` VALUES(2,20);
ALTER TABLE `has space` ADD INDEX idx_v(v); -- succeeds
CREATE TABLE `select`(id INT PRIMARY KEY, v INT);
INSERT INTO `select` VALUES(3,30);
ALTER TABLE `select` ADD INDEX idx_v(v); -- succeeds
CREATE TABLE `tick``table`(id INT PRIMARY KEY, v INT);
INSERT INTO `tick``table` VALUES(4,40);
ALTER TABLE `tick``table` ADD INDEX idx_v(v);
-- Error 1105 (HY000), internal syntax error near "table`;"The exact failure reproduced in two fresh executions. After each failure the original row and two-column schema remained, and SHOW INDEX showed only the primary key. On the same retained table, ALTER TABLE tick``table ALGORITHM=COPY, ADD INDEX idx_copy(v) succeeded and `FORCE INDEX(idx_copy)` returned `(4,40)`; the disposable database was then dropped.
Expected behavior
The unhinted ADD INDEX should accept the same valid quoted table identifier as the explicit COPY path and normal-name control, preserve the row, and expose the new index.
Duplicate search
Searches for backtick/embedded backtick with ADD INDEX and ALTER found #30550 (COPY-based ADD COLUMN internal DROP failure), which is a different operation/path and now passes its original reproduction. Also checked nearby quoted-identifier issues #30545 and #30549, whose SHOW metadata code paths differ. No duplicate for the default ADD INDEX failure was found.
Evidence
- Fixture:
round2-30646-alter-inplace-quoted-name-repro.sql - Failure log:
round2-aeaa273-30646-alter-inplace-quoted-name-repro-attempt1.logand...attempt2.log(identical SHA-256c465b4f3179e2f89c355a1a8c1e0c8d07829ae753a0917f393ce19d9bad2fefb) - Post-error recovery/control log:
round2-aeaa273-30646-alter-inplace-quoted-name-recovery-attempt2.log
No customer data or credentials are involved. This is a local single-CN reproduction; multi-CN and restart behavior are not tested.
Activity
fix(sql): handle invalid DECIMAL casts and quoted ADD INDEX backfills (…
Ariznawlll commentedon Nov 30, 2026
QA 验收通过(最新 main)
版本与方法
c255da6778fac39bc53b5b9defaab3b6f945e4d6;关闭前再次解析仍为该 SHA。SELECT git_version()核对完整 SHA。逐轮覆盖
select均执行默认ALTER TABLE ... ADD INDEX,作为健康对照。tick`table表名通过转义标识符执行默认 ADD INDEX,随后以FORCE INDEX(idx_v)精确读回(4,40)。ALGORITHM=COPY, ADD INDEX idx_copy(v);两个 CN 的information_schema.statistics均精确包含PRIMARY、idx_v、idx_copy。idx_v按预期拒绝;拒绝后索引元数据不变,两个成功索引均可读回正确行,覆盖失败原子性。三轮日志 SHA256:
f0e7701b5affb7bfe8bdceb4f2908246a8c0782980147100f493ecf2fa463810eb4965b8373269e7a7b13a60aec43a65a8dd9afe30a6924a8e476cc436bfaef31e2efdd2cdb727ca62e2012c2c1f3596b4b73db54feff2e719b153a46a2ce97cMOTR 回归
已推送到 matrixorigin/motr PR 374,head
d7715c5907ac73f967096343b1e394ec8486504f,用例为issue_31080_alter_backtick.py。评论时新 head 的 CI 均为 pending(queued),daily-42为 SKIPPED;本单关闭依据是上述当前 SHA 的真实服务结果,不把 pending 当作通过。