diff options
Diffstat (limited to 'sql/events.cc')
-rw-r--r-- | sql/events.cc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sql/events.cc b/sql/events.cc index 33ddcdac3cb..9f0aef885df 100644 --- a/sql/events.cc +++ b/sql/events.cc @@ -662,8 +662,16 @@ Events::drop_schema_events(THD *thd, const char *db) */ if (event_queue) event_queue->drop_schema_events(thd, &db_lex); - db_repository->drop_schema_events(thd, &db_lex); - + if (db_repository) + db_repository->drop_schema_events(thd, &db_lex); + else + { + if ((db_repository= new Event_db_repository)) + { + db_repository->drop_schema_events(thd, &db_lex); + delete db_repository; + } + } DBUG_VOID_RETURN; } |