16
16
/* open a isam-database */
18
18
#include "myisamdef.h"
19
#include <mystrings/m_ctype.h>
20
#include <mystrings/m_string.h>
21
#include <drizzled/util/test.h>
23
20
#include <string.h>
24
21
#include <algorithm>
23
#include "mystrings/m_ctype.h"
24
#include "mystrings/m_string.h"
25
#include "drizzled/util/test.h"
26
#include "drizzled/memory/multi_malloc.h"
26
29
using namespace std;
28
31
static void setup_key_functions(MI_KEYDEF *keyinfo);
222
225
/* Add space for node pointer */
223
226
share->base.max_key_length+= share->base.key_reflength;
225
if (!my_multi_malloc(MY_WME,
226
&share,sizeof(*share),
227
&share->state.rec_per_key_part,sizeof(long)*key_parts,
228
&share->keyinfo,keys*sizeof(MI_KEYDEF),
229
&share->uniqueinfo,uniques*sizeof(MI_UNIQUEDEF),
231
(key_parts+unique_key_parts+keys+uniques) *
234
(share->base.fields+1)*sizeof(MI_COLUMNDEF),
235
&share->blobs,sizeof(MI_BLOB)*share->base.blobs,
236
&share->unique_file_name,strlen(name_buff)+1,
237
&share->index_file_name,strlen(index_name)+1,
238
&share->data_file_name,strlen(data_name)+1,
239
&share->state.key_root,keys*sizeof(my_off_t),
240
&share->state.key_del,
241
(share->state.header.max_block_size_index*sizeof(my_off_t)),
242
&share->key_root_lock,sizeof(pthread_rwlock_t)*keys,
243
&share->mmap_lock,sizeof(pthread_rwlock_t),
228
if (!drizzled::memory::multi_malloc(false,
229
&share,sizeof(*share),
230
&share->state.rec_per_key_part,sizeof(long)*key_parts,
231
&share->keyinfo,keys*sizeof(MI_KEYDEF),
232
&share->uniqueinfo,uniques*sizeof(MI_UNIQUEDEF),
234
(key_parts+unique_key_parts+keys+uniques) * sizeof(HA_KEYSEG),
235
&share->rec, (share->base.fields+1)*sizeof(MI_COLUMNDEF),
236
&share->blobs,sizeof(MI_BLOB)*share->base.blobs,
237
&share->unique_file_name,strlen(name_buff)+1,
238
&share->index_file_name,strlen(index_name)+1,
239
&share->data_file_name,strlen(data_name)+1,
240
&share->state.key_root,keys*sizeof(uint64_t),
241
&share->state.key_del,
242
(share->state.header.max_block_size_index*sizeof(uint64_t)),
243
&share->key_root_lock,sizeof(pthread_rwlock_t)*keys,
244
&share->mmap_lock,sizeof(pthread_rwlock_t),
247
248
*share=share_buff;
427
428
/* alloc and set up private structure parts */
428
if (!my_multi_malloc(MY_WME,
429
&m_info,sizeof(MI_INFO),
430
&info.blobs,sizeof(MI_BLOB)*share->base.blobs,
431
&info.buff,(share->base.max_key_block_length*2+
432
share->base.max_key_length),
433
&info.lastkey,share->base.max_key_length*3+1,
434
&info.first_mbr_key, share->base.max_key_length,
435
&info.filename,strlen(name)+1,
436
&info.rtree_recursion_state,have_rtree ? 1024 : 0,
429
if (!drizzled::memory::multi_malloc(MY_WME,
430
&m_info,sizeof(MI_INFO),
431
&info.blobs,sizeof(MI_BLOB)*share->base.blobs,
432
&info.buff,(share->base.max_key_block_length*2+
433
share->base.max_key_length),
434
&info.lastkey,share->base.max_key_length*3+1,
435
&info.first_mbr_key, share->base.max_key_length,
436
&info.filename,strlen(name)+1,
437
&info.rtree_recursion_state,have_rtree ? 1024 : 0,