[MXS-333] use_sql_variables_in=master doesn't work Created: 2015-08-25  Updated: 2015-08-25  Resolved: 2015-08-25

Status: Closed
Project: MariaDB MaxScale
Component/s: readwritesplit
Affects Version/s: 1.2.0
Fix Version/s: 1.3.0

Type: Bug Priority: Major
Reporter: markus makela Assignee: markus makela
Resolution: Fixed Votes: 0
Labels: None


 Description   

Setting the use_sql_variables_in=master parameter in the readwritesplit should make it so that all read queries which access a variable should be routed to the master. The queries are not routed to the master but are routed to a slave.

Steps to reproduce:
add use_sql_variables_in=master to a service which uses readwritesplit and execute the following queries.

set @myvar = @@hostname;
select @myvar; -- This should not return NULL

The following does work which shows that the select part of the query is the cause.

set @myvar = @@hostname;
begin;
select @myvar; -- @@hostname is returned



 Comments   
Comment by markus makela [ 2015-08-25 ]

The select query is classified as a QUERY_TYPE_READ and QUERY_TYPE_USERVAR_READ. This was something which was not expected and the router's logic assumed all QUERY_TYPE_READ queries would be routed to a slave.

Generated at Thu Feb 08 03:58:30 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.