You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: FULLTEXT indexed INSERT publishes a hidden index ID through LAST_INSERT_ID (v4.2.5) #29903
I searched exact error strings, failing syntax and affected native applications; no matching issue was identified. Related reports are distinguished below.
Application compatibility replay on official v4.2.5
Branch Name
Official stable release v4.2.5; current main has not been retested for this report.
Linux x86_64 standalone official binary, 4 CPUs, ~16 GiB container memory limit. SELECT VERSION() = 8.0.30-MatrixOne-v4.2.5. PyMySQL 1.2.3 client. Only fresh owned test schemas were used for SQL probes; the native Airflow diagnostic is a read-only SELECT against the retained test fixture.
SELECT id,LAST_INSERT_ID() FROM id_probe
[[1, 2]]
Fresh table: stored base id=1, SELECT LAST_INSERT_ID()=2. The second fresh run reproduced the same values. Native Leantime originally linked task IDs 10/11 to 348/355. The hidden ID symptom is not merely an auto-increment gap.
Expected Behavior
The protocol INSERT ID and LAST_INSERT_ID() must refer to the base table business primary key, not a hidden fulltext posting/index primary key.
Steps to Reproduce
Use a dedicated fresh test schema (create one without DROP DATABASE), then run:
CREATETABLEid_probe(id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,label VARCHAR(40));
ALTERTABLE id_probe ADD FULLTEXT label_ft(label);
INSERT INTO id_probe(label) VALUES('small');
SELECT id,LAST_INSERT_ID() FROM id_probe;
Additional information
Native applications: Leantime.
This is release v4.2.5 evidence, not a claim that the same failure remains on current main.
Observation family MO-OBS-012. App-side workarounds do not constitute an engine fix.
All disclosed values are owned synthetic fixtures; no passwords, tokens, application cookies or raw private logs are attached.
Built and actually ran upstream main 02a2823c2007d5e4fb4ada148e93743df337551a, with git_version() = 02a2823, Go 1.27.1, Linux amd64, the official make build CPU entrypoint, gcc/g++, and separate fresh main cluster storage. Binary SHA-256: ce8b149f0da8c8a06ec8786c4d311795e6893420bd15be29d6e6b9cab44bb2f5. SQL checks ran 2026-10-12 06:04 UTC; upstream main was re-read before execution and still resolved to this SHA.
Comparison: official v4.2.5 / 1a44f3db3056e32975fde86ca0ab69a094996a3f (git_version() = 1a44f3d). Both sides used fresh owned schemas and identical regression fixture hashes. This checks the disclosed reproducer; complete native application workflows have not been rerun on main. No issue is being closed automatically.
SQL-FULLTEXT-INSERT-ID: stable known_failure → main candidate_fixed
The reproducer completed and its result/constraint assertions passed on this main snapshot; the stable failure no longer reproduces for this fixture.
Fixture SHA-256: 65e116fc95a7e98bd5444940a3cec82a671bcf1e3219ad87179b5cac0ee7c5af. A fresh SELECT 1 after the trigger succeeded: True.
Activity
dengn commentedon Oct 12, 2026
Runtime recheck on current main
Built and actually ran upstream main
02a2823c2007d5e4fb4ada148e93743df337551a, withgit_version()=02a2823, Go 1.27.1, Linux amd64, the officialmake buildCPU entrypoint, gcc/g++, and separate fresh main cluster storage. Binary SHA-256:ce8b149f0da8c8a06ec8786c4d311795e6893420bd15be29d6e6b9cab44bb2f5. SQL checks ran 2026-10-12 06:04 UTC; upstream main was re-read before execution and still resolved to this SHA.Comparison: official v4.2.5 /
1a44f3db3056e32975fde86ca0ab69a094996a3f(git_version()=1a44f3d). Both sides used fresh owned schemas and identical regression fixture hashes. This checks the disclosed reproducer; complete native application workflows have not been rerun on main. No issue is being closed automatically.SQL-FULLTEXT-INSERT-ID: stable
known_failure→ maincandidate_fixedThe reproducer completed and its result/constraint assertions passed on this main snapshot; the stable failure no longer reproduces for this fixture.
Fixture SHA-256:
65e116fc95a7e98bd5444940a3cec82a671bcf1e3219ad87179b5cac0ee7c5af. A freshSELECT 1after the trigger succeeded:True.Returned rows:
[[1, 1]].Detailed SQL, assertions, source/build identity and JSON evidence (organization regression repository): https://github.com/matrixorigin/matrixone-app-regression/tree/01517d2f73abb5021ca545193c2af38ef653f278/evidence/main-02a2823
[4.2-dev] fix(incrservice): keep hidden fake primary key out of LAST_…
fix(incrservice): keep hidden fake primary key out of LAST_INSERT_ID (m…
fix(insert): exclude fake primary key from LAST_INSERT_ID (#29903) (#…
[4.2-dev] fix(insert): statement insert id and reset ownership for LA…
[4.2-dev] fix(compile): retry restores the statement's LAST_INSERT_ID…
fix(compile): retry restores the statement's LAST_INSERT_ID baseline (m…
[4.2-dev] fix(insert): publish LAST_INSERT_ID coherently across paral…
[4.2-dev] test(sql): retried multi-statement keeps earlier LAST_INSER…
test(sql): retried multi-statement keeps earlier LAST_INSERT_ID throu…
[4.2-dev] test(sql): release the holder txn and writer when the matri…
test(sql): release the holder txn and writer when the matrixorigin#29903
fix(compile): retry restores the statement's LAST_INSERT_ID baseline (#…
fix(insert): exclude fake primary key from LAST_INSERT_ID (#29903) [4…
XuPeng-SH commentedon Oct 16, 2026
新合并回补后的复验结果:原始 FULLTEXT INSERT / LAST_INSERT_ID 场景已通过,继续保留转测 @Ariznawlll。
此前失败结果针对旧 4.2-dev 提交
947517cc457ae75aff0e3667ff91bace1656c705:实际用户行 id=1,但 LAST_INSERT_ID() 与 OK packet insert_id 均为 2。本次发现 #30005 已于 2026-10-16 22:33(北京时间)合并,因此没有直接依据旧结果退回开发,而是检出并重新构建、运行其 4.2-dev 合并提交
e2c99334fd23b9260728695e29befd35ab26b454(Linux/amd64、Go 1.26.4,使用本提交对应的 native 构建)。在相同原始 SQL 场景下实测:
结果:用户行 id=1、LAST_INSERT_ID()=1、OK packet insert_id=1,三个断言均通过。
另外实际运行并通过:
TestIssue29903InsertIDOkPacketTestIssue29903RetryKeepsEarlierStatementLastInsertID结论仅针对上述新合并的 4.2-dev 提交,不表示历史已发布的 v4.2.5 二进制已经改变。保持 OPEN,由测试在目标交付版本验收;本次不退回开发。
Ariznawlll commentedon Oct 19, 2026
测试版本
main完整 commit:def799e1260dd547cae2e0e54323ea20ec1b7685;修复 PR fix(insert): exclude fake primary key from LAST_INSERT_ID (#29903) #30004 MERGED,merge commitfd4767e488dc111db02c9119cd46dfe78af1ee23确认已进入该 main。4.2-dev完整 commit:35273bcd6a5cfa9468bcf7ca4031fe17560b5ab1;回补 PR fix(insert): exclude fake primary key from LAST_INSERT_ID (#29903) [4.2-dev] #30005 MERGED,merge commite2c99334fd23b9260728695e29befd35ab26b454确认已进入该发布线。4.2-dev是本次验证的发布线源码;历史已发布的 v4.2.5 二进制并未被改变,也未把本地构建的版本字符串当作已发布版本号。原问题验证
在全新测试库依次执行原始场景:创建
BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY表、添加FULLTEXT label_ft(label)、插入'small',读取表中id与LAST_INSERT_ID(),并独立检查协议 OK packet 的insert_id。main 与 4.2-dev 各 3/3 轮,首行实际均为id=1, LAST_INSERT_ID()=1, insert_id=1;未再发布 FULLTEXT 隐藏索引 ID。Happy Path 覆盖
'second'后,两个分支各 3/3 轮实际 OK packetinsert_id=2,表中两行 ID 为 1、2,同一会话LAST_INSERT_ID()=2。label=NULL边界:两个分支各 3/3 轮实际 OK packetinsert_id=3,新行(id,label,LAST_INSERT_ID())=(3,NULL,3);FULLTEXT 索引存在时仍保持用户表 ID 语义。qa_issue29903_%残留库数为 0。Unhappy Path 覆盖
COUNT(*)=3, MAX(id)=3,已提交的原有行与 NULL 行均保留,同连接后续 SELECT 正常。白盒验证
4.2-dev的TestIssue29903InsertIDOkPacket、TestIssue29903RetryKeepsEarlierStatementLastInsertID分别-count=3PASS;涵盖 OK packet、会话 ID 与重试保留语义。TestIssue29903RetryKeepsEarlierStatementLastInsertID -count=3PASS。未将这些仓库内测试替代外部协议与 MOTR 结果。回归测试
ffd381cafe4473086b3e9e0ccb36c938cb9e1016仍 Open;离线检查在本次写评论时尚在运行。完整 MOTR suite/集成 CI 未在本轮执行,合入与检查结果后续跟踪。测试证据
packet_ids=1,2,3,三行 ID/NULL 精确一致,duplicate=1062且state=((3,3),);定向 Go 测试上述各 3/3 PASS。测试结论
测试通过。