~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

Merge initial InnoDB+ import.

This was applied by generating a patch between MySQL 5.1.50 InnoDB plugin and
the just-merged innodb+ from mysql-trunk revision-id: vasil.dimov@oracle.com-20100422110752-1zowoqxel5xx3z2e

Then, some manual merge resolving and it worked. This should make it much
easier to merge the rest of InnoDB 1.1 and 1.2 from the mysql tree using
my bzr-reapply script.

This takes us to InnoDB 1.1.1(ish).

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 */
68
73
        table->heap = heap;
69
74
 
70
75
        table->flags = (unsigned int) flags;
71
 
        table->name = ut_malloc(strlen(name) + 1);
72
 
        memcpy(table->name, name, strlen(name) + 1);
 
76
        table->name = mem_heap_strdup(heap, name);
73
77
        table->space = (unsigned int) space;
74
78
        table->n_cols = (unsigned int) (n_cols + DATA_N_SYS_COLS);
75
79
 
79
83
#ifndef UNIV_HOTBACKUP
80
84
        table->autoinc_lock = mem_heap_alloc(heap, lock_get_size());
81
85
 
82
 
        mutex_create(&table->autoinc_mutex, SYNC_DICT_AUTOINC_MUTEX);
 
86
        mutex_create(autoinc_mutex_key,
 
87
                     &table->autoinc_mutex, SYNC_DICT_AUTOINC_MUTEX);
83
88
 
84
89
        table->autoinc = 0;
85
90
 
107
112
#ifndef UNIV_HOTBACKUP
108
113
        mutex_free(&(table->autoinc_mutex));
109
114
#endif /* UNIV_HOTBACKUP */
110
 
        ut_free(table->name);
111
115
        mem_heap_free(table->heap);
112
116
}
113
117