mirror of
https://github.com/MariaDB/server.git
synced 2026-05-07 07:35:32 +02:00
Bug #57663 Concurrent statement using stored function and DROP DATABASE
breaks SBR The problem was that DROP DATABASE ignored any metadata locks on stored functions and procedures held by other connections. This made it possible for DROP DATABASE to drop functions/procedures that were in use by other connections and therefore break statement based replication. (DROP DATABASE could appear in the binlog before a statement using a dropped function/procedure.) This problem was an issue left unresolved by the patch for Bug#30977 where metadata locks for stored functions/procedures were introduced. This patch fixes the problem by making sure DROP DATABASE takes exclusive metadata locks on all stored functions/procedures to be dropped. Test case added to sp-lock.test.
This commit is contained in:
parent
0ef8d8e26c
commit
1e9f239e8f
5 changed files with 496 additions and 131 deletions
12
sql/sp.h
12
sql/sp.h
|
|
@ -84,6 +84,18 @@ enum
|
|||
int
|
||||
sp_drop_db_routines(THD *thd, char *db);
|
||||
|
||||
/**
|
||||
Acquires exclusive metadata lock on all stored routines in the
|
||||
given database.
|
||||
|
||||
@param thd Thread handler
|
||||
@param db Database name
|
||||
|
||||
@retval false Success
|
||||
@retval true Failure
|
||||
*/
|
||||
bool lock_db_routines(THD *thd, char *db);
|
||||
|
||||
sp_head *
|
||||
sp_find_routine(THD *thd, int type, sp_name *name,
|
||||
sp_cache **cp, bool cache_only);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue