[MDEV-21685] ALTER USER parser definition has wrong parameter order Created: 2020-02-07 Updated: 2020-02-10 Resolved: 2020-02-10 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Authentication and Privilege System |
| Affects Version/s: | 10.2.3, 10.3.0, 10.4.0, 10.4.12 |
| Fix Version/s: | N/A |
| Type: | Bug | Priority: | Major |
| Reporter: | Jacob Moorman (Inactive) | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
toddstoffel escalated a customer concern that ALTER USER IF EXISTS does not appear to function correctly, and inquired if this was a code defect or a documentation defect. Local test confirmed that the documented ALTER USER IF EXISTS syntax generated an error. Examination of the related KB content showed that the IF EXISTS content was present in the oldest version of the KB page. Examination of sql_yacc.yy showed that the token order does not appear to align to the documented and expected behavior. Adjustment of the test query to the token order in sql_yacc.yy confirmed that the ALTER did not generate an error, confirming that this is a problem with the parser grammar. As implemented ALTER USER IF EXISTS is only accepted as ALTER IF EXISTS USER. From 10.4.12:
https://github.com/MariaDB/server/blob/mariadb-10.4.12/sql/sql_yacc.yy#L7972 This is inconsistent with how IF EXISTS is used by other commands. For example, it is DROP USER IF EXISTS, rather than DROP IF EXISTS USER:
https://github.com/MariaDB/server/blob/mariadb-10.4.12/sql/sql_yacc.yy#L13338 The expected token order would be:
This defect appears present in 10.2, 10.3, 10.4. |