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]: JDBC Connection.setReadOnly is rejected although MySQL supports read-only connections #29185
The default Connector/J implementation of Connection.setReadOnly(true) sends SET SESSION TRANSACTION READ ONLY. MatrixOne rejects that statement, so Java frameworks and pools cannot initialize a JDBC connection as read-only:
errorCode=20105
sqlState=HY000
not supported: transaction access mode READ ONLY is not supported
This occurs before the application can execute a query. Direct CN1, direct CN2, and Proxy produced the same result in three independent rounds each.
MySQL 8.0 accepts the same JDBC call. The connection can execute reads, rejects writes while read-only, and accepts writes again after setReadOnly(false).
This also reverses the behavior recorded as fixed in #10059. That issue was closed as completed after both SET SESSION TRANSACTION READ ONLY and READ WRITE returned success.
The Connector/J URL uses its default readOnlyPropagatesToServer=true behavior.
Reproduction matrix
Endpoint
Attempts
Result
CN1 (16001)
3
setReadOnly(true) rejected with 20105/HY000
CN2 (16002)
3
same
Proxy (6001)
3
same
MySQL 8.0 control
3
read-only switch, read enforcement, and switch back all work
Expected behavior
Connection.setReadOnly(true/false) should follow the MySQL JDBC contract. At minimum, a framework should be able to configure and use a read-only connection without the initialization call being rejected. If server-side read-only enforcement is implemented, writes must be rejected while the mode is active.
Evidence
The standalone probe is evidence/issue_26623/JdbcReadOnlyProbe.java in the local #26623 qualification evidence.
Activity
fix(frontend): support JDBC session read-only mode (#29193)
Ariznawlll commentedon Sep 27, 2026
测试版本
main5be6cd90b501da225be591ffffe6000bf01f515e原问题验证
在上述最新 main 上按 issue 原始复现步骤执行,并独立重复 3 次;3/3 均满足修复后的预期。当前 main 已包含修复提交
71c415705c909e524abd21dd0cf3e31b1c18e941。Happy Path 覆盖
SET SESSION TRANSACTION READ ONLY/READ WRITE均成功,两个兼容变量同步为 1/0,读连接可继续使用。Unhappy Path 覆盖
白盒验证
确认修复提交
71c415705c909e524abd21dd0cf3e31b1c18e941是当前 main 的祖先,并核对对应 MatrixOne BVT/实现路径;本次另以公开 SQL 协议执行黑盒验收。回归测试
已加入 MOTR PR #204 的
issue_28295_28594_29085_29185_compatibility.test,MOTR 提交2b4462f2;本地基线比对连续 3 次通过。测试证据
5be6cd90b501da225be591ffffe6000bf01f515e测试结论
测试通过。