Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix:cannot connect to maxinfo with python client
  • Loading branch information
ybbct authored and markus456 committed Jan 16, 2018
1 parent 2b65388 commit 454f195
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Expand Up @@ -51,3 +51,12 @@ CMakeFiles/*
*/*/*/*/CMakeFiles/*
Makefile
/.DS_Store

# Netbeans Project files
nbproject/
/build/

# RBCommons
.reviewboardrc
# vscode
.vscode
10 changes: 7 additions & 3 deletions server/modules/routing/maxinfo/maxinfo.c
Expand Up @@ -61,7 +61,7 @@ static int maxinfo_statistics(INFO_INSTANCE *, INFO_SESSION *, GWBUF *);
static int maxinfo_ping(INFO_INSTANCE *, INFO_SESSION *, GWBUF *);
static int maxinfo_execute_query(INFO_INSTANCE *, INFO_SESSION *, char *);
static int handle_url(INFO_INSTANCE *instance, INFO_SESSION *router_session, GWBUF *queue);

static int maxinfo_send_ok(DCB *dcb);

/* The router entry points */
static MXS_ROUTER *createInstance(SERVICE *service, char **options);
Expand Down Expand Up @@ -356,7 +356,7 @@ execute(MXS_ROUTER *rinstance, MXS_ROUTER_SESSION *router_session, GWBUF *queue)
switch (MYSQL_COMMAND(queue))
{
case COM_PING:
rc = maxinfo_ping(instance, session, queue);
rc = maxinfo_send_ok(session->dcb);
break;
case COM_STATISTICS:
rc = maxinfo_statistics(instance, session, queue);
Expand Down Expand Up @@ -618,14 +618,18 @@ maxinfo_execute_query(INFO_INSTANCE *instance, INFO_SESSION *session, char *sql)
respond_starttime(session->dcb);
return 1;
}
if (strcasecmp(sql, "set names 'utf8'") == 0)
if (strncasecmp(sql, "set names", 9) == 0)
{
return maxinfo_send_ok(session->dcb);
}
if (strncasecmp(sql, "set session", 11) == 0)
{
return maxinfo_send_ok(session->dcb);
}
if (strncasecmp(sql, "set @@session", 13) == 0)
{
return maxinfo_send_ok(session->dcb);
}
if (strncasecmp(sql, "set autocommit", 14) == 0)
{
return maxinfo_send_ok(session->dcb);
Expand Down

0 comments on commit 454f195

Please sign in to comment.