diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index aefcd135dd8..39214348244 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -1219,6 +1219,7 @@ parent child 1 2 1 3 2 1 +drop table t1; create table t1 (a int not null auto_increment primary key, b int, c int, key(c)) type=innodb; create table t2 (a int not null auto_increment primary key, b int); insert into t1 (b) values (null),(null),(null),(null),(null),(null),(null); diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index 393112beb27..4fb9351020e 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -809,7 +809,7 @@ drop table t1,t2; create table t1 ( pk int primary key, parent int not null, child int not null, index (parent) ) type = innodb; insert into t1 values (1,0,4), (2,1,3), (3,2,1), (4,1,2); select distinct parent,child from t1 order by parent; -drop table t1,t2; +drop table t1; # # Test that MySQL priorities clustered indexes diff --git a/sql/sql_base.cc b/sql/sql_base.cc index e27ccf55543..d01dc50cf9d 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1984,7 +1984,8 @@ insert_fields(THD *thd,TABLE_LIST *tables, const char *db_name, (!db_name || !strcmp(tables->db,db_name)))) { /* Ensure that we have access right to all columns */ - if (grant_option && !thd->master_access && + if (grant_option && !((thd->master_access | table->grant.privilege) & + table->grant.want_privilege) && check_grant_all_columns(thd,SELECT_ACL,table) ) DBUG_RETURN(-1); Field **ptr=table->field,*field;