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]: MD5(LONGBLOB) hashes only the first 65535 bytes #27798
Searched open and closed issues; no matching report was found.
Branch Name
main
Commit ID
e5f26b66195373f9bff512ac9f428788d1c07e8c
Other Environment Information
macOS ARM64, standalone MatrixOne
MatrixOne protocol version 8.0.30-MatrixOne-v
MySQL 8.0.42 control
Actual Behavior
For a stored 65,536-byte LONGBLOB, MatrixOne returns the MD5 of only the first
65,535 bytes.
Expected Behavior
MD5(payload) should hash all bytes and match MySQL and the client-side MD5.
Steps to Reproduce
CREATETABLEmd5_blob_repro(payload LONGBLOB);
INSERT INTO md5_blob_repro
VALUES (CONCAT(REPEAT('a',32768),REPEAT('a',32768)));
SELECT LENGTH(payload),
MD5(payload),
MD5(CONCAT(REPEAT('a',32768),REPEAT('a',32768))) AS expected
FROM md5_blob_repro;
MySQL 8.0.42 returns 2d61aa54b58c2e94403fb092c3dbc027 for both MD5
columns. The MatrixOne value is exactly the MD5 of 65,535 a bytes. Retrieved
payload bytes and client SHA-256 remain correct.
Additional information
Tracker: #27746. T18 tested 0, 1, 255, 65,535, 65,536, and 1 MiB payloads;
the mismatch begins at 65,536 bytes.
Regression and extended verification for #27798 (2026-09-08)
Verification Environment
MatrixOne baseline: latest origin/main at 80d214bef28a33f81020b76b2ed9280a6e7654b9 — fix: return NULL for POWER EXP and COT arithmetic failures (#28375).
Related fix: PR #27883, fix(function): prevent md5 truncation for text and blob, merge commit 743789eb8f0ff7cacc7b062b244e965c9033566d; it is an ancestor of the verified origin/main.
Topology: fresh local 1 LogService + 1 TN + 1 CN deployment, with no Proxy and one CN frontend at 127.0.0.1:26001.
Three test endpoints/entry points: direct mysql client at 127.0.0.1:26001; MOTR record client at 127.0.0.1:26001; MOTR replay client (run twice) at 127.0.0.1:26001. They intentionally resolve to the same physical CN because this is a single-CN topology.
Client protocol: MySQL TCP text protocol (mysql CLI and MOTR/PyMySQL). The focused function unit test additionally verified direct MD5 overload dispatch.
What Was Covered
OK: Original stored 65536-byte LONGBLOB and LONGTEXT reproduction returned 2d61aa54b58c2e94403fb092c3dbc027, not the 65535-byte digest.
OK: Boundary lengths 0, 1, 255, 65535, 65536, and 65537 for both LONGBLOB and LONGTEXT matched independently computed MD5 constants.
OK: LONGBLOB and LONGTEXT stored-value lengths and digests matched for every boundary row.
OK: Compatibility control MD5('abc') retained the expected VARCHAR behavior.
OK: Boundary/unhappy control MD5(NULL) returned NULL.
OK: A stored 1048576-byte (1MiB) LONGBLOB and LONGTEXT value matched client MD5 7202826a7791073fe2787f0c94603278.
Not covered: Multi-CN/Proxy routing; hashing is a local scalar function and the verified topology has one CN and no Proxy.
Findings
The original truncation regression is not reproducible on the current mainline. The direct TEXT and BLOBMD5 overloads avoid the former implicit conversion to VARCHAR, so stored long objects are hashed in full.
Focused current-main function tests passed: TestMd5 and TestMd5LargeStringUsesFullValue, including both text and blob subtests (1.611s).
The case was recorded once and replayed twice successfully: 9 statements per replay, 9 passed, 0 failed. The regression commit is ec97371881f61669beddc377237dc003d4269ee3 (test: add MOTR regression for #27798) on test/issue-27798-md5-large-objects, pushed to matrixorigin/motr via SSH.
Large-data regression: required and executed. The failure is determined by byte length, with the transition at 65536, so the test includes 65535, 65536, 65537, and a 1MiB value as the minimum stable size coverage beyond the truncation boundary. It uses one row per size and adds no unrelated row-count, concurrency, spill, or network load.
Final Conclusion
Fixed. The mainline fix hashes complete stored LONGBLOB and LONGTEXT values across the reported boundary and the 1MiB scale check. Multi-CN/Proxy routing remains explicitly not covered because it is outside this scalar-function contract.
Activity
fix(function): prevent md5 truncation for text and blob (#27883)
slyunnn commentedon Sep 8, 2026
Regression and extended verification for #27798 (2026-09-08)
Verification Environment
origin/mainat80d214bef28a33f81020b76b2ed9280a6e7654b9—fix: return NULL for POWER EXP and COT arithmetic failures (#28375).fix(function): prevent md5 truncation for text and blob, merge commit743789eb8f0ff7cacc7b062b244e965c9033566d; it is an ancestor of the verifiedorigin/main.1 LogService + 1 TN + 1 CNdeployment, with no Proxy and one CN frontend at127.0.0.1:26001.mysqlclient at127.0.0.1:26001; MOTR record client at127.0.0.1:26001; MOTR replay client (run twice) at127.0.0.1:26001. They intentionally resolve to the same physical CN because this is a single-CN topology.mysqlCLI and MOTR/PyMySQL). The focused function unit test additionally verified directMD5overload dispatch.What Was Covered
65536-byteLONGBLOBandLONGTEXTreproduction returned2d61aa54b58c2e94403fb092c3dbc027, not the65535-byte digest.0,1,255,65535,65536, and65537for bothLONGBLOBandLONGTEXTmatched independently computed MD5 constants.LONGBLOBandLONGTEXTstored-value lengths and digests matched for every boundary row.MD5('abc')retained the expectedVARCHARbehavior.MD5(NULL)returnedNULL.1048576-byte (1MiB)LONGBLOBandLONGTEXTvalue matched client MD57202826a7791073fe2787f0c94603278.Findings
The original truncation regression is not reproducible on the current mainline. The direct
TEXTandBLOBMD5overloads avoid the former implicit conversion toVARCHAR, so stored long objects are hashed in full.Focused current-main function tests passed:
TestMd5andTestMd5LargeStringUsesFullValue, including bothtextandblobsubtests (1.611s).MOTR / BVT Coverage
Added and recorded:
suites/14_issue_regression/t/issue_27798_md5_large_objects.testsuites/14_issue_regression/r/issue_27798_md5_large_objects.resultThe case was recorded once and replayed twice successfully:
9statements per replay,9passed,0failed. The regression commit isec97371881f61669beddc377237dc003d4269ee3(test: add MOTR regression for #27798) ontest/issue-27798-md5-large-objects, pushed tomatrixorigin/motrvia SSH.Large-data regression: required and executed. The failure is determined by byte length, with the transition at
65536, so the test includes65535,65536,65537, and a1MiBvalue as the minimum stable size coverage beyond the truncation boundary. It uses one row per size and adds no unrelated row-count, concurrency, spill, or network load.Final Conclusion
Fixed. The mainline fix hashes complete stored
LONGBLOBandLONGTEXTvalues across the reported boundary and the1MiBscale check. Multi-CN/Proxy routing remains explicitly not covered because it is outside this scalar-function contract.fix(function): prevent md5 truncation for text and blob (matrixorigin…
fix(function): prevent md5 truncation for text and blob (matrixorigin…
fix(function): prevent md5 truncation for text and blob (matrixorigin…