MXS-2713 Classify SET PASSWORD as QUERY_TYPE_WRITE

A change of the password is replicated to the slaves, so it
must only be sent to the master.
This commit is contained in:
Johan Wikman
2019-10-07 14:33:53 +03:00
parent 2a7f320cf4
commit e7e40b0179
5 changed files with 42 additions and 18 deletions

View File

@ -2730,6 +2730,13 @@ public:
}
break;
case TK_SET:
if (m_keyword_2 == TK_PASSWORD)
{
m_type_mask = QUERY_TYPE_WRITE;
}
break;
case TK_START:
switch (m_keyword_2)
{
@ -2932,6 +2939,9 @@ public:
&& pVariable->op == TK_ID
&& strcasecmp(pVariable->u.zToken, "password") == 0)
{
// Even though SET PASSWORD looks like a session command it
// is not, the password change will be replicated to slaves.
m_type_mask = QUERY_TYPE_WRITE;
// Ok, it was, so we break out.
i = pList->nExpr;
break;