[MDEV-15696] Implement SHOW CREATE SERVER Created: 2018-03-27  Updated: 2023-04-11

Status: Open
Project: MariaDB Server
Component/s: Storage Engine - Federated, Storage Engine - Spider
Fix Version/s: None

Type: Task Priority: Major
Reporter: Geoff Montee (Inactive) Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: create_server, federated, federatedx, show, spider


 Description   

CREATE SERVER is a valid statement in MariaDB:

https://mariadb.com/kb/en/library/create-server/

However, it seems like SHOW CREATE SERVER isn't implemented yet. Maybe it would be worth implementing?

MariaDB [(none)]> CREATE SERVER srv1
    ->   FOREIGN DATA WRAPPER mysql
    -> OPTIONS(
    ->   HOST '172.30.0.58',
    ->   DATABASE 'db1',
    ->   USER 'maxscale',
    ->   PASSWORD 'password'
    -> );
Query OK, 0 rows affected (0.00 sec)
 
MariaDB [(none)]> SHOW CREATE SERVER srv1;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SERVER srv1' at line 1
MariaDB [(none)]> SELECT * FROM mysql.servers\G
*************************** 1. row ***************************
Server_name: srv1
       Host: 172.30.0.58
         Db: db1
   Username: maxscale
   Password: password
       Port: 3306
     Socket:
    Wrapper: mysql
      Owner:
1 row in set (0.00 sec)



 Comments   
Comment by Yuchen Pei [ 2023-03-29 ]

This task itself looks it could be useful and easy to implement.

sanja Is SHOW CREATE FOO part of the sql standard? I know for example SHOW CREATE TABLE it is not supported in postgresql.

Comment by Federico Razzoli [ 2023-04-11 ]

It would be useful for humans, but scripts would have to parse the output SQL. Or the can query the `servers` table in the `mysql` database, which is currently the only way. But I believe that this is a bad practice.

I'd suggest to add a table to the `information_schema`. I'm not filing a feature request because, if you decide to do it, I'm not sure if that would be part of this task.

Generated at Thu Feb 08 08:23:20 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.