diff options
author | unknown <monty@mashka.mysql.fi> | 2003-09-09 20:06:50 +0300 |
---|---|---|
committer | unknown <monty@mashka.mysql.fi> | 2003-09-09 20:06:50 +0300 |
commit | 8272be9412ecf6566192260df7217a1bec7ffc99 (patch) | |
tree | c28d739cb848970b4758a26b83c985732b379552 /sql | |
parent | 13f0dc32f46da723d6f5e6e8149392975afbff90 (diff) | |
download | mariadb-git-8272be9412ecf6566192260df7217a1bec7ffc99.tar.gz |
Cleaned up last bug fixes
Fix bug in SHOW GRANTS when there is a column privilege but no table privilege
include/mysql.h:
Make server_inited external
libmysqld/libmysqld.c:
Remove reference to (wrong) external variable
mysql-test/r/grant.result:
Fixed up grant test to not user 'user1' or 'user2'
Check for bug in SHOW GRANTS when there is a column privilege but no table privilege
mysql-test/r/mix_innodb_myisam_binlog.result:
Change to use tables t1 and t2
mysql-test/t/grant.test:
Fixed up grant test to not user 'user1' or 'user2'
Check for bug in SHOW GRANTS when there is a column privilege but no table privilege
mysql-test/t/mix_innodb_myisam_binlog.test:
Change to use tables t1 and t2
sql/sql_acl.cc:
Fix bug in SHOW GRANTS when there is a column privilege but no table privilege
sql/sql_parse.cc:
Use HAVE_REPLICATION instead of EMBEDDED_LIBRARY
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_acl.cc | 6 | ||||
-rw-r--r-- | sql/sql_parse.cc | 12 |
2 files changed, 10 insertions, 8 deletions
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index b76bbe8c730..0dbbb1cee70 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -3091,17 +3091,19 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user) if ((table_access | grant_table->cols) != 0) { String global(buff,sizeof(buff)); + ulong test_access= (table_access | grant_table->cols) & ~GRANT_ACL; + global.length(0); global.append("GRANT ",6); if (test_all_bits(table_access, (TABLE_ACLS & ~GRANT_ACL))) global.append("ALL PRIVILEGES",14); - else if (!(table_access & ~GRANT_ACL)) + else if (!test_access) global.append("USAGE",5); else { int found= 0; - ulong j,test_access= (table_access | grant_table->cols) & ~GRANT_ACL; + ulong j; for (counter= 0, j= SELECT_ACL; j <= TABLE_ACLS; counter++, j<<= 1) { diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 4482342f4ce..4d010ac9a4b 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1500,7 +1500,7 @@ mysql_execute_command(void) break; } -#ifndef EMBEDDED_LIBRARY +#ifdef HAVE_REPLICATION case SQLCOM_CHANGE_MASTER: { if (check_global_access(thd, SUPER_ACL)) @@ -1538,7 +1538,7 @@ mysql_execute_command(void) res = load_master_data(thd); break; -#endif /*!EMBEDDED_LIBRARY*/ +#endif /* HAVE_REPLICATION */ #ifdef HAVE_INNOBASE_DB case SQLCOM_SHOW_INNODB_STATUS: @@ -1550,7 +1550,7 @@ mysql_execute_command(void) } #endif -#ifndef EMBEDDED_LIBRARY +#ifdef HAVE_REPLICATION case SQLCOM_LOAD_MASTER_TABLE: { if (!tables->db) @@ -1577,7 +1577,7 @@ mysql_execute_command(void) UNLOCK_ACTIVE_MI; break; } -#endif /*!EMBEDDED_LIBRARY*/ +#endif /* HAVE_REPLICATION */ case SQLCOM_CREATE_TABLE: { @@ -1683,7 +1683,7 @@ mysql_execute_command(void) res = mysql_create_index(thd, tables, lex->key_list); break; -#ifndef EMBEDDED_LIBRARY +#ifdef HAVE_REPLICATION case SQLCOM_SLAVE_START: { LOCK_ACTIVE_MI; @@ -1716,7 +1716,7 @@ mysql_execute_command(void) UNLOCK_ACTIVE_MI; break; } -#endif /*!EMBEDDED_LIBRARY*/ +#endif /* HAVE_REPLICATION */ case SQLCOM_ALTER_TABLE: #if defined(DONT_ALLOW_SHOW_COMMANDS) |