summaryrefslogtreecommitdiff
path: root/sql/sql_acl.cc
diff options
context:
space:
mode:
authorunknown <monty@tramp.mysql.fi>2000-10-06 21:15:03 +0300
committerunknown <monty@tramp.mysql.fi>2000-10-06 21:15:03 +0300
commit6991b70c87163d3cb3477a19a947b07cbfec9660 (patch)
tree8ebcaf3db2393c7d413acc624301ee8971a5666e /sql/sql_acl.cc
parent295c3d1fa9a1950d1ebf6832da896e36f483d692 (diff)
downloadmariadb-git-6991b70c87163d3cb3477a19a947b07cbfec9660.tar.gz
DISTINCT optimization
Fixes when using column privileges Manual updates Docs/manual.texi: Comments from MySQL training + distinct optimization extra/my_print_defaults.c: Added --defaults-extra-file include/my_sys.h: Added --defaults-extra-file mysys/default.c: Added --defaults-extra-file sql/sql_acl.cc: Tables with only column privileges didn't show up in SHOW GRANTS or SHOW TABLES sql/sql_select.cc: DISTINCT optimization sql/sql_select.h: DISTINCT optimization BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted
Diffstat (limited to 'sql/sql_acl.cc')
-rw-r--r--sql/sql_acl.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index f103fce1ad9..85d57914c78 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -2004,6 +2004,8 @@ bool check_grant(THD *thd, uint want_access, TABLE_LIST *tables,
want_access &= ~table->grant.privilege;
goto err; // No grants
}
+ if (show_table)
+ continue; // We have some priv on this
table->grant.grant_table=grant_table; // Remember for column test
table->grant.version=grant_version;
@@ -2013,8 +2015,6 @@ bool check_grant(THD *thd, uint want_access, TABLE_LIST *tables,
if (!(~table->grant.privilege & want_access))
continue;
- if (show_table && table->grant.privilege)
- continue; // Test from show tables
if (want_access & ~(grant_table->cols | table->grant.privilege))
{
@@ -2457,18 +2457,18 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user)
!strcmp(lex_user->host.str,host))
{
want_access=grant_table->privs;
- if (want_access)
+ if ((want_access | grant_table->cols) != 0)
{
String global(buff,sizeof(buff));
global.length(0);
global.append("GRANT ",6);
- if (test_all_bits(want_access,(TABLE_ACLS & ~GRANT_ACL)))
+ if (test_all_bits(grant_table->privs,(TABLE_ACLS & ~GRANT_ACL)))
global.append("ALL PRIVILEGES",14);
else
{
int found=0;
- uint j,test_access= want_access & ~GRANT_ACL;
+ uint j,test_access= (want_access | grant_table->cols) & ~GRANT_ACL;
for (counter=0, j = SELECT_ACL;j <= TABLE_ACLS; counter++,j <<= 1)
{