~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/dict/dict0mem.c

  • Committer: Andrew Hutchings
  • Date: 2010-12-15 18:59:55 UTC
  • mto: This revision was merged to the branch mainline in revision 2006.
  • Revision ID: andrew@linuxjedi.co.uk-20101215185955-q12lkja8hdnpjqg7
Make the test look for drizzleadmin failure instead of success as this test is not possible to fix for success on our FreeBSD 8.0 box

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
2
 
3
 
Copyright (C) 1996, 2010, Innobase Oy. All Rights Reserved.
 
3
Copyright (c) 1996, 2010, Innobase Oy. All Rights Reserved.
4
4
 
5
5
This program is free software; you can redistribute it and/or modify it under
6
6
the terms of the GNU General Public License as published by the Free Software
64
64
        mem_heap_t*     heap;
65
65
 
66
66
        ut_ad(name);
67
 
        ut_a(!(flags & (SIZE_MAX << DICT_TF2_BITS)));
 
67
        ut_a(!(flags & (~0 << DICT_TF2_BITS)));
68
68
 
69
69
        heap = mem_heap_create(DICT_HEAP_SIZE);
70
70
 
71
 
        table = static_cast<dict_table_struct *>(mem_heap_zalloc(heap, sizeof(dict_table_t)));
 
71
        table = mem_heap_zalloc(heap, sizeof(dict_table_t));
72
72
 
73
73
        table->heap = heap;
74
74
 
75
75
        table->flags = (unsigned int) flags;
76
 
        table->name = static_cast<char *>(ut_malloc(strlen(name) + 1));
 
76
        table->name = ut_malloc(strlen(name) + 1);
77
77
        memcpy(table->name, name, strlen(name) + 1);
78
78
        table->space = (unsigned int) space;
79
79
        table->n_cols = (unsigned int) (n_cols + DATA_N_SYS_COLS);
80
80
 
81
 
        table->cols = static_cast<dict_col_t *>(mem_heap_alloc(heap, (n_cols + DATA_N_SYS_COLS)
82
 
                                     * sizeof(dict_col_t)));
 
81
        table->cols = mem_heap_alloc(heap, (n_cols + DATA_N_SYS_COLS)
 
82
                                     * sizeof(dict_col_t));
83
83
 
84
84
#ifndef UNIV_HOTBACKUP
85
 
        table->autoinc_lock = static_cast<lock_t *>(mem_heap_alloc(heap, lock_get_size()));
 
85
        table->autoinc_lock = mem_heap_alloc(heap, lock_get_size());
86
86
 
87
87
        mutex_create(autoinc_mutex_key,
88
88
                     &table->autoinc_mutex, SYNC_DICT_AUTOINC_MUTEX);
154
154
        new_len = strlen(name) + 1;
155
155
        total_len = old_len + new_len;
156
156
 
157
 
        res = static_cast<char *>(mem_heap_alloc(heap, total_len));
 
157
        res = mem_heap_alloc(heap, total_len);
158
158
 
159
159
        if (old_len > 0) {
160
160
                memcpy(res, col_names, old_len);
193
193
                }
194
194
                if (UNIV_LIKELY(i) && UNIV_UNLIKELY(!table->col_names)) {
195
195
                        /* All preceding column names are empty. */
196
 
                        char* s = static_cast<char *>(mem_heap_zalloc(heap, table->n_def));
 
196
                        char* s = mem_heap_zalloc(heap, table->n_def);
197
197
                        table->col_names = s;
198
198
                }
199
199
 
259
259
        ut_ad(table_name && index_name);
260
260
 
261
261
        heap = mem_heap_create(DICT_HEAP_SIZE);
262
 
        index = static_cast<dict_index_t *>(mem_heap_zalloc(heap, sizeof(dict_index_t)));
 
262
        index = mem_heap_zalloc(heap, sizeof(dict_index_t));
263
263
 
264
264
        dict_mem_fill_index_struct(index, heap, table_name, index_name,
265
265
                                   space, type, n_fields);
280
280
 
281
281
        heap = mem_heap_create(100);
282
282
 
283
 
        foreign = static_cast<dict_foreign_t *>(mem_heap_zalloc(heap, sizeof(dict_foreign_t)));
 
283
        foreign = mem_heap_zalloc(heap, sizeof(dict_foreign_t));
284
284
 
285
285
        foreign->heap = heap;
286
286