Skip to content

Commit

Permalink
fix bug of set character_[client|results|connection]
Browse files Browse the repository at this point in the history
  • Loading branch information
Qihoo360 committed Jan 2, 2014
1 parent 0c749d4 commit ca78f54
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions plugins/proxy/proxy-plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -1130,21 +1130,23 @@ void modify_charset(GPtrArray* tokens, network_mysqld_con* con) {
g_string_assign(con->charset_client, str);
g_string_assign(con->charset_results, str);
g_string_assign(con->charset_connection, str);
} else if (strcasecmp(str, "CHARACTER_SET_CLIENT") == 0) {
is_set_client = TRUE;

str = ((sql_token*)(tokens->pdata[3]))->text->str;
g_string_assign(con->charset_client, str);
} else if (strcasecmp(str, "CHARACTER_SET_RESULTS") == 0) {
is_set_results = TRUE;

str = ((sql_token*)(tokens->pdata[3]))->text->str;
g_string_assign(con->charset_results, str);
} else if (strcasecmp(str, "CHARACTER_SET_CONNECTION") == 0) {
is_set_connection = TRUE;

str = ((sql_token*)(tokens->pdata[3]))->text->str;
g_string_assign(con->charset_connection, str);
} else if (tokens->len > 4 && ((sql_token*)(tokens->pdata[3]))->token_id == TK_EQ) {
if (strcasecmp(str, "CHARACTER_SET_RESULTS") == 0) {
is_set_results = TRUE;

str = ((sql_token*)(tokens->pdata[4]))->text->str;
g_string_assign(con->charset_results, str);
} else if (strcasecmp(str, "CHARACTER_SET_CLIENT") == 0) {
is_set_client = TRUE;

str = ((sql_token*)(tokens->pdata[4]))->text->str;
g_string_assign(con->charset_client, str);
} else if (strcasecmp(str, "CHARACTER_SET_CONNECTION") == 0) {
is_set_connection = TRUE;

str = ((sql_token*)(tokens->pdata[4]))->text->str;
g_string_assign(con->charset_connection, str);
}
}
}
}
Expand Down

0 comments on commit ca78f54

Please sign in to comment.