From 7d4477f866d26b8bd8e941e6484d843cc30c83c8 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 24 Jan 2007 16:45:30 +0300 Subject: [PATCH] Added a test case for bug #6774 "Replication fails with Wrong usage of DB GRANT and GLOBAL PRIVILEGES" --- mysql-test/r/grant.result | 2 ++ mysql-test/t/grant.test | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result index 2f417a41652..d63e4181026 100644 --- a/mysql-test/r/grant.result +++ b/mysql-test/r/grant.result @@ -970,4 +970,6 @@ REVOKE EXECUTE ON PROCEDURE p1 FROM 1234567890abcdefGHIKL@localhost; ERROR HY000: String '1234567890abcdefGHIKL' is too long for user name (should be no longer than 16) REVOKE EXECUTE ON PROCEDURE t1 FROM some_user_name@1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY; ERROR HY000: String '1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY' is too long for host name (should be no longer than 60) +GRANT PROCESS ON * TO user@localhost; +ERROR 3D000: No database selected End of 5.0 tests diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test index 2f5e3dced22..82bf011d32f 100644 --- a/mysql-test/t/grant.test +++ b/mysql-test/t/grant.test @@ -863,4 +863,16 @@ REVOKE EXECUTE ON PROCEDURE p1 FROM 1234567890abcdefGHIKL@localhost; --error ER_WRONG_STRING_LENGTH REVOKE EXECUTE ON PROCEDURE t1 FROM some_user_name@1234567890abcdefghij1234567890abcdefghij1234567890abcdefghijQWERTY; + +# +# Bug #6774: Replication fails with Wrong usage of DB GRANT and GLOBAL PRIVILEGES +# +# Check if GRANT ... ON * ... fails when no database is selected +connect (con1, localhost, root,,*NO-ONE*) +connection con1; +--error ER_NO_DB_ERROR +GRANT PROCESS ON * TO user@localhost; +disconnect con1; +connection default; + --echo End of 5.0 tests