Skip to content

Commit

Permalink
Update charset variables from runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
renecannao committed Jul 11, 2020
1 parent 68f2dab commit eac395b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/ProxySQL_Admin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5520,6 +5520,21 @@ void ProxySQL_Admin::flush_mysql_variables___database_to_runtime(SQLite3DB *db,
}
}
} else {
if (
(strcmp(r->fields[0],"default_collation_connection")==0)
|| (strcmp(r->fields[0],"default_charset")==0)
) {
char *val=GloMTH->get_variable(r->fields[0]);
char q[1000];
if (val) {
if (strcmp(val,value)) {
proxy_warning("Variable %s with value \"%s\" is being replaced with value \"%s\".\n", r->fields[0],value, val);
sprintf(q,"INSERT OR REPLACE INTO global_variables VALUES(\"mysql-%s\",\"%s\")",r->fields[0],val);
db->execute(q);
}
free(val);
}
}
proxy_debug(PROXY_DEBUG_ADMIN, 4, "Set variable %s with value \"%s\"\n", r->fields[0],value);
if (strcmp(r->fields[0],(char *)"show_processlist_extended")==0) {
variables.mysql_show_processlist_extended = atoi(value);
Expand Down

0 comments on commit eac395b

Please sign in to comment.