Skip to content

Commit

Permalink
Allow MariaDB ConnectorJ to connect to Admin #743
Browse files Browse the repository at this point in the history
Fake reply for:
* SHOW VARIABLES WHERE Variable_name in ('max_allowed_packet','system_time_zone','time_zone','sql_mode')
  • Loading branch information
renecannao committed Oct 28, 2016
1 parent f764ce7 commit a177439
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/ProxySQL_Admin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1716,6 +1716,14 @@ void admin_session_handler(MySQL_Session *sess, ProxySQL_Admin *pa, PtrSize_t *p
sprintf(query,q,PROXYSQL_VERSION);
goto __run_query;
}
if (!strncasecmp("SHOW VARIABLES WHERE Variable_name in ('max_allowed_packet','system_time_zone','time_zone','sql_mode')", query_no_space, strlen("SHOW VARIABLES WHERE Variable_name in ('max_allowed_packet','system_time_zone','time_zone','sql_mode')"))) {
l_free(query_length,query);
char *q=(char *)"SELECT 'max_allowed_packet' Variable_name,'4194304' Value UNION ALL SELECT 'sql_mode', 'STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION' UNION ALL SELECT 'system_time_zone', 'UTC' UNION ALL SELECT 'time_zone','SYSTEM'";
query_length=strlen(q)+20;
query=(char *)l_alloc(query_length);
sprintf(query,q,PROXYSQL_VERSION);
goto __run_query;
}

{
bool rc;
Expand Down

0 comments on commit a177439

Please sign in to comment.