Introduce internal protocol command enum

The enums exposed by the connector are not intended to be used by the
users of the library. The fact that the protocol, and other, modules used
it was in violation of how the library is intended to be used.

Adding an internal mapping into MaxScale also removes some of the
dependencies that the core has on the connector.
This commit is contained in:
Markus Mäkelä
2017-09-12 03:40:42 +03:00
parent 914ebb046a
commit 45e0e8bb59
29 changed files with 272 additions and 256 deletions

View File

@ -91,20 +91,20 @@ bool Backend::execute_session_command()
switch (sescmd.get_command())
{
case MYSQL_COM_QUIT:
case MYSQL_COM_STMT_CLOSE:
case MXS_COM_QUIT:
case MXS_COM_STMT_CLOSE:
/** These commands do not generate responses */
rval = write(buffer, NO_RESPONSE);
complete_session_command();
break;
case MYSQL_COM_CHANGE_USER:
case MXS_COM_CHANGE_USER:
/** This makes it possible to handle replies correctly */
gwbuf_set_type(buffer, GWBUF_TYPE_SESCMD);
rval = auth(buffer);
break;
case MYSQL_COM_QUERY:
case MXS_COM_QUERY:
default:
/**
* Mark session command buffer, it triggers writing