Commit 394f6ba4 authored by Sergey Glukhov's avatar Sergey Glukhov

Bug#37268 'binary' character set makes CLI-internal commands case sensitive

The fix is to use case insensitive collation
for mysql client command search.
parent 73cf0d81
......@@ -1949,7 +1949,7 @@ static COMMANDS *find_command(char *name,char cmd_char)
*/
if (strstr(name, "\\g") || (strstr(name, delimiter) &&
!(strlen(name) >= 9 &&
!my_strnncoll(charset_info,
!my_strnncoll(&my_charset_latin1,
(uchar*) name, 9,
(const uchar*) "delimiter",
9))))
......@@ -1970,7 +1970,7 @@ static COMMANDS *find_command(char *name,char cmd_char)
{
if (commands[i].func &&
((name &&
!my_strnncoll(charset_info,(uchar*)name,len,
!my_strnncoll(&my_charset_latin1, (uchar*)name, len,
(uchar*)commands[i].name,len) &&
!commands[i].name[len] &&
(!end || (end && commands[i].takes_params))) ||
......
......@@ -198,4 +198,5 @@ COUNT (*)
1
COUNT (*)
1
ERROR 2005 (HY000) at line 1: Unknown MySQL server host 'invalid_hostname' (1)
End of 5.0 tests
......@@ -348,4 +348,11 @@ remove_file $MYSQLTEST_VARDIR/tmp/bug31060.sql;
--exec $MYSQL --ignore-spaces -e "SELECT COUNT (*)"
--exec $MYSQL -b -i -e "SELECT COUNT (*)"
#
# Bug#37268 'binary' character set makes CLI-internal commands case sensitive
#
--error 1
--exec $MYSQL --default-character-set=binary test -e "CONNECT test invalid_hostname" 2>&1
--exec $MYSQL --default-character-set=binary test -e "DELIMITER //" 2>&1
--echo End of 5.0 tests
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment