From 0aae500577576bd0bb075c6748dff670f2771d30 Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Tue, 3 Mar 2020 14:35:23 +0200 Subject: [PATCH] MXS-2898 Classify @@last_insert_id() and last_insert_id() identically With this change, both 'SET @my_id = (SELECT LAST_INSERT_ID())' and 'SET @my_id = (SELECT @@LAST_INSERT_ID)' are classified as QUERY_TYPE_MASTER_READ|QUERY_TYPE_SESSION_WRITE|QUERY_TYPE_USERVAR_WRITE Earlier @@last_insert_id had the QUERY_TYPE_READ bit set as well, which indirectly caused the problems of MXS-2898. --- query_classifier/qc_sqlite/qc_sqlite.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/query_classifier/qc_sqlite/qc_sqlite.cc b/query_classifier/qc_sqlite/qc_sqlite.cc index 0d9aebd31..c6fea5c2f 100644 --- a/query_classifier/qc_sqlite/qc_sqlite.cc +++ b/query_classifier/qc_sqlite/qc_sqlite.cc @@ -1016,7 +1016,7 @@ public: { if (strcasecmp(zToken, "last_insert_id") == 0) { - m_type_mask |= (QUERY_TYPE_READ | QUERY_TYPE_MASTER_READ); + m_type_mask |= QUERY_TYPE_MASTER_READ; } else if (is_sequence_related_function(zToken)) {