Skip to content

Commit

Permalink
Merge pull request #2185 from YYJiangLoveU/MS-branch
Browse files Browse the repository at this point in the history
Let ProxySQL support Azure MySQL
  • Loading branch information
renecannao authored Aug 11, 2019
2 parents 17f8cd8 + e58cfc2 commit 9e81359
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/MySQL_Monitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,7 @@ bool MySQL_Monitor_State_Data::create_new_connection() {
if (timeout==0) timeout=1;
mysql_options(mysql, MYSQL_OPT_CONNECT_TIMEOUT, &timeout);
mysql_options4(mysql, MYSQL_OPT_CONNECT_ATTR_ADD, "program_name", "proxysql_monitor");
mysql_options4(mysql, MYSQL_OPT_CONNECT_ATTR_ADD, "_server_host", hostname);
MYSQL *myrc=NULL;
if (port) {
myrc=mysql_real_connect(mysql, hostname, mysql_thread___monitor_username, mysql_thread___monitor_password, NULL, port, NULL, 0);
Expand Down
1 change: 1 addition & 0 deletions lib/MySQL_Session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ void * kill_query_thread(void *arg) {
MySQL_Thread * thread = ka->mt;
mysql=mysql_init(NULL);
mysql_options4(mysql, MYSQL_OPT_CONNECT_ATTR_ADD, "program_name", "proxysql_killer");
mysql_options4(mysql, MYSQL_OPT_CONNECT_ATTR_ADD, "_server_host", ka->hostname);
if (!mysql) {
goto __exit_kill_query_thread;
}
Expand Down
1 change: 1 addition & 0 deletions lib/mysql_connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,7 @@ void MySQL_Connection::connect_start() {
assert(mysql);
mysql_options(mysql, MYSQL_OPT_NONBLOCK, 0);
mysql_options4(mysql, MYSQL_OPT_CONNECT_ATTR_ADD, "program_name", "proxysql");
mysql_options4(mysql, MYSQL_OPT_CONNECT_ATTR_ADD, "_server_host", parent->address);
if (parent->use_ssl) {
mysql_ssl_set(mysql, mysql_thread___ssl_p2s_key, mysql_thread___ssl_p2s_cert, mysql_thread___ssl_p2s_ca, NULL, mysql_thread___ssl_p2s_cipher);
}
Expand Down

0 comments on commit 9e81359

Please sign in to comment.