[MXS-2990] QC bug Created: 2020-05-12  Updated: 2020-05-13  Resolved: 2020-05-13

Status: Closed
Project: MariaDB MaxScale
Component/s: qc_sqlite
Affects Version/s: 2.3.19
Fix Version/s: 2.3.20, 2.4.10

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


 Description   

 SELECT COUNT(IF(!c.ispackage, 1, NULL)) as cnt FROM test FOR UPDATE;

This query should be QUERY_TYPE_WRITE, but it is QUERY_TYPE_READ now,

If change it to

SELECT COUNT(IF(not c.ispackage, 1, NULL)) as cnt FROM test FOR UPDATE

, it will be ok



 Comments   
Comment by Johan Wikman [ 2020-05-13 ]

The reason is that the former statement is only tokenized, which means that the SELECT keyword alone decides the type, while the latter is fully parsed. And the reason for that is that ! is not correctly parsed as not.

In general that does not matter, but here it does as the FOR UPDATE changes the type.

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