Skip to content

Commit

Permalink
Remove redundant code from MySQL_Session about charsets check
Browse files Browse the repository at this point in the history
  • Loading branch information
renecannao committed Jan 25, 2024
1 parent b757c97 commit eba540a
Showing 1 changed file with 24 additions and 5 deletions.
29 changes: 24 additions & 5 deletions lib/MySQL_Session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5049,8 +5049,26 @@ int MySQL_Session::handler() {
goto handler_again;
}

/*
// Since all variables below SQL_NAME_LAST_LOW_WM
// are related to charset, this section of the code is
// redundant because verify_set_names() takes care of it.
bool SQL_NAME_LAST_LOW_WM_matches = true;
// this is a "fast" version of the extensive check that follows
for (auto i = 0; i < SQL_NAME_LAST_LOW_WM && SQL_NAME_LAST_LOW_WM_matches == true; i++) {
if (i == SQL_CHARACTER_ACTION) {
if (client_myconn->var_hash[i] != myconn->var_hash[i]) {
SQL_NAME_LAST_LOW_WM_matches = false;
}
}
}
if (SQL_NAME_LAST_LOW_WM_matches == false) {
for (auto i = 0; i < SQL_NAME_LAST_LOW_WM; i++) {
auto client_hash = client_myds->myconn->var_hash[i];
auto client_hash = client_myconn->var_hash[i];
if (i == SQL_CHARACTER_ACTION) {
// SQL_CHARACTER_ACTION has no meaning for the backend
continue;
}
#ifdef DEBUG
if (GloVars.global.gdbg) {
switch (i) {
Expand All @@ -5075,11 +5093,12 @@ int MySQL_Session::handler() {
}
}
}
MySQL_Connection *c_con = client_myds->myconn;
vector<uint32_t>::const_iterator it_c = c_con->dynamic_variables_idx.begin(); // client connection iterator
for ( ; it_c != c_con->dynamic_variables_idx.end() ; it_c++) {
}
*/
vector<uint32_t>::const_iterator it_c = client_myconn->dynamic_variables_idx.begin(); // client connection iterator
for ( ; it_c != client_myconn->dynamic_variables_idx.end() ; it_c++) {
auto i = *it_c;
auto client_hash = c_con->var_hash[i];
auto client_hash = client_myconn->var_hash[i];
auto server_hash = myconn->var_hash[i];
if (client_hash != server_hash) {
if(
Expand Down

0 comments on commit eba540a

Please sign in to comment.