33
33
#include "data0type.h"
34
34
#include "mach0data.h"
35
35
#include "dict0dict.h"
36
#include "srv0srv.h" /* srv_lower_case_table_names */
37
#include "ha_prototypes.h" /* innobase_casedn_str()*/
36
38
#ifndef UNIV_HOTBACKUP
37
39
# include "lock0lock.h"
38
40
#endif /* !UNIV_HOTBACKUP */
41
#ifdef UNIV_BLOB_DEBUG
43
#endif /* UNIV_BLOB_DEBUG */
40
45
#define DICT_HEAP_SIZE 100 /*!< initial memory heap size when
41
46
creating a table or index object */
290
295
/**********************************************************************//**
296
Sets the foreign_table_name_lookup pointer based on the value of
297
srv_lower_case_table_names. If that is 0 or 1, foreign_table_name_lookup
298
will point to foreign_table_name. If 2, then another string is allocated
299
of the heap and set to lower case. */
302
dict_mem_foreign_table_name_lookup_set(
303
/*===================================*/
304
dict_foreign_t* foreign, /*!< in/out: foreign struct */
305
ibool do_alloc) /*!< in: is an alloc needed */
307
if (srv_lower_case_table_names == 2) {
309
foreign->foreign_table_name_lookup = static_cast<char *>(mem_heap_alloc(
311
strlen(foreign->foreign_table_name) + 1));
313
strcpy(foreign->foreign_table_name_lookup,
314
foreign->foreign_table_name);
315
innobase_casedn_str(foreign->foreign_table_name_lookup);
317
foreign->foreign_table_name_lookup
318
= foreign->foreign_table_name;
322
/**********************************************************************//**
323
Sets the referenced_table_name_lookup pointer based on the value of
324
srv_lower_case_table_names. If that is 0 or 1,
325
referenced_table_name_lookup will point to referenced_table_name. If 2,
326
then another string is allocated of the heap and set to lower case. */
329
dict_mem_referenced_table_name_lookup_set(
330
/*======================================*/
331
dict_foreign_t* foreign, /*!< in/out: foreign struct */
332
ibool do_alloc) /*!< in: is an alloc needed */
334
if (srv_lower_case_table_names == 2) {
336
foreign->referenced_table_name_lookup = static_cast<char *>(mem_heap_alloc(
338
strlen(foreign->referenced_table_name) + 1));
340
strcpy(foreign->referenced_table_name_lookup,
341
foreign->referenced_table_name);
342
innobase_casedn_str(foreign->referenced_table_name_lookup);
344
foreign->referenced_table_name_lookup
345
= foreign->referenced_table_name;
349
/**********************************************************************//**
291
350
Adds a field definition to an index. NOTE: does not take a copy
292
351
of the column name if the field is a column. The memory occupied
293
352
by the column name may be released only after publishing the index. */