diff --git a/include/mysqld_error.h b/include/mysqld_error.h index fbf89bdb3e1..df52a4f0109 100644 --- a/include/mysqld_error.h +++ b/include/mysqld_error.h @@ -305,5 +305,5 @@ #define ER_WARN_DEPRECATED_SYNTAX 1286 #define ER_NON_UPDATABLE_TABLE 1287 #define ER_FEATURE_DISABLED 1288 -#define ER_SKIP_GRANT_TABLES 1289 +#define ER_OPTION_PREVENTS_STATEMENT 1289 #define ER_ERROR_MESSAGES 290 diff --git a/sql/share/czech/errmsg.txt b/sql/share/czech/errmsg.txt index 917b2259e24..480700a0a2a 100644 --- a/sql/share/czech/errmsg.txt +++ b/sql/share/czech/errmsg.txt @@ -301,4 +301,4 @@ character-set=latin2 "'%s' is deprecated. Use '%s' instead.", "The target table %-.100s of the %s is not updatable.", "The '%s' feature was disabled. You need MySQL built with '%s' define to have it working" -"MySQL is started in --skip-grant-tables mode. You can't use this command" +"The MySQL server is running with the %s option so cannot execute this statement" diff --git a/sql/share/danish/errmsg.txt b/sql/share/danish/errmsg.txt index 591e007f5a6..1e3b2178fb5 100644 --- a/sql/share/danish/errmsg.txt +++ b/sql/share/danish/errmsg.txt @@ -295,4 +295,4 @@ character-set=latin1 "'%s' is deprecated. Use '%s' instead.", "The target table %-.100s of the %s is not updatable.", "The '%s' feature was disabled. You need MySQL built with '%s' define to have it working" -"MySQL is started in --skip-grant-tables mode. You can't use this command" +"The MySQL server is running with the %s option so cannot execute this statement" diff --git a/sql/share/dutch/errmsg.txt b/sql/share/dutch/errmsg.txt index 3a0d77187bf..b27e74a0175 100644 --- a/sql/share/dutch/errmsg.txt +++ b/sql/share/dutch/errmsg.txt @@ -303,4 +303,4 @@ character-set=latin1 "'%s' is deprecated. Use '%s' instead.", "The target table %-.100s of the %s is not updatable.", "The '%s' feature was disabled. You need MySQL built with '%s' define to have it working" -"MySQL is started in --skip-grant-tables mode. You can't use this command" +"The MySQL server is running with the %s option so cannot execute this statement" diff --git a/sql/share/english/errmsg.txt b/sql/share/english/errmsg.txt index 38ca4966dfe..fef7baa02b4 100644 --- a/sql/share/english/errmsg.txt +++ b/sql/share/english/errmsg.txt @@ -292,4 +292,4 @@ character-set=latin1 "'%s' is deprecated. Use '%s' instead.", "The target table %-.100s of the %s is not updatable.", "The '%s' feature was disabled. You need MySQL built with '%s' define to have it working", -"MySQL is started in --skip-grant-tables mode. You can't use this command" +"The MySQL server is running with the %s option so cannot execute this statement" diff --git a/sql/share/estonian/errmsg.txt b/sql/share/estonian/errmsg.txt index f0882d5602b..494f38048b1 100644 --- a/sql/share/estonian/errmsg.txt +++ b/sql/share/estonian/errmsg.txt @@ -297,4 +297,4 @@ character-set=latin7 "'%s' is deprecated. Use '%s' instead.", "The target table %-.100s of the %s is not updatable.", "The '%s' feature was disabled. You need MySQL built with '%s' define to have it working" -"MySQL is started in --skip-grant-tables mode. You can't use this command" +"The MySQL server is running with the %s option so cannot execute this statement" diff --git a/sql/share/french/errmsg.txt b/sql/share/french/errmsg.txt index d3c7c3ebde1..3e70e7ccb7e 100644 --- a/sql/share/french/errmsg.txt +++ b/sql/share/french/errmsg.txt @@ -292,4 +292,4 @@ character-set=latin1 "'%s' is deprecated. Use '%s' instead.", "The target table %-.100s of the %s is not updatable.", "The '%s' feature was disabled. You need MySQL built with '%s' define to have it working" -"MySQL is started in --skip-grant-tables mode. You can't use this command" +"The MySQL server is running with the %s option so cannot execute this statement" diff --git a/sql/share/german/errmsg.txt b/sql/share/german/errmsg.txt index 48eff8831d5..8d27b9f43f8 100644 --- a/sql/share/german/errmsg.txt +++ b/sql/share/german/errmsg.txt @@ -304,4 +304,4 @@ character-set=latin1 "'%s' is deprecated. Use '%s' instead.", "The target table %-.100s of the %s is not updatable.", "The '%s' feature was disabled. You need MySQL built with '%s' define to have it working" -"MySQL is started in --skip-grant-tables mode. You can't use this command" +"The MySQL server is running with the %s option so cannot execute this statement" diff --git a/sql/share/greek/errmsg.txt b/sql/share/greek/errmsg.txt index 1e3c436e3d0..0393c0ba39c 100644 --- a/sql/share/greek/errmsg.txt +++ b/sql/share/greek/errmsg.txt @@ -292,4 +292,4 @@ character-set=greek "'%s' is deprecated. Use '%s' instead.", "The target table %-.100s of the %s is not updatable.", "The '%s' feature was disabled. You need MySQL built with '%s' define to have it working" -"MySQL is started in --skip-grant-tables mode. You can't use this command" +"The MySQL server is running with the %s option so cannot execute this statement" diff --git a/sql/share/hungarian/errmsg.txt b/sql/share/hungarian/errmsg.txt index 402933d7ef7..6663bccc94f 100644 --- a/sql/share/hungarian/errmsg.txt +++ b/sql/share/hungarian/errmsg.txt @@ -294,4 +294,4 @@ character-set=latin2 "'%s' is deprecated. Use '%s' instead.", "The target table %-.100s of the %s is not updatable.", "The '%s' feature was disabled. You need MySQL built with '%s' define to have it working" -"MySQL is started in --skip-grant-tables mode. You can't use this command" +"The MySQL server is running with the %s option so cannot execute this statement" diff --git a/sql/share/italian/errmsg.txt b/sql/share/italian/errmsg.txt index d9be6ebb32d..42c71ee90e5 100644 --- a/sql/share/italian/errmsg.txt +++ b/sql/share/italian/errmsg.txt @@ -292,4 +292,4 @@ character-set=latin1 "'%s' is deprecated. Use '%s' instead.", "The target table %-.100s of the %s is not updatable.", "The '%s' feature was disabled. You need MySQL built with '%s' define to have it working" -"MySQL is started in --skip-grant-tables mode. You can't use this command" +"The MySQL server is running with the %s option so cannot execute this statement" diff --git a/sql/share/japanese/errmsg.txt b/sql/share/japanese/errmsg.txt index cc36dd60e85..f145b23e445 100644 --- a/sql/share/japanese/errmsg.txt +++ b/sql/share/japanese/errmsg.txt @@ -294,4 +294,4 @@ character-set=ujis "'%s' is deprecated. Use '%s' instead.", "The target table %-.100s of the %s is not updatable.", "The '%s' feature was disabled. You need MySQL built with '%s' define to have it working" -"MySQL is started in --skip-grant-tables mode. You can't use this command" +"The MySQL server is running with the %s option so cannot execute this statement" diff --git a/sql/share/korean/errmsg.txt b/sql/share/korean/errmsg.txt index 0bbea735a09..06c7c74109c 100644 --- a/sql/share/korean/errmsg.txt +++ b/sql/share/korean/errmsg.txt @@ -292,4 +292,4 @@ character-set=euckr "'%s' is deprecated. Use '%s' instead.", "The target table %-.100s of the %s is not updatable.", "The '%s' feature was disabled. You need MySQL built with '%s' define to have it working" -"MySQL is started in --skip-grant-tables mode. You can't use this command" +"The MySQL server is running with the %s option so cannot execute this statement" diff --git a/sql/share/norwegian-ny/errmsg.txt b/sql/share/norwegian-ny/errmsg.txt index 2372e7a9690..14f2515b086 100644 --- a/sql/share/norwegian-ny/errmsg.txt +++ b/sql/share/norwegian-ny/errmsg.txt @@ -294,4 +294,4 @@ character-set=latin1 "'%s' is deprecated. Use '%s' instead.", "The target table %-.100s of the %s is not updatable.", "The '%s' feature was disabled. You need MySQL built with '%s' define to have it working" -"MySQL is started in --skip-grant-tables mode. You can't use this command" +"The MySQL server is running with the %s option so cannot execute this statement" diff --git a/sql/share/norwegian/errmsg.txt b/sql/share/norwegian/errmsg.txt index f946e988fb0..2a46ef228c4 100644 --- a/sql/share/norwegian/errmsg.txt +++ b/sql/share/norwegian/errmsg.txt @@ -294,4 +294,4 @@ character-set=latin1 "'%s' is deprecated. Use '%s' instead.", "The target table %-.100s of the %s is not updatable.", "The '%s' feature was disabled. You need MySQL built with '%s' define to have it working" -"MySQL is started in --skip-grant-tables mode. You can't use this command" +"The MySQL server is running with the %s option so cannot execute this statement" diff --git a/sql/share/polish/errmsg.txt b/sql/share/polish/errmsg.txt index c6bb914d38c..1599184465f 100644 --- a/sql/share/polish/errmsg.txt +++ b/sql/share/polish/errmsg.txt @@ -296,4 +296,4 @@ character-set=latin2 "'%s' is deprecated. Use '%s' instead.", "The target table %-.100s of the %s is not updatable.", "The '%s' feature was disabled. You need MySQL built with '%s' define to have it working" -"MySQL is started in --skip-grant-tables mode. You can't use this command" +"The MySQL server is running with the %s option so cannot execute this statement" diff --git a/sql/share/portuguese/errmsg.txt b/sql/share/portuguese/errmsg.txt index 537162fc1d0..2caa242a69d 100644 --- a/sql/share/portuguese/errmsg.txt +++ b/sql/share/portuguese/errmsg.txt @@ -293,4 +293,4 @@ character-set=latin1 "'%s' И desatualizado. Use '%s' em seu lugar.", "The target table %-.100s of the %s is not updatable.", "The '%s' feature was disabled. You need MySQL built with '%s' define to have it working" -"MySQL is started in --skip-grant-tables mode. You can't use this command" +"The MySQL server is running with the %s option so cannot execute this statement" diff --git a/sql/share/romanian/errmsg.txt b/sql/share/romanian/errmsg.txt index 8da92d48883..50ec3ac6802 100644 --- a/sql/share/romanian/errmsg.txt +++ b/sql/share/romanian/errmsg.txt @@ -296,4 +296,4 @@ character-set=latin2 "'%s' is deprecated. Use '%s' instead.", "The target table %-.100s of the %s is not updatable.", "The '%s' feature was disabled. You need MySQL built with '%s' define to have it working" -"MySQL is started in --skip-grant-tables mode. You can't use this command" +"The MySQL server is running with the %s option so cannot execute this statement" diff --git a/sql/share/russian/errmsg.txt b/sql/share/russian/errmsg.txt index d5d91deb280..4a1f9eccbce 100644 --- a/sql/share/russian/errmsg.txt +++ b/sql/share/russian/errmsg.txt @@ -294,4 +294,4 @@ character-set=koi8r "'%s' is deprecated. Use '%s' instead.", "Таблица %-.100s в %s не может изменятся.", "The '%s' feature was disabled. You need MySQL built with '%s' define to have it working" -"MySQL is started in --skip-grant-tables mode. You can't use this command" +"The MySQL server is running with the %s option so cannot execute this statement" diff --git a/sql/share/serbian/errmsg.txt b/sql/share/serbian/errmsg.txt index 8fa7933b871..1ffda2b94b2 100644 --- a/sql/share/serbian/errmsg.txt +++ b/sql/share/serbian/errmsg.txt @@ -287,4 +287,4 @@ character-set=cp1250 "'%s' is deprecated. Use '%s' instead.", "The target table %-.100s of the %s is not updatable.", "The '%s' feature was disabled. You need MySQL built with '%s' define to have it working" -"MySQL is started in --skip-grant-tables mode. You can't use this command" +"The MySQL server is running with the %s option so cannot execute this statement" diff --git a/sql/share/slovak/errmsg.txt b/sql/share/slovak/errmsg.txt index 90fbe450bb1..b7563f1a562 100644 --- a/sql/share/slovak/errmsg.txt +++ b/sql/share/slovak/errmsg.txt @@ -300,4 +300,4 @@ character-set=latin2 "'%s' is deprecated. Use '%s' instead.", "The target table %-.100s of the %s is not updatable.", "The '%s' feature was disabled. You need MySQL built with '%s' define to have it working" -"MySQL is started in --skip-grant-tables mode. You can't use this command" +"The MySQL server is running with the %s option so cannot execute this statement" diff --git a/sql/share/spanish/errmsg.txt b/sql/share/spanish/errmsg.txt index 644a5c7a515..1296c4cc72a 100644 --- a/sql/share/spanish/errmsg.txt +++ b/sql/share/spanish/errmsg.txt @@ -294,4 +294,4 @@ character-set=latin1 "'%s' is deprecated. Use '%s' instead.", "The target table %-.100s of the %s is not updatable.", "The '%s' feature was disabled. You need MySQL built with '%s' define to have it working" -"MySQL is started in --skip-grant-tables mode. You can't use this command" +"The MySQL server is running with the %s option so cannot execute this statement" diff --git a/sql/share/swedish/errmsg.txt b/sql/share/swedish/errmsg.txt index 22a6cecd773..4e373d68e33 100644 --- a/sql/share/swedish/errmsg.txt +++ b/sql/share/swedish/errmsg.txt @@ -292,4 +292,4 @@ character-set=latin1 "'%s' is deprecated. Use '%s' instead.", "The target table %-.100s of the %s is not updatable.", "The '%s' feature was disabled. You need MySQL built with '%s' define to have it working" -"MySQL is started in --skip-grant-tables mode. You can't use this command" +"The MySQL server is running with the %s option so cannot execute this statement" diff --git a/sql/share/ukrainian/errmsg.txt b/sql/share/ukrainian/errmsg.txt index 2d4ce67e2e5..5eb62a2c7f2 100644 --- a/sql/share/ukrainian/errmsg.txt +++ b/sql/share/ukrainian/errmsg.txt @@ -297,4 +297,4 @@ character-set=koi8u "'%s' is deprecated. Use '%s' instead.", "Таблиця %-.100s у %s не може оновлюватись.", "The '%s' feature was disabled. You need MySQL built with '%s' define to have it working" -"MySQL is started in --skip-grant-tables mode. You can't use this command" +"The MySQL server is running with the %s option so cannot execute this statement" diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index c500f0cf1f7..30049836dd6 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -1115,7 +1115,8 @@ bool check_change_password(THD *thd, const char *host, const char *user) { if (!initialized) { - send_error(thd, ER_SKIP_GRANT_TABLES); /* purecov: inspected */ + net_printf(thd,ER_OPTION_PREVENTS_STATEMENT, + "--skip-grant-tables"); /* purecov: inspected */ return(1); /* purecov: inspected */ } if (!thd->slave_thread && @@ -1433,13 +1434,10 @@ static int replace_user_table(THD *thd, TABLE *table, const LEX_USER &combo, if (!create_user) { if (what == 'N') - my_printf_error(ER_NONEXISTING_GRANT,ER(ER_NONEXISTING_GRANT), - MYF(0),combo.user.str,combo.host.str); + my_error(ER_NONEXISTING_GRANT, MYF(0), combo.user.str, combo.host.str); else - my_printf_error(ER_NO_PERMISSION_TO_CREATE_USER, - ER(ER_NO_PERMISSION_TO_CREATE_USER), - MYF(0),thd->user, - thd->host_or_ip); + my_error(ER_NO_PERMISSION_TO_CREATE_USER, MYF(0), + thd->user, thd->host_or_ip); error= -1; goto end; } @@ -1593,7 +1591,7 @@ static int replace_db_table(TABLE *table, const char *db, if (!initialized) { - my_error(ER_SKIP_GRANT_TABLES, MYF(0)); + my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--skip-grant-tables"); DBUG_RETURN(-1); } @@ -1613,8 +1611,7 @@ static int replace_db_table(TABLE *table, const char *db, { if (what == 'N') { // no row, no revoke - my_printf_error(ER_NONEXISTING_GRANT,ER(ER_NONEXISTING_GRANT),MYF(0), - combo.user.str,combo.host.str); + my_error(ER_NONEXISTING_GRANT, MYF(0), combo.user.str, combo.host.str); goto abort; } old_row_exists = 0; @@ -1903,9 +1900,8 @@ static int replace_column_table(GRANT_TABLE *g_t, { if (revoke_grant) { - my_printf_error(ER_NONEXISTING_TABLE_GRANT, - ER(ER_NONEXISTING_TABLE_GRANT),MYF(0), - combo.user.str, combo.host.str,table_name); /* purecov: inspected */ + my_error(ER_NONEXISTING_TABLE_GRANT, MYF(0), + combo.user.str, combo.host.str, table_name); /* purecov: inspected */ result= -1; /* purecov: inspected */ continue; /* purecov: inspected */ } @@ -2071,10 +2067,9 @@ static int replace_table_table(THD *thd, GRANT_TABLE *grant_table, */ if (revoke_grant) { // no row, no revoke - my_printf_error(ER_NONEXISTING_TABLE_GRANT, - ER(ER_NONEXISTING_TABLE_GRANT),MYF(0), - combo.user.str,combo.host.str, - table_name); /* purecov: deadcode */ + my_error(ER_NONEXISTING_TABLE_GRANT, MYF(0), + combo.user.str, combo.host.str, + table_name); /* purecov: deadcode */ DBUG_RETURN(-1); /* purecov: deadcode */ } old_row_exists = 0; @@ -2174,8 +2169,9 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list, if (!initialized) { - send_error(thd, ER_SKIP_GRANT_TABLES); /* purecov: inspected */ - DBUG_RETURN(1); /* purecov: inspected */ + my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), + "--skip-grant-tables"); /* purecov: inspected */ + DBUG_RETURN(-1); /* purecov: inspected */ } if (rights & ~TABLE_ACLS) { @@ -2196,8 +2192,8 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list, if (!find_field_in_table(thd,table,column->column.ptr(), column->column.length(),0,0)) { - my_printf_error(ER_BAD_FIELD_ERROR,ER(ER_BAD_FIELD_ERROR),MYF(0), - column->column.c_ptr(), table_list->alias); + my_error(ER_BAD_FIELD_ERROR, MYF(0), + column->column.c_ptr(), table_list->alias); DBUG_RETURN(-1); } column_priv|= column->rights; @@ -2212,7 +2208,7 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list, fn_format(buf,buf,"","",4+16+32); if (access(buf,F_OK)) { - my_error(ER_NO_SUCH_TABLE,MYF(0),table_list->db, table_list->alias); + my_error(ER_NO_SUCH_TABLE, MYF(0), table_list->db, table_list->alias); DBUG_RETURN(-1); } } @@ -2291,9 +2287,8 @@ int mysql_table_grant(THD *thd, TABLE_LIST *table_list, { if (revoke_grant) { - my_printf_error(ER_NONEXISTING_TABLE_GRANT, - ER(ER_NONEXISTING_TABLE_GRANT),MYF(0), - Str->user.str, Str->host.str, table_list->real_name); + my_error(ER_NONEXISTING_TABLE_GRANT, MYF(0), + Str->user.str, Str->host.str, table_list->real_name); result= -1; continue; } @@ -2384,7 +2379,8 @@ int mysql_grant(THD *thd, const char *db, List &list, DBUG_ENTER("mysql_grant"); if (!initialized) { - my_error(ER_SKIP_GRANT_TABLES, MYF(0)); /* purecov: tested */ + my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), + "--skip-grant-tables"); /* purecov: tested */ DBUG_RETURN(-1); /* purecov: tested */ } @@ -2463,8 +2459,7 @@ int mysql_grant(THD *thd, const char *db, List &list, } else { - my_printf_error(ER_WRONG_USAGE, ER(ER_WRONG_USAGE), MYF(0), - "DB GRANT","GLOBAL PRIVILEGES"); + my_error(ER_WRONG_USAGE, MYF(0), "DB GRANT", "GLOBAL PRIVILEGES"); result= -1; } } @@ -2990,8 +2985,8 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user) LINT_INIT(acl_user); if (!initialized) { - send_error(thd, ER_SKIP_GRANT_TABLES); - DBUG_RETURN(1); + my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--skip-grant-tables"); + DBUG_RETURN(-1); } if (lex_user->host.length > HOSTNAME_LENGTH || lex_user->user.length > USERNAME_LENGTH) @@ -3014,8 +3009,8 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user) } if (counter == acl_users.elements) { - my_printf_error(ER_NONEXISTING_GRANT,ER(ER_NONEXISTING_GRANT), - MYF(0),lex_user->user.str,lex_user->host.str); + my_error(ER_NONEXISTING_GRANT, MYF(0), + lex_user->user.str, lex_user->host.str); DBUG_RETURN(-1); } @@ -3343,7 +3338,7 @@ int open_grant_tables(THD *thd, TABLE_LIST *tables) if (!initialized) { - send_error(thd, ER_SKIP_GRANT_TABLES); + net_printf(thd,ER_OPTION_PREVENTS_STATEMENT, "--skip-grant-tables"); DBUG_RETURN(-1); } diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 51e1ebee4ad..4138380903f 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1811,7 +1811,7 @@ mysql_execute_command(THD *thd) !(thd->slave_thread || (thd->master_access & SUPER_ACL)) && (uc_update_queries[lex->sql_command] > 0)) { - send_error(thd, ER_CANT_UPDATE_WITH_READLOCK); + net_printf(thd, ER_OPTION_PREVENTS_STATEMENT, "--read-only"); DBUG_VOID_RETURN; }