Skip to content

Commit

Permalink
Remove any trailing spaces and semicolons from the SET statement
Browse files Browse the repository at this point in the history
  • Loading branch information
rahim-kanji committed Nov 21, 2023
1 parent 4fa4809 commit 09eb50a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/MySQL_Session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6032,6 +6032,8 @@ bool MySQL_Session::handler___status_WAITING_CLIENT_DATA___STATE_SLEEP___MYSQL_C
string nq=string((char *)CurrentQuery.QueryPointer,CurrentQuery.QueryLength);
RE2::GlobalReplace(&nq,(char *)"^/\\*!\\d\\d\\d\\d\\d SET(.*)\\*/",(char *)"SET\\1");
RE2::GlobalReplace(&nq,(char *)"(?U)/\\*.*\\*/",(char *)"");
// remove trailing space and semicolon if present. See issue#4380
nq.erase(nq.find_last_not_of(" ;") + 1);
/*
// we do not threat SET SQL_LOG_BIN as a special case
if (match_regexes && match_regexes[0]->match(dig)) {
Expand Down

0 comments on commit 09eb50a

Please sign in to comment.