Repository navigation
Description
1. Is there an existing issue for this?
- I have searched the existing issues
2. Bug description and error info with logs
Summary
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED (and REPEATABLE READ) succeeds without error but does not change @@transaction_isolation.
Changing isolation via system variables does work:
SET transaction_isolation = 'READ-COMMITTED'SET tx_isolation = 1
This breaks Java/JDBC/Spring apps that call Connection.setTransactionIsolation(TRANSACTION_READ_COMMITTED) or use @Transactional(isolation = READ_COMMITTED), because Connector/J typically issues the standard SET SESSION TRANSACTION ISOLATION LEVEL ... form. The app believes RC is active while the session remains REPEATABLE-READ (silent mismatch).
No SQLException is raised — this is a silent no-op, which is harder to detect than an explicit "unsupported" error.
Minimal repro
SET transaction_isolation = 'REPEATABLE-READ';
SELECT @@transaction_isolation AS baseline;
-- REPEATABLE-READ
-- Standard SQL / JDBC path: NO EFFECT
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
SELECT @@transaction_isolation AS after_std_set_rc;
-- still REPEATABLE-READ (expected: READ-COMMITTED)
-- Variable path: WORKS
SET transaction_isolation = 'READ-COMMITTED';
SELECT @@transaction_isolation AS after_var_set_rc;
-- READ-COMMITTED
-- Standard form still NO EFFECT the other way
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
SELECT @@transaction_isolation AS after_std_set_rr;
-- still READ-COMMITTED (expected: REPEATABLE-READ)Observed on local MO:
version(): 8.0.30-MatrixOne-v
Impact
- MySQL-compatible clients/ORMs that set isolation via
SET TRANSACTION ISOLATION LEVELget wrong semantics with no error. - Confirmed from Java MyBatis PetClinic / JDBC scenario suites: Spring asks for RC,
@@transaction_isolationon the transactional connection staysREPEATABLE-READ.
BVT gap
Existing BVT does not catch this:
-
test/distributed/cases/set/set_transaction.sql— comment says:-- just pass syntax check. no actual semantic action.It runs
set transaction isolation level read committedetc., but never asserts@@transaction_isolationafterward. -
system_variables_new.sqlcoversset tx_isolation = 1and expectsREAD-COMMITTED— that path works; it does not cover the standardSET SESSION TRANSACTION ISOLATION LEVELsemantic.
Suggested BVT assertion (should fail on current behavior):
SET transaction_isolation = 'REPEATABLE-READ';
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
-- @result: READ-COMMITTED
SELECT @@transaction_isolation;3. Expected and actual behavior
| Statement | Expected @@transaction_isolation |
Actual |
|---|---|---|
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED |
READ-COMMITTED |
stays previous value (e.g. REPEATABLE-READ) |
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ |
REPEATABLE-READ |
stays previous value |
SET transaction_isolation = 'READ-COMMITTED' |
READ-COMMITTED |
READ-COMMITTED (OK) |
SET tx_isolation = 1 |
READ-COMMITTED |
READ-COMMITTED (OK) |
Expected: standard SET [SESSION] TRANSACTION ISOLATION LEVEL ... should update session isolation the same way as SET transaction_isolation / SET tx_isolation, matching MySQL.
4. Environment
- MatrixOne:
8.0.30-MatrixOne-v(localmo-service) - Client: mysql CLI + Java Connector/J (Spring
@Transactional(READ_COMMITTED)) - How found: Java + MyBatis PetClinic / JDBC compatibility E2E against MO
5. Additional context
Docs state MO supports Read Committed and Snapshot Isolation (RR). RC itself is reachable via SET transaction_isolation / tx_isolation; the bug is specifically that the standard SET TRANSACTION ISOLATION LEVEL syntax is accepted but ignored.
Activity
iamlinjunhong commentedon Aug 4, 2026
ODBC compatibility impact reproduced on 8.0.30-MatrixOne-v25908 while building the MatrixOne ODBC suite in #26677.
MySQL Connector/ODBC implements SQL_ATTR_TXN_ISOLATION by sending SET SESSION TRANSACTION ISOLATION LEVEL. The ODBC setter returns success for READ UNCOMMITTED, READ COMMITTED, REPEATABLE READ, and SERIALIZABLE, but SELECT @@transaction_isolation remains REPEATABLE-READ for every value.
Minimal direct reproduction:
Observed:
I am adding this as a linked XFAIL in the public ODBC compatibility suite so it remains visible without duplicating this issue. The critical client contract is that the statement must not return success while leaving the session unchanged.
slyunnn commentedon Aug 20, 2026
Regression and extended verification for #26648 (2026-08-20)
Verification Environment
origin/main:2a38e2a4b50b92fefbef7f74ec9c9fe3f0d5cf3b—fix: recreate missing character sets table during upgrade (#27369).310fa3f50dc8a96bd7749862139018678d9a2173—fix(frontend): handle SET TRANSACTION isolation level (#26665).127.0.0.1:16001, CN2127.0.0.1:16002, Proxy127.0.0.1:6009.What Was Covered
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTEDupdates@@transaction_isolationfromREPEATABLE-READtoREAD-COMMITTED.SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READupdates the session back toREPEATABLE-READ.SET transaction_isolation = 'READ-COMMITTED'and standardSET SESSION TRANSACTION ISOLATION LEVELproduce equivalent visible session state.READ UNCOMMITTEDreturnsERROR 20105and preservesREPEATABLE-READ.SERIALIZABLEreturnsERROR 20105and preservesREPEATABLE-READ.ERROR 1568and preserves the current session isolation.Findings
The former silent no-op is fixed. Supported standard session isolation statements now update observable session state. Unsupported isolation levels fail explicitly instead of returning success while leaving the session unchanged.
Large-data regression is not required: this is session-state parsing and transaction metadata behavior, independent of row count, block/batch boundaries, memory/spill, concurrency, skew, network transfer, or resource scale.
MOTR / BVT Coverage
suites/14_issue_regression/t/issue_26648_session_transaction_isolation.test.suites/14_issue_regression/r/issue_26648_session_transaction_isolation.result.19/19.19/19.19/19.test/issue-26648-session-isolation.1f9a47e—test: add MOTR regression for #26648.Final Conclusion
Fixed. Standard
SET SESSION TRANSACTION ISOLATION LEVELnow changes supported session isolation levels, while unsupported values and invalid in-transaction changes return explicit errors without mutating session state. Large-data regression is not needed because data volume does not affect this session-state contract.daviszhen commentedon Oct 17, 2026
v4.2.5 release-specific reproduction (arm64), plus two related transaction-semantics observations
Replay on the official
matrixorigin/matrixone:latestimage — arm64/linux,VERSION()=8.0.30-MatrixOne-v4.2.5, single node; MySQL 8.0.46 as baseline. Same session sets and reads the variable back (a cross-connection read-back would be meaningless for a session variable).1.
SET SESSION TRANSACTION ISOLATION LEVELis still a no-op, exactly as reported here.All four levels report success and none of them changes the value.
2. The observable behaviour is READ COMMITTED while the variable reports REPEATABLE-READ.
Same session,
REPEATABLE READselected (reported valueREPEATABLE-READ), a second session updates and commits rowid=1mid-transaction:So the reported isolation level and the actual one disagree — which is worse than the no-op itself, because an application that reads
@@transaction_isolation, seesREPEATABLE-READ, and relies on repeatable reads will silently get READ COMMITTED semantics. (I see #30377 tracks a related "stale global transaction_isolation from catalog silently overrides mode-resolve" path, so this may be the same root area.)3. A deadlock on v4.2.5 surfaces as
20701, not MySQL's1213.Two sessions taking the same two row locks in opposite order (session A locks
id=1thenid=2; session B locksid=2thenid=1):One session was aborted (so the conflict is detected), but the code is
20701rather than1213/1205. Applications that classify "deadlock → retry the transaction" versus "lock wait timeout → retry the statement" by error code will mis-handle this. If20701is the intended MatrixOne code for this case, it would help to document the mapping (MySQL1213→ MatrixOne20701) together with the retry guidance — note this release also returns1205for a plain lock-wait timeout, so the two are distinguishable, just not by the MySQL code.