summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <jimw@mysql.com>2006-04-11 12:06:49 -0700
committerunknown <jimw@mysql.com>2006-04-11 12:06:49 -0700
commit16002370c62a5576f7fccb66cdfeaac7957f8090 (patch)
treed282df9998c8576da9d8f79aa0df7d2b96f4649e /sql
parent0d310faac286592c0eb32fe403325bc096a572a9 (diff)
parent870157e9feebfa91c8a2859fd0a730c1802856d1 (diff)
downloadmariadb-git-16002370c62a5576f7fccb66cdfeaac7957f8090.tar.gz
Merge mysql.com:/home/jimw/my/mysql-5.1-17139
into mysql.com:/home/jimw/my/mysql-5.1-clean sql/sql_parse.cc: Auto merged
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_parse.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 51d3cbbd41d..ee0120092a2 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -2991,6 +2991,11 @@ end_with_restore_list:
#else
{
ulong priv=0;
+ ulong priv_needed= ALTER_ACL;
+ /* We also require DROP priv for ALTER TABLE ... DROP PARTITION */
+ if (lex->alter_info.flags & ALTER_DROP_PARTITION)
+ priv_needed|= DROP_ACL;
+
if (lex->name && (!lex->name[0] || strlen(lex->name) > NAME_LEN))
{
my_error(ER_WRONG_TABLE_NAME, MYF(0), lex->name);
@@ -3015,7 +3020,7 @@ end_with_restore_list:
else
select_lex->db= first_table->db;
}
- if (check_access(thd, ALTER_ACL, first_table->db,
+ if (check_access(thd, priv_needed, first_table->db,
&first_table->grant.privilege, 0, 0,
test(first_table->schema_table)) ||
check_access(thd,INSERT_ACL | CREATE_ACL,select_lex->db,&priv,0,0,
@@ -3026,7 +3031,7 @@ end_with_restore_list:
goto error; /* purecov: inspected */
if (grant_option)
{
- if (check_grant(thd, ALTER_ACL, all_tables, 0, UINT_MAX, 0))
+ if (check_grant(thd, priv_needed, all_tables, 0, UINT_MAX, 0))
goto error;
if (lex->name && !test_all_bits(priv,INSERT_ACL | CREATE_ACL))
{ // Rename of table