Skip to content

Commit

Permalink
Merge pull request #244 from hholzgra/hartmut-MDEV-726
Browse files Browse the repository at this point in the history
MDEV-726 - CREATE and ALTER SERVER need to lowercase host name
  • Loading branch information
Alexander Barkov committed Nov 19, 2016
2 parents 4504986 + 86637b2 commit e0fc6dc
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
9 changes: 9 additions & 0 deletions mysql-test/r/create_drop_server.result
Original file line number Diff line number Diff line change
Expand Up @@ -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;
9 changes: 9 additions & 0 deletions mysql-test/t/create_drop_server.test
Original file line number Diff line number Diff line change
Expand Up @@ -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;
1 change: 1 addition & 0 deletions sql/sql_yacc.yy
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down

0 comments on commit e0fc6dc

Please sign in to comment.