From 3f619478f796eddbba6e39502fe941b285dd97b1 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 4 May 2024 20:00:34 +0200 Subject: Adding upstream version 1:10.11.6. Signed-off-by: Daniel Baumann --- mysql-test/main/create_drop_server.result | 46 +++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 mysql-test/main/create_drop_server.result (limited to 'mysql-test/main/create_drop_server.result') diff --git a/mysql-test/main/create_drop_server.result b/mysql-test/main/create_drop_server.result new file mode 100644 index 00000000..dc3c5eef --- /dev/null +++ b/mysql-test/main/create_drop_server.result @@ -0,0 +1,46 @@ +# +# MDEV-7285 SERVER: CREATE OR REPLACE and CREATE IF NOT EXISTS +# +CREATE SERVER IF NOT EXISTS server1 FOREIGN DATA WRAPPER mysql OPTIONS (USER 'user1', HOST 'localhost', DATABASE 'test0'); +SELECT server_name, username, db FROM mysql.servers; +server_name username db +server1 user1 test0 +CREATE SERVER IF NOT EXISTS server1 FOREIGN DATA WRAPPER mysql OPTIONS (USER 'user2', HOST 'localhost', DATABASE 'test1'); +Warnings: +Note 1476 Cannot create foreign server 'server1' as it already exists +SELECT server_name, username, db FROM mysql.servers; +server_name username db +server1 user1 test0 +CREATE OR REPLACE SERVER server1 FOREIGN DATA WRAPPER mysql OPTIONS (USER 'user3', HOST 'localhost', DATABASE 'test2'); +SELECT server_name, username, db FROM mysql.servers; +server_name username db +server1 user3 test2 +DROP SERVER IF EXISTS server1; +SELECT server_name, username, db FROM mysql.servers; +server_name username db +DROP SERVER IF EXISTS server1; +CREATE SERVER server_1 FOREIGN DATA WRAPPER mysql OPTIONS (USER 'mysqltest_1', HOST 'localhost', DATABASE 'test0'); +CREATE SERVER server_1 FOREIGN DATA WRAPPER mysql OPTIONS (USER 'mysqltest_1', HOST 'localhost', DATABASE 'test1'); +ERROR HY000: Cannot create foreign server 'server_1' as it already exists +CREATE SERVER IF NOT EXISTS server_1 FOREIGN DATA WRAPPER mysql OPTIONS (USER 'mysqltest_1', HOST 'localhost', DATABASE 'test2'); +Warnings: +Note 1476 Cannot create foreign server 'server_1' as it already exists +SELECT server_name, username, db FROM mysql.servers; +server_name username db +server_1 mysqltest_1 test0 +CREATE OR REPLACE SERVER IF NOT EXISTS server_1 FOREIGN DATA WRAPPER mysql OPTIONS (USER 'mysqltest_1', HOST 'localhost', DATABASE 'test3'); +ERROR HY000: Incorrect usage of OR REPLACE and IF NOT EXISTS +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; +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; -- cgit v1.2.3