diff options
author | Sergei Golubchik <serg@mariadb.org> | 2020-06-14 11:48:50 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2020-07-04 01:44:46 +0200 |
commit | b014720b6c05c8f8c08ffad263aff3273ff3d253 (patch) | |
tree | 79403ae2af98a242db7612e32f7eb11e2e17a4a2 /storage/heap | |
parent | c55c292832e2776d37e06c43174ac006e00143a2 (diff) | |
download | mariadb-git-b014720b6c05c8f8c08ffad263aff3273ff3d253.tar.gz |
optimization: use hton->drop_table in few simple cases
Diffstat (limited to 'storage/heap')
-rw-r--r-- | storage/heap/ha_heap.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/storage/heap/ha_heap.cc b/storage/heap/ha_heap.cc index f195264ce7f..0e61bff1d8d 100644 --- a/storage/heap/ha_heap.cc +++ b/storage/heap/ha_heap.cc @@ -34,12 +34,18 @@ heap_prepare_hp_create_info(TABLE *table_arg, bool internal_table, HP_CREATE_INFO *hp_create_info); -int heap_panic(handlerton *hton, ha_panic_function flag) +static int heap_panic(handlerton *hton, ha_panic_function flag) { return hp_panic(flag); } +static int heap_drop_table(handlerton *hton, const char *path) +{ + int error= heap_delete_table(path); + return error == ENOENT ? 0 : error; +} + int heap_init(void *p) { handlerton *heap_hton; @@ -50,6 +56,7 @@ int heap_init(void *p) heap_hton->db_type= DB_TYPE_HEAP; heap_hton->create= heap_create_handler; heap_hton->panic= heap_panic; + heap_hton->drop_table= heap_drop_table; heap_hton->flags= HTON_CAN_RECREATE; return 0; @@ -559,8 +566,7 @@ THR_LOCK_DATA **ha_heap::store_lock(THD *thd, int ha_heap::delete_table(const char *name) { - int error= heap_delete_table(name); - return error == ENOENT ? 0 : error; + return heap_drop_table(0, name); } |