diff --git a/mysql-test/r/alter_user.result b/mysql-test/r/alter_user.result index ac668bba8fa..b67705c4fc4 100644 --- a/mysql-test/r/alter_user.result +++ b/mysql-test/r/alter_user.result @@ -43,7 +43,7 @@ SET GLOBAL read_only = @start_read_only; alter user boo; ERROR HY000: Operation ALTER USER failed for 'boo' #--warning ER_CANNOT_USER -alter if exists user boo; +alter user if exists boo; Warnings: Error 1133 Can't find any matching row in the user table Note 1396 Operation ALTER USER failed for 'boo' diff --git a/mysql-test/t/alter_user.test b/mysql-test/t/alter_user.test index ca444f70a70..3a1052a98f6 100644 --- a/mysql-test/t/alter_user.test +++ b/mysql-test/t/alter_user.test @@ -41,7 +41,7 @@ SET GLOBAL read_only = @start_read_only; --error ER_CANNOT_USER alter user boo; --echo #--warning ER_CANNOT_USER -alter if exists user boo; +alter user if exists boo; --echo # Test password related altering. alter user foo identified by 'something'; diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index fe7f3021be6..386c86cb3e2 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -7294,10 +7294,10 @@ alter: lex->server_options.reset($3); } OPTIONS_SYM '(' server_options_list ')' { } /* ALTER USER foo is allowed for MySQL compatibility. */ - | ALTER opt_if_exists USER_SYM clear_privileges grant_list + | ALTER USER_SYM opt_if_exists clear_privileges grant_list opt_require_clause opt_resource_options { - Lex->create_info.set($2); + Lex->create_info.set($3); Lex->sql_command= SQLCOM_ALTER_USER; } ;