~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Monty Taylor
  • Date: 2010-11-26 22:50:54 UTC
  • mfrom: (1953.1.6 build)
  • Revision ID: mordred@inaugust.com-20101126225054-sg90svw8579t5p3i
Stewart - InnoDB 1.1.1
Monty - Fixed some autoconf tests which were returning false positives.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
2
 
3
 
Copyright (c) 1996, 2009, 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
40
40
#define DICT_HEAP_SIZE          100     /*!< initial memory heap size when
41
41
                                        creating a table or index object */
42
42
 
 
43
#ifdef UNIV_PFS_MUTEX
 
44
/* Key to register autoinc_mutex with performance schema */
 
45
UNIV_INTERN mysql_pfs_key_t     autoinc_mutex_key;
 
46
#endif /* UNIV_PFS_MUTEX */
 
47
 
43
48
/**********************************************************************//**
44
49
Creates a table memory object.
45
50
@return own: table object */
78
83
#ifndef UNIV_HOTBACKUP
79
84
        table->autoinc_lock = mem_heap_alloc(heap, lock_get_size());
80
85
 
81
 
        mutex_create(&table->autoinc_mutex, SYNC_DICT_AUTOINC_MUTEX);
 
86
        mutex_create(autoinc_mutex_key,
 
87
                     &table->autoinc_mutex, SYNC_DICT_AUTOINC_MUTEX);
82
88
 
83
89
        table->autoinc = 0;
84
90
 
171
177
        ulint           len)    /*!< in: precision */
172
178
{
173
179
        dict_col_t*     col;
174
 
#ifndef UNIV_HOTBACKUP
175
 
        ulint           mbminlen;
176
 
        ulint           mbmaxlen;
177
 
#endif /* !UNIV_HOTBACKUP */
178
180
        ulint           i;
179
181
 
180
182
        ut_ad(table);
199
201
 
200
202
        col = dict_table_get_nth_col(table, i);
201
203
 
202
 
        col->ind = (unsigned int) i;
203
 
        col->ord_part = 0;
204
 
 
205
 
        col->mtype = (unsigned int) mtype;
206
 
        col->prtype = (unsigned int) prtype;
207
 
        col->len = (unsigned int) len;
208
 
 
209
 
#ifndef UNIV_HOTBACKUP
210
 
        dtype_get_mblen(mtype, prtype, &mbminlen, &mbmaxlen);
211
 
 
212
 
        col->mbminlen = (unsigned int) mbminlen;
213
 
        col->mbmaxlen = (unsigned int) mbmaxlen;
214
 
#endif /* !UNIV_HOTBACKUP */
 
204
        dict_mem_fill_column_struct(col, i, mtype, prtype, len);
215
205
}
216
206
 
217
207
/**********************************************************************//**
238
228
        heap = mem_heap_create(DICT_HEAP_SIZE);
239
229
        index = mem_heap_zalloc(heap, sizeof(dict_index_t));
240
230
 
241
 
        index->heap = heap;
 
231
        dict_mem_fill_index_struct(index, heap, table_name, index_name,
 
232
                                   space, type, n_fields);
242
233
 
243
 
        index->type = type;
244
 
#ifndef UNIV_HOTBACKUP
245
 
        index->space = (unsigned int) space;
246
 
#endif /* !UNIV_HOTBACKUP */
247
 
        index->name = mem_heap_strdup(heap, index_name);
248
 
        index->table_name = table_name;
249
 
        index->n_fields = (unsigned int) n_fields;
250
 
        index->fields = mem_heap_alloc(heap, 1 + n_fields
251
 
                                       * sizeof(dict_field_t));
252
 
        /* The '1 +' above prevents allocation
253
 
        of an empty mem block */
254
 
#ifdef UNIV_DEBUG
255
 
        index->magic_n = DICT_INDEX_MAGIC_N;
256
 
#endif /* UNIV_DEBUG */
257
234
        return(index);
258
235
}
259
236