Commit e0fc6dc8 authored by Alexander Barkov's avatar Alexander Barkov Committed by GitHub

Merge pull request #244 from hholzgra/hartmut-MDEV-726

MDEV-726 - CREATE and ALTER SERVER need to lowercase host name
parents 45049864 86637b25
......@@ -35,3 +35,12 @@ SELECT server_name, username, db FROM mysql.servers;
server_name username db
server_1 mysqltest_1 test4
DROP SERVER server_1;
CREATE SERVER server_1 FOREIGN DATA WRAPPER mysql OPTIONS (USER 'Remote', HOST 'Server.Example.Com', DATABASE 'test');
SELECT Host FROM mysql.servers WHERE Server_Name = 'server_1';
Host
server.example.com
ALTER SERVER server_1 OPTIONS(HOST 'Server.Example.Org');
SELECT Host FROM mysql.servers WHERE Server_Name = 'server_1';
Host
server.example.org
DROP SERVER server_1;
......@@ -23,3 +23,12 @@ CREATE OR REPLACE SERVER IF NOT EXISTS server_1 FOREIGN DATA WRAPPER mysql OPTIO
CREATE OR REPLACE SERVER server_1 FOREIGN DATA WRAPPER mysql OPTIONS (USER 'mysqltest_1', HOST 'localhost', DATABASE 'test4');
SELECT server_name, username, db FROM mysql.servers;
DROP SERVER server_1;
# MDEV-726 convert host names to lowercase
CREATE SERVER server_1 FOREIGN DATA WRAPPER mysql OPTIONS (USER 'Remote', HOST 'Server.Example.Com', DATABASE 'test');
SELECT Host FROM mysql.servers WHERE Server_Name = 'server_1';
ALTER SERVER server_1 OPTIONS(HOST 'Server.Example.Org');
SELECT Host FROM mysql.servers WHERE Server_Name = 'server_1';
DROP SERVER server_1;
......@@ -2684,6 +2684,7 @@ server_option:
{
MYSQL_YYABORT_UNLESS(Lex->server_options.host.str == 0);
Lex->server_options.host= $2;
my_casedn_str(system_charset_info, Lex->server_options.host.str);
}
| DATABASE TEXT_STRING_sys
{
......
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