summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/r/grant.result5
-rw-r--r--mysql-test/t/grant.test3
-rw-r--r--sql/item.cc2
-rw-r--r--sql/sql_acl.cc2
4 files changed, 11 insertions, 1 deletions
diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result
index 32edf874400..c1dcd5c29e9 100644
--- a/mysql-test/r/grant.result
+++ b/mysql-test/r/grant.result
@@ -64,3 +64,8 @@ GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, CREATE TE
revoke all privileges on mysqltest.* from mysqltest_1@localhost;
delete from mysql.user where user='mysqltest_1';
flush privileges;
+grant usage on test.* to user@localhost with grant option;
+show grants for user@localhost;
+Grants for user@localhost
+GRANT USAGE ON *.* TO 'user'@'localhost'
+GRANT USAGE ON `test`.* TO 'user'@'localhost' WITH GRANT OPTION
diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test
index 7ee3b08cc3b..bd04b2e4c41 100644
--- a/mysql-test/t/grant.test
+++ b/mysql-test/t/grant.test
@@ -39,3 +39,6 @@ show grants for mysqltest_1@localhost;
revoke all privileges on mysqltest.* from mysqltest_1@localhost;
delete from mysql.user where user='mysqltest_1';
flush privileges;
+grant usage on test.* to user@localhost with grant option;
+show grants for user@localhost;
+
diff --git a/sql/item.cc b/sql/item.cc
index ec9b07c443c..03b6585f6f0 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -505,7 +505,7 @@ bool Item::save_in_field(Field *field, bool no_conversions)
{
double nr=val();
if (null_value)
- return set_field_to_null(field);
+ return set_field_to_null_with_conversions(field, no_conversions);
field->set_notnull();
field->store(nr);
}
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 0d434c38e3a..a9bb22fb8f7 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -2894,6 +2894,8 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
if (test_all_bits(want_access,(DB_ACLS & ~GRANT_ACL)))
db.append("ALL PRIVILEGES",14);
+ else if (!(want_access & ~GRANT_ACL))
+ db.append("USAGE",5);
else
{
int found=0, cnt;