Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.2.31, 10.3.22, 10.4.12, 10.5.2
-
None
Description
The CREATE SERVER statement allows you to set the HOST and PORT options if the server is remote, but it also allows you to set the SOCKET option if the server is local.
Generally speaking, you can't use the SOCKET option and also use the HOST and PORT options.
However, the server will happily accept all 3 options at the same time. For example, this succeeds:
CREATE OR REPLACE SERVER hq_server |
FOREIGN DATA WRAPPER mariadb |
OPTIONS (
|
HOST '127.0.0.1', |
DATABASE 'hq_sales', |
USER 'spider_user', |
PASSWORD 'password', |
PORT 3307,
|
SOCKET '/var/lib/mysql/mysql.sock' |
);
|
And all 3 values are written to the mysql.servers table:
MariaDB [(none)]> SELECT * FROM mysql.servers; |
+-------------+-----------+----------+-------------+----------+------+---------------------------+---------+-------+ |
| Server_name | Host | Db | Username | Password | Port | Socket | Wrapper | Owner | |
+-------------+-----------+----------+-------------+----------+------+---------------------------+---------+-------+ |
| hq_server | 127.0.0.1 | hq_sales | spider_user | password | 3307 | /var/lib/mysql/mysql.sock | mariadb | | |
+-------------+-----------+----------+-------------+----------+------+---------------------------+---------+-------+ |
1 row in set (0.001 sec) |
Would it make sense to throw an error or warning if the SOCKET option is defined and the HOST and PORT options are also defined?
Attachments
Issue Links
- relates to
-
MDEV-27106 Spider: specify connection to data node by engine-defined attributes
- Closed
-
MDEV-33925 Add TLS-related options for CREATE SERVER
- Open