WL#1366: Use the schema (db) associated with an SP.

Phase 4 (final): Remove associated stored procedures when a database is dropped.


mysql-test/r/sp-security.result:
  drop database now deletes associated SPs.
mysql-test/r/sp.result:
  drop database now deletes associated SPs.
mysql-test/t/sp-security.test:
  drop database now deletes associated SPs.
mysql-test/t/sp.test:
  drop database now deletes associated SPs.
sql/sp.cc:
  New function for deleting all SPs associated with a database.
sql/sp.h:
  New function for deleting all SPs associated with a database.
sql/sp_cache.cc:
  New function for just invalidating all SP caches (when dropping a database).
sql/sp_cache.h:
  New function for just invalidating all SP caches (when dropping a database).
sql/sql_db.cc:
  When dropping a database, also delete all associated SPs.
This commit is contained in:
unknown 2004-03-22 14:44:41 +01:00
commit 645d19f694
9 changed files with 134 additions and 8 deletions

View file

@ -115,6 +115,13 @@ sp_cache_remove(sp_cache **cp, sp_name *name)
return found;
}
void
sp_cache_invalidate()
{
pthread_mutex_lock(&Cversion_lock); // LOCK
Cversion++;
pthread_mutex_unlock(&Cversion_lock); // UNLOCK
}
static byte *
hash_get_key_for_sp_head(const byte *ptr, uint *plen,