[MDEV-9400] DROP SERVER IF EXISTS doesn't issue a warning if server not exists Created: 2016-01-12  Updated: 2017-06-27

Status: Confirmed
Project: MariaDB Server
Component/s: None
Affects Version/s: 10.1
Fix Version/s: 10.1

Type: Bug Priority: Minor
Reporter: Federico Razzoli Assignee: Alexander Barkov
Resolution: Unresolved Votes: 0
Labels: None


 Description   

MariaDB KB doesn't describe the behavior of DROP SERVER IF EXISTS, so I expect it to work like DROP TABLE IF EXISTS. Which means that IF EXISTS should return a warning if the server doesn't exists. However, this is not the case:

MariaDB [(none)]> DROP SERVER IF EXISTS not_exists;
Query OK, 0 rows affected (0.01 sec)
 
MariaDB [(none)]> SHOW WARNINGS;
Empty set (0.00 sec)
 
MariaDB [(none)]> DROP SERVER not_exists;          
ERROR 1477 (HY000): The foreign server name you are trying to reference does not exist. Data source error:  not_exists



 Comments   
Comment by Federico Razzoli [ 2016-01-12 ]

I didn't check other IF [NOT] EXISTS clauses, so I don't know if the bug is only about DROP SERVER.

Comment by Elena Stepanova [ 2016-01-13 ]

Thanks for the report.

As far as I can tell, it's the only object which does not trigger the warning.

I don't see anything in MDEV-5359 or MDEV-7285 that would explain it. There is an MTR test main.create_drop_server which covers this functionality, and its result file does not have the warning either; but I'm still not sure it's intentional.

Assigning to bar, he will know.

Comment by Ian Gilfillan [ 2017-06-27 ]

I've added a mention of this anomalous behaviour to the docs in the meantime:
https://mariadb.com/kb/en/mariadb/drop-server/+revision/56011/56010/

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