diff options
author | unknown <acurtis@pcgem.rdg.cyberkinetica.com> | 2004-11-11 20:59:03 +0000 |
---|---|---|
committer | unknown <acurtis@pcgem.rdg.cyberkinetica.com> | 2004-11-11 20:59:03 +0000 |
commit | f24859396b79e21708a5738e3aadb4ee2514aba8 (patch) | |
tree | c37d7b3a31396a4b126d68d427e3297722413a48 /sql/sql_acl.cc | |
parent | d88afb84c628ab66156ff15fa91a29957621c6f6 (diff) | |
download | mariadb-git-f24859396b79e21708a5738e3aadb4ee2514aba8.tar.gz |
Bug#6123 - GRANT USAGE creates useless mysql.db row
Prevent creation of a row which grants no rights
Test included
mysql-test/r/grant.result:
Test for Bug#6123
mysql-test/t/grant.test:
Test for Bug#6123
sql/sql_acl.cc:
Bug#6123
Prevent creation of useless row
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r-- | sql/sql_acl.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index b3bc5a1e4f2..67ca62357ec 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -1587,7 +1587,7 @@ static int replace_db_table(TABLE *table, const char *db, goto table_error; /* purecov: deadcode */ } } - else if ((error=table->file->write_row(table->record[0]))) + else if (rights && (error=table->file->write_row(table->record[0]))) { if (error && error != HA_ERR_FOUND_DUPP_KEY) /* purecov: inspected */ goto table_error; /* purecov: deadcode */ @@ -1597,6 +1597,7 @@ static int replace_db_table(TABLE *table, const char *db, if (old_row_exists) acl_update_db(combo.user.str,combo.host.str,db,rights); else + if (rights) acl_insert_db(combo.user.str,combo.host.str,db,rights); table->file->index_end(); DBUG_RETURN(0); |