summaryrefslogtreecommitdiff
path: root/storage/heap
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2020-08-01 13:19:59 +0200
committerSergei Golubchik <serg@mariadb.org>2020-10-23 13:37:26 +0200
commit641f81baf45212569ec8a98072d62fd29e3fc8f0 (patch)
treecb0caf222fef7609752e3306286fddc29f20f53c /storage/heap
parent5a9484b78438775f431601a1fc2b302e01e35882 (diff)
downloadmariadb-git-641f81baf45212569ec8a98072d62fd29e3fc8f0.tar.gz
cleanup: use my_multi_malloc(), etc
Diffstat (limited to 'storage/heap')
-rw-r--r--storage/heap/ha_heap.cc25
1 files changed, 10 insertions, 15 deletions
diff --git a/storage/heap/ha_heap.cc b/storage/heap/ha_heap.cc
index 2ffe2da06b2..396887df1b1 100644
--- a/storage/heap/ha_heap.cc
+++ b/storage/heap/ha_heap.cc
@@ -26,12 +26,8 @@
#include "ha_heap.h"
#include "sql_base.h" // enum_tdc_remove_table_type
-static handler *heap_create_handler(handlerton *hton,
- TABLE_SHARE *table,
- MEM_ROOT *mem_root);
-static int
-heap_prepare_hp_create_info(TABLE *table_arg, bool internal_table,
- HP_CREATE_INFO *hp_create_info);
+static handler *heap_create_handler(handlerton *, TABLE_SHARE *, MEM_ROOT *);
+static int heap_prepare_hp_create_info(TABLE *, bool, HP_CREATE_INFO *);
int heap_panic(handlerton *hton, ha_panic_function flag)
@@ -603,16 +599,15 @@ ha_rows ha_heap::records_in_range(uint inx, key_range *min_key,
}
-static int
-heap_prepare_hp_create_info(TABLE *table_arg, bool internal_table,
- HP_CREATE_INFO *hp_create_info)
+static int heap_prepare_hp_create_info(TABLE *table_arg, bool internal_table,
+ HP_CREATE_INFO *hp_create_info)
{
- uint key, parts, mem_per_row= 0, keys= table_arg->s->keys;
+ TABLE_SHARE *share= table_arg->s;
+ uint key, parts, mem_per_row= 0, keys= share->keys;
uint auto_key= 0, auto_key_type= 0;
ha_rows max_rows;
HP_KEYDEF *keydef;
HA_KEYSEG *seg;
- TABLE_SHARE *share= table_arg->s;
bool found_real_auto_increment= 0;
bzero(hp_create_info, sizeof(*hp_create_info));
@@ -620,11 +615,11 @@ heap_prepare_hp_create_info(TABLE *table_arg, bool internal_table,
for (key= parts= 0; key < keys; key++)
parts+= table_arg->key_info[key].user_defined_key_parts;
- if (!(keydef= (HP_KEYDEF*) my_malloc(keys * sizeof(HP_KEYDEF) +
- parts * sizeof(HA_KEYSEG),
- MYF(MY_WME | MY_THREAD_SPECIFIC))))
+ if (!my_multi_malloc(MYF(MY_WME | MY_THREAD_SPECIFIC),
+ &keydef, keys * sizeof(HP_KEYDEF),
+ &seg, parts * sizeof(HA_KEYSEG),
+ NULL))
return my_errno;
- seg= reinterpret_cast<HA_KEYSEG*>(keydef + keys);
for (key= 0; key < keys; key++)
{
KEY *pos= table_arg->key_info+key;