Do handler specific drop-database at safe place.
Fix for access problem (merge from 4.0) sql/sql_db.cc: Do handler specific drop-database at safe place. sql/sql_parse.cc: Fix for access problem (merge from 4.0)
This commit is contained in:
parent
9ae7aad20f
commit
765519dbcf
@ -166,6 +166,7 @@ void mysql_rm_db(THD *thd,char *db,bool if_exists)
|
|||||||
|
|
||||||
if ((deleted=mysql_rm_known_files(thd, dirp, path,0)) >= 0)
|
if ((deleted=mysql_rm_known_files(thd, dirp, path,0)) >= 0)
|
||||||
{
|
{
|
||||||
|
ha_drop_database(path);
|
||||||
if (!thd->query)
|
if (!thd->query)
|
||||||
{
|
{
|
||||||
thd->query = path;
|
thd->query = path;
|
||||||
@ -189,14 +190,6 @@ void mysql_rm_db(THD *thd,char *db,bool if_exists)
|
|||||||
exit:
|
exit:
|
||||||
VOID(pthread_mutex_unlock(&LOCK_open));
|
VOID(pthread_mutex_unlock(&LOCK_open));
|
||||||
VOID(pthread_mutex_unlock(&LOCK_mysql_create_db));
|
VOID(pthread_mutex_unlock(&LOCK_mysql_create_db));
|
||||||
|
|
||||||
/* It seems MySQL may call this function when there still are queries
|
|
||||||
running on tables of the database. Since InnoDB waits until the
|
|
||||||
queries have ended, we have to call ha_drop_database outside
|
|
||||||
the above two mutexes to avoid deadlocks. */
|
|
||||||
|
|
||||||
ha_drop_database(path);
|
|
||||||
|
|
||||||
DBUG_VOID_RETURN;
|
DBUG_VOID_RETURN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2154,7 +2154,8 @@ check_access(THD *thd,uint want_access,const char *db, uint *save_priv,
|
|||||||
thd->priv_user, db); /* purecov: inspected */
|
thd->priv_user, db); /* purecov: inspected */
|
||||||
else
|
else
|
||||||
db_access=thd->db_access;
|
db_access=thd->db_access;
|
||||||
want_access &= ~EXTRA_ACL; // Remove SHOW attribute
|
// Remove SHOW attribute and access rights we already have
|
||||||
|
want_access &= ~(thd->master_access | EXTRA_ACL);
|
||||||
db_access= ((*save_priv=(db_access | thd->master_access)) & want_access);
|
db_access= ((*save_priv=(db_access | thd->master_access)) & want_access);
|
||||||
|
|
||||||
/* grant_option is set if there exists a single table or column grant */
|
/* grant_option is set if there exists a single table or column grant */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user