diff options
author | unknown <serg@serg.mylan> | 2004-11-27 23:07:30 +0100 |
---|---|---|
committer | unknown <serg@serg.mylan> | 2004-11-27 23:07:30 +0100 |
commit | 6b619bc19fce42354d83953238955c1a33786aab (patch) | |
tree | 6aee196afde28c5ab6978f8c8b0563c01cdb5f8e | |
parent | 3c276f41baf53f0fe6412fd4aa664d9e67919c46 (diff) | |
download | mariadb-git-6b619bc19fce42354d83953238955c1a33786aab.tar.gz |
create/drop/rename user cleanup
dbug/user.r:
help cralified
include/mysqld_error.h:
new error message added
mysql-test/r/grant.result:
results updated
mysql-test/r/grant2.result:
results updated
mysql-test/t/grant.test:
results updated
mysql-test/t/grant2.test:
results updated
sql/share/czech/errmsg.txt:
error message updated
sql/share/danish/errmsg.txt:
error message updated
sql/share/dutch/errmsg.txt:
error message updated
sql/share/english/errmsg.txt:
error message updated
sql/share/estonian/errmsg.txt:
error message updated
sql/share/french/errmsg.txt:
error message updated
sql/sql_acl.cc:
changed error reporting for create/drop/rename user to be consistent with drop table
sql/share/german/errmsg.txt:
error message updated
sql/share/greek/errmsg.txt:
error message updated
sql/share/hungarian/errmsg.txt:
error message updated
sql/share/italian/errmsg.txt:
error message updated
sql/share/japanese/errmsg.txt:
error message updated
sql/share/korean/errmsg.txt:
error message updated
sql/share/norwegian-ny/errmsg.txt:
error message updated
sql/share/norwegian/errmsg.txt:
error message updated
sql/share/polish/errmsg.txt:
error message updated
sql/share/portuguese/errmsg.txt:
error message updated
sql/share/romanian/errmsg.txt:
error message updated
sql/share/russian/errmsg.txt:
error message updated
sql/share/serbian/errmsg.txt:
error message updated
sql/share/slovak/errmsg.txt:
error message updated
sql/share/spanish/errmsg.txt:
error message updated
sql/share/swedish/errmsg.txt:
error message updated
sql/share/ukrainian/errmsg.txt:
error message updated
30 files changed, 101 insertions, 101 deletions
diff --git a/dbug/user.r b/dbug/user.r index 84c5bca908c..f03f0675e0f 100644 --- a/dbug/user.r +++ b/dbug/user.r @@ -907,8 +907,10 @@ Double the colon, if you want it in the path .SP 1 EX: \fCa,C::\\tmp\\log\fR .LI A[,file] -Like 'a[,file]' but close and reopen file after each write. It helps to get -a complete log file in case of crashes. +Like 'a[,file]' but ensure that data are written after each write +(this typically implies flush or close/reopen). It helps to get +a complete log file in case of crashes. This mode is implied in +multi-threaded environment. .LI d[,keywords] Enable output from macros with specified keywords. A null list of keywords implies that all keywords are selected. diff --git a/include/mysqld_error.h b/include/mysqld_error.h index f5994e8e71d..99f126cc23d 100644 --- a/include/mysqld_error.h +++ b/include/mysqld_error.h @@ -284,7 +284,7 @@ #define ER_WARN_DATA_TRUNCATED 1265 #define ER_WARN_USING_OTHER_HANDLER 1266 #define ER_CANT_AGGREGATE_2COLLATIONS 1267 -#define ER_HANDLE_USER 1268 +#define ER_DROP_USER 1268 #define ER_REVOKE_GRANTS 1269 #define ER_CANT_AGGREGATE_3COLLATIONS 1270 #define ER_CANT_AGGREGATE_NCOLLATIONS 1271 @@ -412,4 +412,5 @@ #define ER_VIEW_MULTIUPDATE 1393 #define ER_VIEW_NO_INSERT_FIELD_LIST 1394 #define ER_VIEW_DELETE_MERGE_VIEW 1395 -#define ER_ERROR_MESSAGES 396 +#define ER_CANNOT_USER 1396 +#define ER_ERROR_MESSAGES 397 diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index 262afc3ce2f..31903a5dfd2 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -223,7 +223,7 @@ drop_user3@localhost, drop_user4@localhost; ERROR HY000: Can't revoke all privileges, grant for one or more of the requested users drop user drop_user1@localhost, drop_user2@localhost, drop_user3@localhost, drop_user4@localhost; -ERROR HY000: Operation DROP USER failed for 4 of the requested users +ERROR HY000: Operation DROP USER failed for 'drop_user1'@'localhost','drop_user2'@'localhost','drop_user3'@'localhost','drop_user4'@'localhost' drop table t1; grant usage on *.* to mysqltest_1@localhost identified by "password"; grant select, update, insert on test.* to mysqltest_1@localhost; diff --git a/mysql-test/r/grant2.result b/mysql-test/r/grant2.result index f2782f6f605..edfd1a07680 100644 --- a/mysql-test/r/grant2.result +++ b/mysql-test/r/grant2.result @@ -66,7 +66,7 @@ create table t1(c1 int); create table t2(c1 int, c2 int); create user 'mysqltest_1'; create user 'mysqltest_1'; -ERROR HY000: Operation CREATE USER failed for 1 of the requested users +ERROR HY000: Operation CREATE USER failed for 'mysqltest_1'@'%' create user 'mysqltest_2' identified by 'Mysqltest-2'; create user 'mysqltest_3' identified by password 'fffffffffffffffffffffffffffffffffffffffff'; grant select on *.* to 'mysqltest_2'; @@ -139,7 +139,7 @@ drop user 'mysqltest_1', 'mysqltest_3'; grant all on test.t1 to 'mysqltest_1'; ERROR 42000: 'root'@'localhost' is not allowed to create new users drop user 'mysqltest_1'; -ERROR HY000: Operation DROP USER failed for 1 of the requested users +ERROR HY000: Operation DROP USER failed for 'mysqltest_1'@'%' drop table t1, t2; insert into mysql.db set user='mysqltest_1', db='%', host='%'; flush privileges; @@ -169,16 +169,16 @@ drop user 'mysqltest_1', 'mysqltest_2', 'mysqltest_3'; create user 'mysqltest_1', 'mysqltest_2' identified by 'Mysqltest-2', 'mysqltest_3' identified by password 'fffffffffffffffffffffffffffffffffffffffff'; rename user 'mysqltest_1' to 'mysqltest_1a', 'mysqltest_2' TO 'mysqltest_2a', 'mysqltest_3' TO 'mysqltest_3a'; drop user 'mysqltest_1', 'mysqltest_2', 'mysqltest_3'; -ERROR HY000: Operation DROP USER failed for 3 of the requested users +ERROR HY000: Operation DROP USER failed for 'mysqltest_1'@'%','mysqltest_2'@'%','mysqltest_3'@'%' drop user 'mysqltest_1a', 'mysqltest_2a', 'mysqltest_3a'; create user 'mysqltest_1', 'mysqltest_2', 'mysqltest_3'; create user 'mysqltest_1a', 'mysqltest_2', 'mysqltest_3a'; -ERROR HY000: Operation CREATE USER failed for 1 of the requested users +ERROR HY000: Operation CREATE USER failed for 'mysqltest_2'@'%' rename user 'mysqltest_1a' to 'mysqltest_1b', 'mysqltest_2a' TO 'mysqltest_2b', 'mysqltest_3a' TO 'mysqltest_3b'; -ERROR HY000: Operation RENAME USER failed for 1 of the requested users +ERROR HY000: Operation RENAME USER failed for 'mysqltest_2a'@'%' drop user 'mysqltest_1', 'mysqltest_2', 'mysqltest_3'; drop user 'mysqltest_1b', 'mysqltest_2b', 'mysqltest_3b'; -ERROR HY000: Operation DROP USER failed for 1 of the requested users +ERROR HY000: Operation DROP USER failed for 'mysqltest_2b'@'%' create user 'mysqltest_2' identified by 'Mysqltest-2'; drop user 'mysqltest_2' identified by 'Mysqltest-2'; ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'identified by 'Mysqltest-2'' at line 1 diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test index c004699d901..eda08ac0cdb 100644 --- a/mysql-test/t/grant.test +++ b/mysql-test/t/grant.test @@ -168,7 +168,7 @@ drop_user4@localhost; --error 1269 revoke all privileges, grant option from drop_user1@localhost, drop_user2@localhost, drop_user3@localhost, drop_user4@localhost; ---error 1268 +--error 1396 drop user drop_user1@localhost, drop_user2@localhost, drop_user3@localhost, drop_user4@localhost; drop table t1; diff --git a/mysql-test/t/grant2.test b/mysql-test/t/grant2.test index 70cec9e0e35..69c42ce2252 100644 --- a/mysql-test/t/grant2.test +++ b/mysql-test/t/grant2.test @@ -91,7 +91,7 @@ create table t2(c1 int, c2 int); # # Three forms of CREATE USER create user 'mysqltest_1'; ---error 1268 +--error 1396 create user 'mysqltest_1'; create user 'mysqltest_2' identified by 'Mysqltest-2'; create user 'mysqltest_3' identified by password 'fffffffffffffffffffffffffffffffffffffffff'; @@ -127,7 +127,7 @@ drop user 'mysqltest_1', 'mysqltest_3'; # Grant must not create user --error 1211 grant all on test.t1 to 'mysqltest_1'; ---error 1268 +--error 1396 drop user 'mysqltest_1'; # # Cleanup @@ -164,18 +164,18 @@ create user 'mysqltest_1', 'mysqltest_2', 'mysqltest_3'; drop user 'mysqltest_1', 'mysqltest_2', 'mysqltest_3'; create user 'mysqltest_1', 'mysqltest_2' identified by 'Mysqltest-2', 'mysqltest_3' identified by password 'fffffffffffffffffffffffffffffffffffffffff'; rename user 'mysqltest_1' to 'mysqltest_1a', 'mysqltest_2' TO 'mysqltest_2a', 'mysqltest_3' TO 'mysqltest_3a'; ---error 1268 +--error 1396 drop user 'mysqltest_1', 'mysqltest_2', 'mysqltest_3'; drop user 'mysqltest_1a', 'mysqltest_2a', 'mysqltest_3a'; # # Let one of multiple users fail create user 'mysqltest_1', 'mysqltest_2', 'mysqltest_3'; ---error 1268 +--error 1396 create user 'mysqltest_1a', 'mysqltest_2', 'mysqltest_3a'; ---error 1268 +--error 1396 rename user 'mysqltest_1a' to 'mysqltest_1b', 'mysqltest_2a' TO 'mysqltest_2b', 'mysqltest_3a' TO 'mysqltest_3b'; drop user 'mysqltest_1', 'mysqltest_2', 'mysqltest_3'; ---error 1268 +--error 1396 drop user 'mysqltest_1b', 'mysqltest_2b', 'mysqltest_3b'; # # Obsolete syntax has been dropped diff --git a/sql/share/czech/errmsg.txt b/sql/share/czech/errmsg.txt index 54d22e62dba..e8ea55f0739 100644 --- a/sql/share/czech/errmsg.txt +++ b/sql/share/czech/errmsg.txt @@ -296,7 +296,7 @@ character-set=latin2 "Data truncated for column '%s' at row %ld", "Using storage engine %s for table '%s'", "Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", -"Operation %s failed for %d of the requested users", +"Cannot drop one or more of the requested users", "Can't revoke all privileges, grant for one or more of the requested users", "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", "Illegal mix of collations for operation '%s'", @@ -424,3 +424,4 @@ character-set=latin2 "Can not modify more than one base table through a join view '%-.64s.%-.64s'" "Can not insert into join view '%-.64s.%-.64s' without fields list" "Can not delete from join view '%-.64s.%-.64s'" +"Operation %s failed for '%.256s'", diff --git a/sql/share/danish/errmsg.txt b/sql/share/danish/errmsg.txt index 7385be9545c..3664e5ba0ef 100644 --- a/sql/share/danish/errmsg.txt +++ b/sql/share/danish/errmsg.txt @@ -287,7 +287,7 @@ character-set=latin1 "Data truncated for column '%s' at row %ld", "Using storage engine %s for table '%s'", "Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", -"Operation %s failed for %d of the requested users", +"Cannot drop one or more of the requested users", "Can't revoke all privileges, grant for one or more of the requested users", "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", "Illegal mix of collations for operation '%s'", @@ -415,3 +415,4 @@ character-set=latin1 "Can not modify more than one base table through a join view '%-.64s.%-.64s'" "Can not insert into join view '%-.64s.%-.64s' without fields list" "Can not delete from join view '%-.64s.%-.64s'" +"Operation %s failed for '%.256s'", diff --git a/sql/share/dutch/errmsg.txt b/sql/share/dutch/errmsg.txt index 7015ed90789..cd71ddc3588 100644 --- a/sql/share/dutch/errmsg.txt +++ b/sql/share/dutch/errmsg.txt @@ -296,7 +296,7 @@ character-set=latin1 "Data truncated for column '%s' at row %ld", "Using storage engine %s for table '%s'", "Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", -"Operation %s failed for %d of the requested users", +"Cannot drop one or more of the requested users", "Can't revoke all privileges, grant for one or more of the requested users", "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", "Illegal mix of collations for operation '%s'", @@ -424,3 +424,4 @@ character-set=latin1 "Can not modify more than one base table through a join view '%-.64s.%-.64s'" "Can not insert into join view '%-.64s.%-.64s' without fields list" "Can not delete from join view '%-.64s.%-.64s'" +"Operation %s failed for '%.256s'", diff --git a/sql/share/english/errmsg.txt b/sql/share/english/errmsg.txt index 54ca033657e..3050f94936f 100644 --- a/sql/share/english/errmsg.txt +++ b/sql/share/english/errmsg.txt @@ -284,7 +284,7 @@ character-set=latin1 "Data truncated for column '%s' at row %ld", "Using storage engine %s for table '%s'", "Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", -"Operation %s failed for %d of the requested users", +"Cannot drop one or more of the requested users", "Can't revoke all privileges, grant for one or more of the requested users", "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", "Illegal mix of collations for operation '%s'", @@ -412,3 +412,4 @@ character-set=latin1 "Can not modify more than one base table through a join view '%-.64s.%-.64s'" "Can not insert into join view '%-.64s.%-.64s' without fields list" "Can not delete from join view '%-.64s.%-.64s'" +"Operation %s failed for %.256s", diff --git a/sql/share/estonian/errmsg.txt b/sql/share/estonian/errmsg.txt index b89ebb42500..58b032ceb14 100644 --- a/sql/share/estonian/errmsg.txt +++ b/sql/share/estonian/errmsg.txt @@ -289,7 +289,7 @@ character-set=latin7 "Data truncated for column '%s' at row %ld", "Using storage engine %s for table '%s'", "Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", -"Operation %s failed for %d of the requested users", +"Cannot drop one or more of the requested users", "Can't revoke all privileges, grant for one or more of the requested users", "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", "Illegal mix of collations for operation '%s'", @@ -417,3 +417,4 @@ character-set=latin7 "Can not modify more than one base table through a join view '%-.64s.%-.64s'" "Can not insert into join view '%-.64s.%-.64s' without fields list" "Can not delete from join view '%-.64s.%-.64s'" +"Operation %s failed for '%.256s'", diff --git a/sql/share/french/errmsg.txt b/sql/share/french/errmsg.txt index 4e370a63099..a93a52606a9 100644 --- a/sql/share/french/errmsg.txt +++ b/sql/share/french/errmsg.txt @@ -284,7 +284,7 @@ character-set=latin1 "Data truncated for column '%s' at row %ld", "Using storage engine %s for table '%s'", "Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", -"Operation %s failed for %d of the requested users", +"Cannot drop one or more of the requested users", "Can't revoke all privileges, grant for one or more of the requested users", "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", "Illegal mix of collations for operation '%s'", @@ -412,3 +412,4 @@ character-set=latin1 "Can not modify more than one base table through a join view '%-.64s.%-.64s'" "Can not insert into join view '%-.64s.%-.64s' without fields list" "Can not delete from join view '%-.64s.%-.64s'" +"Operation %s failed for '%.256s'", diff --git a/sql/share/german/errmsg.txt b/sql/share/german/errmsg.txt index b4afa45ee46..e657f9cb16a 100644 --- a/sql/share/german/errmsg.txt +++ b/sql/share/german/errmsg.txt @@ -297,7 +297,7 @@ character-set=latin1 "Daten abgeschnitten für Spalte '%s' in Zeile %ld", "Für Tabelle '%s' wird Speicher-Engine %s benutzt", "Unerlaubte Vermischung der Kollationen (%s,%s) und (%s,%s) für die Operation '%s'", -"Das Kommando %s scheiterte für %d von den betroffenen Benutzern", +"Kann einen oder mehrere der angegebenen Benutzer nicht löschen", "Kann nicht alle Berechtigungen widerrufen, grant for one or more of the requested users", "Unerlaubte Vermischung der Kollationen (%s,%s), (%s,%s), (%s,%s) für die Operation '%s'", "Unerlaubte Vermischung der Kollationen für die Operation '%s'", @@ -425,3 +425,4 @@ character-set=latin1 "Can not modify more than one base table through a join view '%-.64s.%-.64s'" "Can not insert into join view '%-.64s.%-.64s' without fields list" "Can not delete from join view '%-.64s.%-.64s'" +"Das Kommando %s scheiterte für %.256s", diff --git a/sql/share/greek/errmsg.txt b/sql/share/greek/errmsg.txt index afc91d0c69e..0bfcf513001 100644 --- a/sql/share/greek/errmsg.txt +++ b/sql/share/greek/errmsg.txt @@ -284,7 +284,7 @@ character-set=greek "Data truncated for column '%s' at row %ld", "Using storage engine %s for table '%s'", "Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", -"Operation %s failed for %d of the requested users", +"Cannot drop one or more of the requested users", "Can't revoke all privileges, grant for one or more of the requested users", "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", "Illegal mix of collations for operation '%s'", @@ -412,3 +412,4 @@ character-set=greek "Can not modify more than one base table through a join view '%-.64s.%-.64s'" "Can not insert into join view '%-.64s.%-.64s' without fields list" "Can not delete from join view '%-.64s.%-.64s'" +"Operation %s failed for '%.256s'", diff --git a/sql/share/hungarian/errmsg.txt b/sql/share/hungarian/errmsg.txt index 61c112170b2..51338770817 100644 --- a/sql/share/hungarian/errmsg.txt +++ b/sql/share/hungarian/errmsg.txt @@ -289,7 +289,7 @@ character-set=latin2 "Data truncated for column '%s' at row %ld", "Using storage engine %s for table '%s'", "Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", -"Operation %s failed for %d of the requested users", +"Cannot drop one or more of the requested users", "Can't revoke all privileges, grant for one or more of the requested users", "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", "Illegal mix of collations for operation '%s'", @@ -417,3 +417,4 @@ character-set=latin2 "Can not modify more than one base table through a join view '%-.64s.%-.64s'" "Can not insert into join view '%-.64s.%-.64s' without fields list" "Can not delete from join view '%-.64s.%-.64s'" +"Operation %s failed for '%.256s'", diff --git a/sql/share/italian/errmsg.txt b/sql/share/italian/errmsg.txt index e6a00332093..f7f553c0eca 100644 --- a/sql/share/italian/errmsg.txt +++ b/sql/share/italian/errmsg.txt @@ -284,7 +284,7 @@ character-set=latin1 "Data truncated for column '%s' at row %ld", "Using storage engine %s for table '%s'", "Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", -"Operation %s failed for %d of the requested users", +"Cannot drop one or more of the requested users", "Can't revoke all privileges, grant for one or more of the requested users", "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", "Illegal mix of collations for operation '%s'", @@ -412,3 +412,4 @@ character-set=latin1 "Can not modify more than one base table through a join view '%-.64s.%-.64s'" "Can not insert into join view '%-.64s.%-.64s' without fields list" "Can not delete from join view '%-.64s.%-.64s'" +"Operation %s failed for '%.256s'", diff --git a/sql/share/japanese/errmsg.txt b/sql/share/japanese/errmsg.txt index 98282af52d6..694447caa48 100644 --- a/sql/share/japanese/errmsg.txt +++ b/sql/share/japanese/errmsg.txt @@ -288,7 +288,7 @@ character-set=ujis "Data truncated for column '%s' at row %ld", "Using storage engine %s for table '%s'", "Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", -"Operation %s failed for %d of the requested users", +"Cannot drop one or more of the requested users", "Can't revoke all privileges, grant for one or more of the requested users", "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", "Illegal mix of collations for operation '%s'", @@ -416,3 +416,4 @@ character-set=ujis "Can not modify more than one base table through a join view '%-.64s.%-.64s'" "Can not insert into join view '%-.64s.%-.64s' without fields list" "Can not delete from join view '%-.64s.%-.64s'" +"Operation %s failed for '%.256s'", diff --git a/sql/share/korean/errmsg.txt b/sql/share/korean/errmsg.txt index b10a83beee9..3916b10666d 100644 --- a/sql/share/korean/errmsg.txt +++ b/sql/share/korean/errmsg.txt @@ -284,7 +284,7 @@ character-set=euckr "Data truncated for column '%s' at row %ld", "Using storage engine %s for table '%s'", "Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", -"Operation %s failed for %d of the requested users", +"Cannot drop one or more of the requested users", "Can't revoke all privileges, grant for one or more of the requested users", "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", "Illegal mix of collations for operation '%s'", @@ -412,3 +412,4 @@ character-set=euckr "Can not modify more than one base table through a join view '%-.64s.%-.64s'" "Can not insert into join view '%-.64s.%-.64s' without fields list" "Can not delete from join view '%-.64s.%-.64s'" +"Operation %s failed for '%.256s'", diff --git a/sql/share/norwegian-ny/errmsg.txt b/sql/share/norwegian-ny/errmsg.txt index e5a41b7d3d9..8165dc142fe 100644 --- a/sql/share/norwegian-ny/errmsg.txt +++ b/sql/share/norwegian-ny/errmsg.txt @@ -286,7 +286,7 @@ character-set=latin1 "Data truncated for column '%s' at row %ld", "Using storage engine %s for table '%s'", "Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", -"Operation %s failed for %d of the requested users", +"Cannot drop one or more of the requested users", "Can't revoke all privileges, grant for one or more of the requested users", "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", "Illegal mix of collations for operation '%s'", @@ -414,3 +414,4 @@ character-set=latin1 "Can not modify more than one base table through a join view '%-.64s.%-.64s'" "Can not insert into join view '%-.64s.%-.64s' without fields list" "Can not delete from join view '%-.64s.%-.64s'" +"Operation %s failed for '%.256s'", diff --git a/sql/share/norwegian/errmsg.txt b/sql/share/norwegian/errmsg.txt index 334313c1916..477c527968a 100644 --- a/sql/share/norwegian/errmsg.txt +++ b/sql/share/norwegian/errmsg.txt @@ -286,7 +286,7 @@ character-set=latin1 "Data truncated for column '%s' at row %ld", "Using storage engine %s for table '%s'", "Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", -"Operation %s failed for %d of the requested users", +"Cannot drop one or more of the requested users", "Can't revoke all privileges, grant for one or more of the requested users", "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", "Illegal mix of collations for operation '%s'", @@ -414,3 +414,4 @@ character-set=latin1 "Can not modify more than one base table through a join view '%-.64s.%-.64s'" "Can not insert into join view '%-.64s.%-.64s' without fields list" "Can not delete from join view '%-.64s.%-.64s'" +"Operation %s failed for '%.256s'", diff --git a/sql/share/polish/errmsg.txt b/sql/share/polish/errmsg.txt index 0d8deb30e77..5c56730068d 100644 --- a/sql/share/polish/errmsg.txt +++ b/sql/share/polish/errmsg.txt @@ -289,7 +289,7 @@ character-set=latin2 "Data truncated for column '%s' at row %ld", "Using storage engine %s for table '%s'", "Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", -"Operation %s failed for %d of the requested users", +"Cannot drop one or more of the requested users", "Can't revoke all privileges, grant for one or more of the requested users", "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", "Illegal mix of collations for operation '%s'", @@ -417,3 +417,4 @@ character-set=latin2 "Can not modify more than one base table through a join view '%-.64s.%-.64s'" "Can not insert into join view '%-.64s.%-.64s' without fields list" "Can not delete from join view '%-.64s.%-.64s'" +"Operation %s failed for '%.256s'", diff --git a/sql/share/portuguese/errmsg.txt b/sql/share/portuguese/errmsg.txt index e47a69a5c25..2ccde22a78f 100644 --- a/sql/share/portuguese/errmsg.txt +++ b/sql/share/portuguese/errmsg.txt @@ -286,7 +286,7 @@ character-set=latin1 "Dado truncado para coluna '%s' na linha %ld", "Usando engine de armazenamento %s para tabela '%s'", "Combinação ilegal de collations (%s,%s) e (%s,%s) para operação '%s'", -"Operation %s failed for %d of the requested users", +"Cannot drop one or more of the requested users", "Não pode revocar todos os privilégios, grant para um ou mais dos usuários pedidos", "Ilegal combinação de collations (%s,%s), (%s,%s), (%s,%s) para operação '%s'", "Ilegal combinação de collations para operação '%s'", @@ -414,3 +414,4 @@ character-set=latin1 "Can not modify more than one base table through a join view '%-.64s.%-.64s'" "Can not insert into join view '%-.64s.%-.64s' without fields list" "Can not delete from join view '%-.64s.%-.64s'" +"Operation %s failed for '%.256s'", diff --git a/sql/share/romanian/errmsg.txt b/sql/share/romanian/errmsg.txt index c5a63223c22..2b2f6aa45a8 100644 --- a/sql/share/romanian/errmsg.txt +++ b/sql/share/romanian/errmsg.txt @@ -289,7 +289,7 @@ character-set=latin2 "Data truncated for column '%s' at row %ld", "Using storage engine %s for table '%s'", "Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", -"Operation %s failed for %d of the requested users", +"Cannot drop one or more of the requested users", "Can't revoke all privileges, grant for one or more of the requested users", "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", "Illegal mix of collations for operation '%s'", @@ -417,3 +417,4 @@ character-set=latin2 "Can not modify more than one base table through a join view '%-.64s.%-.64s'" "Can not insert into join view '%-.64s.%-.64s' without fields list" "Can not delete from join view '%-.64s.%-.64s'" +"Operation %s failed for '%.256s'", diff --git a/sql/share/russian/errmsg.txt b/sql/share/russian/errmsg.txt index 04c51d5f532..58301983b25 100644 --- a/sql/share/russian/errmsg.txt +++ b/sql/share/russian/errmsg.txt @@ -289,7 +289,7 @@ character-set=koi8r "Data truncated for column '%s' at row %ld", "Using storage engine %s for table '%s'", "Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", -"Operation %s failed for %d of the requested users", +"Cannot drop one or more of the requested users", "Can't revoke all privileges, grant for one or more of the requested users", "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", "Illegal mix of collations for operation '%s'", @@ -417,3 +417,4 @@ character-set=koi8r "îÅÌØÚÑ ÉÚÍÅÎÉÔØ ÂÏÌØÛÅ ÞÅÍ ÏÄÎÕ ÂÁÚÏ×ÕÀ ÔÁÂÌÉÃÕ ÉÓÐÏÌØÚÕÑ ÍÎÏÇÏÔÁÂÌÉÞÎÙÊ VIEW '%-.64s.%-.64s'" "îÅÌØÚÑ ×ÓÔÁ×ÌÑÔØ ÚÁÐÉÓÉ × ÍÎÏÇÏÔÁÂÌÉÞÎÙÊ VIEW '%-.64s.%-.64s' ÂÅÚ ÓÐÉÓËÁ ÐÏÌÅÊ" "îÅÌØÚÑ ÕÄÁÌÑÔØ ÉÚ ÍÎÏÇÏÔÁÂÌÉÞÎÏÇÏ VIEW '%-.64s.%-.64s'" +"Operation %s failed for '%.256s'", diff --git a/sql/share/serbian/errmsg.txt b/sql/share/serbian/errmsg.txt index f267faeccbd..a245da6b677 100644 --- a/sql/share/serbian/errmsg.txt +++ b/sql/share/serbian/errmsg.txt @@ -277,7 +277,7 @@ character-set=cp1250 "Data truncated for column '%s' at row %ld", "Using storage engine %s for table '%s'", "Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", -"Operation %s failed for %d of the requested users", +"Cannot drop one or more of the requested users", "Can't revoke all privileges, grant for one or more of the requested users", "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", "Illegal mix of collations for operation '%s'", @@ -405,3 +405,4 @@ character-set=cp1250 "Can not modify more than one base table through a join view '%-.64s.%-.64s'" "Can not insert into join view '%-.64s.%-.64s' without fields list" "Can not delete from join view '%-.64s.%-.64s'" +"Operation %s failed for '%.256s'", diff --git a/sql/share/slovak/errmsg.txt b/sql/share/slovak/errmsg.txt index 8b7bb730cf0..69eddcfa9f6 100644 --- a/sql/share/slovak/errmsg.txt +++ b/sql/share/slovak/errmsg.txt @@ -292,7 +292,7 @@ character-set=latin2 "Data truncated for column '%s' at row %ld", "Using storage engine %s for table '%s'", "Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", -"Operation %s failed for %d of the requested users", +"Cannot drop one or more of the requested users", "Can't revoke all privileges, grant for one or more of the requested users", "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", "Illegal mix of collations for operation '%s'", @@ -420,3 +420,4 @@ character-set=latin2 "Can not modify more than one base table through a join view '%-.64s.%-.64s'" "Can not insert into join view '%-.64s.%-.64s' without fields list" "Can not delete from join view '%-.64s.%-.64s'" +"Operation %s failed for '%.256s'", diff --git a/sql/share/spanish/errmsg.txt b/sql/share/spanish/errmsg.txt index c0e663d6484..0eefed18088 100644 --- a/sql/share/spanish/errmsg.txt +++ b/sql/share/spanish/errmsg.txt @@ -288,7 +288,7 @@ character-set=latin1 "Datos truncados para columna '%s' en la línea %ld", "Usando motor de almacenamiento %s para tabla '%s'", "Ilegal mezcla de collations (%s,%s) y (%s,%s) para operación '%s'", -"Operation %s failed for %d of the requested users", +"Cannot drop one or more of the requested users", "No puede revocar todos los privilegios, derecho para uno o mas de los usuarios solicitados", "Ilegal mezcla de collations (%s,%s), (%s,%s), (%s,%s) para operación '%s'", "Ilegal mezcla de collations para operación '%s'", @@ -416,3 +416,4 @@ character-set=latin1 "Can not modify more than one base table through a join view '%-.64s.%-.64s'" "Can not insert into join view '%-.64s.%-.64s' without fields list" "Can not delete from join view '%-.64s.%-.64s'" +"Operation %s failed for '%.256s'", diff --git a/sql/share/swedish/errmsg.txt b/sql/share/swedish/errmsg.txt index 831ccfbe978..be42d3889d0 100644 --- a/sql/share/swedish/errmsg.txt +++ b/sql/share/swedish/errmsg.txt @@ -284,7 +284,7 @@ character-set=latin1 "Data truncated for column '%s' at row %ld", "Använder handler %s för tabell '%s'", "Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", -"Operation %s failed for %d of the requested users", +"Cannot drop one or more of the requested users", "Can't revoke all privileges, grant for one or more of the requested users", "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", "Illegal mix of collations for operation '%s'", @@ -412,3 +412,4 @@ character-set=latin1 "Can not modify more than one base table through a join view '%-.64s.%-.64s'" "Can not insert into join view '%-.64s.%-.64s' without fields list" "Can not delete from join view '%-.64s.%-.64s'" +"Operation %s failed for '%.256s'", diff --git a/sql/share/ukrainian/errmsg.txt b/sql/share/ukrainian/errmsg.txt index 46a0adf922f..6d4c37803c7 100644 --- a/sql/share/ukrainian/errmsg.txt +++ b/sql/share/ukrainian/errmsg.txt @@ -290,7 +290,7 @@ character-set=koi8u "Data truncated for column '%s' at row %ld", "Using storage engine %s for table '%s'", "Illegal mix of collations (%s,%s) and (%s,%s) for operation '%s'", -"Operation %s failed for %d of the requested users", +"Cannot drop one or more of the requested users", "Can't revoke all privileges, grant for one or more of the requested users", "Illegal mix of collations (%s,%s), (%s,%s), (%s,%s) for operation '%s'", "Illegal mix of collations for operation '%s'", @@ -418,3 +418,4 @@ character-set=koi8u "îÅÍÏÖÌÉ×Ï ÏÎÏ×ÉÔÉ Â¦ÌØÛ ÎÉÖ ÏÄÎÕ ÂÁÚÏ×Õ ÔÁÂÌÉÃÀ ×ÙËÏÒÉÓÔÏ×ÕÀÞÉ VIEW '%-.64s.%-.64s', ÝÏ Í¦ÓÔ¦ÔØ ÄÅ˦ÌØËÁ ÔÁÂÌÉÃØ" "îÅÍÏÖÌÉ×Ï ÕÓÔÁ×ÉÔÉ ÒÑÄËÉ Õ VIEW '%-.64s.%-.64s', ÝÏ Í¦ÓÔÉÔØ ÄÅ˦ÌØËÁ ÔÁÂÌÉÃØ, ÂÅÚ ÓÐÉÓËÕ ÓÔÏ×Âæ×" "îÅÍÏÖÌÉ×Ï ×ÉÄÁÌÉÔÉ ÒÑÄËÉ Õ VIEW '%-.64s.%-.64s', ÝÏ Í¦ÓÔÉÔØ ÄÅ˦ÌØËÁ ÔÁÂÌÉÃØ" +"Operation %s failed for '%.256s'", diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index d3bfb5b4d1d..0c6b061aa0c 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -3770,7 +3770,7 @@ static int handle_grant_table(TABLE_LIST *tables, uint table_no, bool drop, const char *user; DBUG_ENTER("handle_grant_table"); - if (! table_no) + if (! table_no) // mysql.user table { /* The 'user' table has an unique index on (host, user). @@ -4119,6 +4119,16 @@ static int handle_grant_data(TABLE_LIST *tables, bool drop, DBUG_RETURN(result); } +static void append_user(String *str, LEX_USER *user) +{ + if (str->length()) + str->append(','); + str->append('\''); + str->append(user->user.str); + str->append("'@'"); + str->append(user->host.str); + str->append('\''); +} /* Create a list of users. @@ -4137,7 +4147,7 @@ bool mysql_create_user(THD *thd, List <LEX_USER> &list) { int result; int found; - uint failures; + String wrong_users; ulong sql_mode; LEX_USER *user_name; List_iterator <LEX_USER> user_list(list); @@ -4151,7 +4161,6 @@ bool mysql_create_user(THD *thd, List <LEX_USER> &list) rw_wrlock(&LOCK_grant); VOID(pthread_mutex_lock(&acl_cache->lock)); - failures= 0; while ((user_name= user_list++)) { /* @@ -4160,20 +4169,16 @@ bool mysql_create_user(THD *thd, List <LEX_USER> &list) */ if ((found= handle_grant_data(tables, 0, user_name, NULL))) { - if (found > 0) - sql_print_error("CREATE USER: Cannot create user: '%s'@'%s': " - "User exists", - user_name->user.str, - user_name->host.str); - failures++; + append_user(&wrong_users, user_name); result= TRUE; + continue; } sql_mode= thd->variables.sql_mode; thd->variables.sql_mode&= ~MODE_NO_AUTO_CREATE_USER; if (replace_user_table(thd, tables[0].table, *user_name, 0, 0, 1)) { - failures++; + append_user(&wrong_users, user_name); result= TRUE; } thd->variables.sql_mode= sql_mode; @@ -4183,7 +4188,7 @@ bool mysql_create_user(THD *thd, List <LEX_USER> &list) rw_unlock(&LOCK_grant); close_thread_tables(thd); if (result) - my_error(ER_HANDLE_USER, MYF(0), "CREATE USER" , failures ); + my_error(ER_CANNOT_USER, MYF(0), "CREATE USER", wrong_users.c_ptr()); DBUG_RETURN(result); } @@ -4205,34 +4210,24 @@ bool mysql_drop_user(THD *thd, List <LEX_USER> &list) { int result; int found; - uint failures; + String wrong_users; LEX_USER *user_name; List_iterator <LEX_USER> user_list(list); TABLE_LIST tables[4]; DBUG_ENTER("mysql_drop_user"); - /* CREATE USER may be skipped on replication client. */ + /* DROP USER may be skipped on replication client. */ if ((result= open_grant_tables(thd, tables))) DBUG_RETURN(result != 1); rw_wrlock(&LOCK_grant); VOID(pthread_mutex_lock(&acl_cache->lock)); - failures= 0; while ((user_name= user_list++)) { - if ((found= handle_grant_data(tables, 1, user_name, NULL)) < 0) - { - failures++; - result= TRUE; - } - else if (! found) + if ((found= handle_grant_data(tables, 1, user_name, NULL)) <= 0) { - sql_print_error("DROP USER: Cannot drop user '%s'@'%s': " - "No such user", - user_name->user.str, - user_name->host.str); - failures++; + append_user(&wrong_users, user_name); result= TRUE; } } @@ -4241,7 +4236,7 @@ bool mysql_drop_user(THD *thd, List <LEX_USER> &list) rw_unlock(&LOCK_grant); close_thread_tables(thd); if (result) - my_error(ER_HANDLE_USER, MYF(0), "DROP USER" , failures ); + my_error(ER_CANNOT_USER, MYF(0), "DROP USER", wrong_users.c_ptr()); DBUG_RETURN(result); } @@ -4263,63 +4258,42 @@ bool mysql_rename_user(THD *thd, List <LEX_USER> &list) { int result= 0; int found; - uint failures; + String wrong_users; LEX_USER *user_from; LEX_USER *user_to; List_iterator <LEX_USER> user_list(list); TABLE_LIST tables[4]; DBUG_ENTER("mysql_rename_user"); - /* CREATE USER may be skipped on replication client. */ + /* RENAME USER may be skipped on replication client. */ if ((result= open_grant_tables(thd, tables))) DBUG_RETURN(result != 1); rw_wrlock(&LOCK_grant); VOID(pthread_mutex_lock(&acl_cache->lock)); - failures= 0; while ((user_from= user_list++)) { user_to= user_list++; - DBUG_ASSERT((user_to)); /* Syntax enforces pairs of users. */ + DBUG_ASSERT(user_to); /* Syntax enforces pairs of users. */ /* Search all in-memory structures and grant tables for a mention of the new user name. */ - if ((found= handle_grant_data(tables, 0, user_to, NULL))) + if (handle_grant_data(tables, 0, user_to, NULL) || + handle_grant_data(tables, 0, user_from, user_to) <= 0) { - if (found > 0) - sql_print_error("RENAME USER: Cannot rename to: '%s'@'%s': User exists", - user_to->user.str, - user_to->host.str); - failures++; + append_user(&wrong_users, user_from); result= TRUE; } - else - { - if ((found= handle_grant_data(tables, 0, user_from, user_to)) < 0) - { - failures++; - result= TRUE; - } - else if (! found) - { - sql_print_error("RENAME USER: Cannot rename user: '%s'@'%s': " - "No such user", - user_from->user.str, - user_from->host.str); - failures++; - result= TRUE; - } - } } VOID(pthread_mutex_unlock(&acl_cache->lock)); rw_unlock(&LOCK_grant); close_thread_tables(thd); if (result) - my_error(ER_HANDLE_USER, MYF(0), "RENAME USER", failures); + my_error(ER_CANNOT_USER, MYF(0), "RENAME USER", wrong_users.c_ptr()); DBUG_RETURN(result); } @@ -4382,13 +4356,13 @@ bool mysql_revoke_all(THD *thd, List <LEX_USER> &list) for (counter= 0, revoked= 0 ; counter < acl_dbs.elements ; ) { const char *user,*host; - + acl_db=dynamic_element(&acl_dbs,counter,ACL_DB*); if (!(user=acl_db->user)) user= ""; if (!(host=acl_db->host.hostname)) host= ""; - + if (!strcmp(lex_user->user.str,user) && !my_strcasecmp(system_charset_info, lex_user->host.str, host)) { @@ -4419,7 +4393,7 @@ bool mysql_revoke_all(THD *thd, List <LEX_USER> &list) user= ""; if (!(host=grant_table->host)) host= ""; - + if (!strcmp(lex_user->user.str,user) && !my_strcasecmp(system_charset_info, lex_user->host.str, host)) { @@ -4454,14 +4428,14 @@ bool mysql_revoke_all(THD *thd, List <LEX_USER> &list) } } while (revoked); } - + VOID(pthread_mutex_unlock(&acl_cache->lock)); rw_unlock(&LOCK_grant); close_thread_tables(thd); - + if (result) my_message(ER_REVOKE_GRANTS, ER(ER_REVOKE_GRANTS), MYF(0)); - + DBUG_RETURN(result); } |