[MXS-2674] QC bugs Created: 2019-09-12  Updated: 2019-09-19  Resolved: 2019-09-16

Status: Closed
Project: MariaDB MaxScale
Component/s: qc_sqlite
Affects Version/s: 2.2.21
Fix Version/s: 2.3.12, 2.4.3

Type: Bug Priority: Major
Reporter: dapeng huang Assignee: Johan Wikman
Resolution: Fixed Votes: 0
Labels: None


 Description   
# sql current should be
1 select timediff(cast('2004-12-30 12:00:00' as time), '12:00:00') QUERY_TYPE_READ|QUERY_TYPE_WRITE QUERY_TYPE_READ
2 (select 1 as a from t1) union all (select 1 from dual) limit 1 QUERY_TYPE_UNDEFINED QUERY_TYPE_READ
3 SET @saved_cs_client= @@character_set_client; QUERY_TYPE_UNKNOWN QUERY_TYPE_SYSVAR_READ | QUERY_TYPE_USERVAR_WRITE
4 SELECT 1 AS c1 FROM t1 ORDER BY ( SELECT 1 AS c2 FROM t1 GROUP BY GREATEST(LAST_INSERT_ID(), t1.a) ORDER BY GREATEST(LAST_INSERT_ID(), t1.a) LIMIT 1); QUERY_TYPE_READ QUERY_TYPE_READ|QUERY_TYPE_MASTER_READ


 Comments   
Comment by Johan Wikman [ 2019-09-12 ]

The situation in 2.3 and 2.4 is not exactly the same.

# 2.3 2.4
1 QUERY_TYPE_READ|QUERY_TYPE_WRITE QUERY_TYPE_READ|QUERY_TYPE_WRITE
2 QUERY_TYPE_UNDEFINED QUERY_TYPE_READ
3 QUERY_TYPE_USERVAR_WRITE QUERY_TYPE_USERVAR_WRITE
4 QUERY_TYPE_READ QUERY_TYPE_READ
Comment by Johan Wikman [ 2019-09-16 ]

In 2.3 and 2.4, the result is now.

# 2.[3|4]
1 QUERY_TYPE_READ
2 QUERY_TYPE_READ
3 QUERY_TYPE_USERVAR_WRITE
4 QUERY_TYPE_READ|QUERY_TYPE_MASTER_READ

In principle #3 should be QUERY_TYPE_USERVAR_WRITE|QUERY_TYPE_SYSVAR_READ, but that has no impact as far as routing goes; either way the statement will be routed to all servers.

#2 was fixed in 2.3 by cherry-picking commit 01ab0c873698c60254555bfcd936c50433edc4a0 from 2.4.

Comment by dapeng huang [ 2019-09-19 ]

if use_sql_variables_in=master, QUERY_TYPE_USERVAR_WRITE will route to master;
so with `use_sql_variables_in=master` should route `QUERY_TYPE_USERVAR_WRITE|QUERY_TYPE_SYSVAR_READ` to all

Comment by Johan Wikman [ 2019-09-19 ]

Ok, I think you are correct. I will address that.

Comment by Johan Wikman [ 2019-09-19 ]

dapeng We will change this so that we introduce a new query classifier operator QUERY_OP_SET, which will cause RWS to send the statement to all servers.
https://jira.mariadb.org/browse/MXS-2688

Comment by Johan Wikman [ 2019-09-19 ]

Actually, we'll change it so that all SET statements will be classified as QUERY_TYPE_SESSION_WRITE.

Generated at Thu Feb 08 04:15:52 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.