Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
6.1.4
-
None
Description
The following example SQL demonstrates the problem when executed through readwritesplit.
SET autocommit=0; |
COMMIT; |
SET autocommit=1; |
SELECT @@server_id, @@hostname; |
The last statement should be routed as an autocommit read but it is treated as if autocommit was still disabled.
This is caused by a bug in an optimization for the transaction tracking code that reuses the query classification result instead of parsing the query multiple times. Due to the query classification cache, the canonical form of both autocommit statements would be SET autocommit=? and they would both be classified as the query type that first arrived. The solution is to never insert these types of queries into the cache.