Repository navigation
Description
Is there an existing issue for the same bug?
- I have checked the existing issues.
Branch Name
main / current MatrixOne build used by Matrixflow deployment
Commit ID
Unknown from the deployment logs.
Other Environment Information
Observed from a Matrixflow moi-catalog service writing to MatrixOne through Go database/sql.
The failing request log timestamp was 2026-05-31T08:14:47.066Z.
Actual Behavior
A multi-row parameterized INSERT failed with:
Error 20301 (HY000): invalid input: column ad027c8b does not exist
The application SQL shape was:
INSERT INTO volume_files (volume_id, file_id, file_name, file_path, created_by, updated_by)
VALUES (?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?)The bound file_id values are UUID strings, for example one started with ad027c8b-....
MatrixOne appears to parse the first UUID segment (ad027c8b) as an identifier instead of treating the bound parameter as a string value. The application received a 500 because the insert failed.
Relevant application log evidence:
{"level":"error","timestamp":"2026-05-31T08:14:47.066Z","caller":"handlers/volume_file.go:804","message":"failed to add files to volume","request_id":"7922527f-4ddd-48b7-85ec-84c3915ca3f8","trace_id":"7922527f-4ddd-48b7-85ec-84c3915ca3f8","error":"failed to batch create volume file associations: Error 20301 (HY000): invalid input: column ad027c8b does not exist"}Expected Behavior
MatrixOne should execute the prepared statement using the supplied string parameters as string values. A UUID string parameter such as ad027c8b-... should not be parsed as a column identifier in a multi-row INSERT ... VALUES statement.
Steps to Reproduce
The failure was observed from Go database/sql with a multi-row parameterized insert. A reduced reproduction should be similar to:
CREATE TABLE volume_files (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
volume_id BIGINT NOT NULL,
file_id VARCHAR(36) NOT NULL,
file_name VARCHAR(255) NOT NULL,
file_path VARCHAR(1024) NOT NULL DEFAULT '',
created_by VARCHAR(64) NOT NULL,
updated_by VARCHAR(64) NOT NULL,
UNIQUE KEY uk_volume_file (volume_id, file_id)
);Then execute through the Go MatrixOne/MySQL driver path using placeholders:
_, err := db.ExecContext(ctx, `
INSERT INTO volume_files (volume_id, file_id, file_name, file_path, created_by, updated_by)
VALUES (?, ?, ?, ?, ?, ?), (?, ?, ?, ?, ?, ?)
`,
int64(180001), "ad027c8b-1111-4111-8111-111111111111", "a.txt", "", "user1", "user1",
int64(180001), "b4027c8b-2222-4222-8222-222222222222", "b.txt", "", "user1", "user1",
)Observed production error:
Error 20301 (HY000): invalid input: column ad027c8b does not exist
As a workaround, changing the application to execute the same single-row parameterized INSERT once per row inside the same transaction avoids the error.
Additional information
The Matrixflow-side workaround is intentionally narrow: it keeps the same transaction and API behavior, but avoids multi-row prepared insert for this table. The underlying issue still looks like MatrixOne incorrectly handling multi-row prepared statement parameter substitution or parsing for UUID-like string values.
Activity
zhangxu19830126 commentedon May 31, 2026
Additional local verification from the Matrixflow side:
Environment:
I tried to reproduce the original multi-row parameterized INSERT locally with these DSN variants:
For each DSN, I tested:
db.ExecContextwith the multi-row placeholder INSERTtx.ExecContextinside an explicit transactiondb.PrepareContextfollowed bystmt.ExecContextAll of them returned
<nil>locally. The Matrixflow workaround path, single-row parameterized INSERTs inside the same transaction, also returned<nil>.I also ran a control SQL where the UUID-like value is intentionally unquoted:
That produced a similar MatrixOne 20301 error locally:
So with the current local build I cannot prove that multi-row prepared INSERT itself is sufficient to trigger the production error. The production log is still real evidence that MatrixOne received/evaluated something leading to
column ad027c8b does not exist, but we likely need the exact MatrixOne build and perhaps SQL trace from that deployment to isolate whether this is a server version difference, driver/interpolation difference, or a malformed final SQL path.Matrixflow PR with the narrow workaround and verification notes: https://github.com/matrixorigin/matrixflow/pull/10815
zhangxu19830126 commentedon May 31, 2026
Additional verification using the fin-data-agent dev MatrixOne configuration:
Environment:
I created a temporary table with the same relevant shape and tested the old multi-row parameterized INSERT with UUID string parameters using these DSNs:
For each DSN, I tested:
db.ExecContexttx.ExecContextinside a transactiondb.PrepareContext+stmt.ExecContextAll returned
<nil>on this dev MatrixOne. The workaround path, two single-row parameterized INSERTs inside one transaction, also returned<nil>.Control test on the same dev MatrixOne, with an intentionally unquoted UUID-like value:
This produced:
The temporary databases used for this verification were dropped afterwards.
Conclusion update: the issue still matches the class of errors where
ad027c8bis parsed as an identifier, but I still cannot reproduce the production failure using normal Go parameter binding on either local MO (git_version()=46039477b5) or fin-data-agent dev MO (git_version()=5e4210029). We need the production MatrixOne build and/or SQL trace to prove where the parameter value becomes an unquoted expression.ck89119 commentedon Aug 23, 2026
Verified against the latest
mo/mainat commitcdf7888344df65136f6d0c9c35ead4940d69a793using an embedded MatrixOne cluster andgithub.com/go-sql-driver/mysqlv1.8.1.The test used the table shape and two-row UUID-string insert from this issue and covered:
interpolateParams=false(server-side binaryCOM_STMT_PREPARE/COM_STMT_EXECUTE)interpolateParams=true(client-side interpolation)db.ExecContexttx.ExecContextin an explicit transactiondb.PrepareContextfollowed bystmt.ExecContextAll variants succeeded, and a follow-up query confirmed that both UUID strings were stored correctly. Test result:
Conclusion: I could not reproduce this issue on the latest
main. The original production failure likely depends on the exact deployed MatrixOne version or on a client/application path that produced an unquoted final value before it reached normal parameter binding.Ariznawlll commentedon Aug 23, 2026
测试版本
main @ 11a1301a5go-sql-driver/mysql的二进制协议与插值协议分别验证。验证内容
INSERT,分别覆盖db.Exec、事务内Exec和显式Prepare。interpolateParams=false(服务端预处理)和interpolateParams=true(客户端插值)执行,写入后的两个 UUID 与输入值逐一一致。回归用例
结论:在最新 main 上未复现原问题,正常与异常路径均符合预期。
test: add MongoDB and UUID issue regressions (#27516)
test: add MongoDB and UUID issue regressions (matrixorigin#27516)
test: add MongoDB and UUID issue regressions (matrixorigin#27516)
test: add MongoDB and UUID issue regressions (matrixorigin#27516)