[MDEV-17941] ALTER USER IF EXISTS does not work, although documentation says it should Created: 2018-12-08  Updated: 2020-02-10  Resolved: 2020-02-10

Status: Closed
Project: MariaDB Server
Component/s: Authentication and Privilege System
Affects Version/s: 10.2, 10.3, 10.4
Fix Version/s: 10.2.32, 10.3.23, 10.4.13

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Alexey Botchkov
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Duplicate
is duplicated by MDEV-21685 ALTER USER parser definition has wron... Closed

 Description   

Documentation for ALTER USER says

ALTER USER [IF EXISTS] 
 user_specification [,user_specification] ...
  [REQUIRE {NONE | tls_option [[AND] tls_option] ...}]
  [WITH resource_option [resource_option] ...]

and even explains what effect IF EXISTS is supposed to have. Only the syntax does not work:

MariaDB [test]> CREATE USER foo@bar;
Query OK, 0 rows affected (0.09 sec)
 
MariaDB [test]> ALTER USER IF EXISTS foo@bar REQUIRE SSL;
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 'IF EXISTS foo@bar REQUIRE SSL' at line 1

I'm not sure if it's an omission in the code or a mistake in documentation.



 Comments   
Comment by Jacob Moorman (Inactive) [ 2020-02-10 ]

As detailed on MDEV-21685, Documentation has confirmed this is an issue with the parser grammar, not documentation.

Comment by Alexey Botchkov [ 2020-02-10 ]

https://github.com/MariaDB/server/commit/f6663bfbd3f1dd321cd7d53291e3fa08a190ab2f

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