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.
This commit is contained in:
Johan Wikman
2020-03-03 14:35:23 +02:00
parent 4c2909e86c
commit 0aae500577

View File

@ -1016,7 +1016,7 @@ public:
{ {
if (strcasecmp(zToken, "last_insert_id") == 0) 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)) else if (is_sequence_related_function(zToken))
{ {