commit 66c281904eba78985108b3b6f2eda48a2bdee978 Author: kaiwang.ckw Date: Tue Feb 18 18:58:21 2020 +0800 Bug #98521 Core client cannot send any query with commentary characters in hints Problem ------- The single-line commentary characters (# or --) is valid in the hint parser. For example, opt_hints.test checks "select#1" as a query block identifier. However, the core interactive client mysql(1) can not send such queries. Analysis -------- The problem is due to the command-line input processing loop in add_line() respects single-line comments in all contexts except for that of client-side multi-line comment. However, hint comments are designed to behave like regular client-side multi-line comments. Fix --- Make hint comment an exceptional context in single-line comment processing. Since the fix resides in the command-line input processing loop, no test file is provided. Instead, it is supposed to be verified by hand. diff --git a/client/mysql.cc b/client/mysql.cc index fde2ad60025..ad612899fc7 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -2482,6 +2482,7 @@ static bool add_line(String &buffer, char *line, size_t line_length, } buffer.length(0); } else if (!*ml_comment && + ss_comment != SSC_HINT && (!*in_string && (inchar == '#' || (inchar == '-' && pos[1] == '-' &&