mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 19:37:16 +02:00
InnoDB cleanup: Add const qualifiers to many char* arguments
innobase/dict/dict0dict.c: Replace char* arguments with const char* innobase/dict/dict0load.c: Replace char* arguments with const char* innobase/dict/dict0mem.c: Replace char* arguments with const char* innobase/fil/fil0fil.c: Replace char* arguments with const char* innobase/include/data0data.h: dfield_set_data(): add const qualifier innobase/include/data0data.ic: dfield_set_data(): add const qualifier (temporarily shut up compiler warnings) innobase/include/dict0dict.h: Replace char* arguments with const char* innobase/include/dict0dict.ic: Replace char* arguments with const char* innobase/include/dict0load.h: Replace char* arguments with const char* innobase/include/dict0mem.h: Replace char* arguments with const char* innobase/include/fil0fil.h: Replace char* arguments with const char* innobase/include/os0file.h: Replace char* arguments with const char* innobase/include/os0sync.h: Replace char* arguments with const char* innobase/include/pars0pars.h: Replace char* arguments with const char* innobase/include/pars0sym.h: Replace char* arguments with const char* innobase/include/row0mysql.h: Replace char* arguments with const char* innobase/include/row0sel.h: Replace char* arguments with const char* innobase/include/trx0roll.h: Replace char* arguments with const char* innobase/include/trx0sys.h: Replace char* arguments with const char* innobase/include/trx0trx.h: Replace char* arguments with const char* innobase/include/ut0rnd.h: Replace char* arguments with const char* innobase/include/ut0rnd.ic: Replace char* arguments with const char* innobase/include/ut0ut.h: Remove unused function ut_printf() innobase/os/os0file.c: Replace char* arguments with const char* innobase/os/os0sync.c: Replace char* arguments with const char* innobase/pars/pars0pars.c: Replace char* arguments with const char* innobase/pars/pars0sym.c: Use mem_heap_strdupl() instead of mem_heap_alloc() and memcpy() innobase/row/row0mysql.c: Replace char* arguments with const char* innobase/row/row0sel.c: Replace char* arguments with const char* innobase/trx/trx0roll.c: Replace char* arguments with const char* innobase/trx/trx0sys.c: Replace char* arguments with const char*
This commit is contained in:
parent
1915bfebcb
commit
6b237533f1
31 changed files with 553 additions and 519 deletions
|
|
@ -48,27 +48,28 @@ Creates a table memory object. */
|
|||
dict_table_t*
|
||||
dict_mem_table_create(
|
||||
/*==================*/
|
||||
/* out, own: table object */
|
||||
char* name, /* in: table name */
|
||||
ulint space, /* in: space where the clustered index of
|
||||
the table is placed; this parameter is
|
||||
ignored if the table is made a member of
|
||||
a cluster */
|
||||
ulint n_cols); /* in: number of columns */
|
||||
/* out, own: table object */
|
||||
const char* name, /* in: table name */
|
||||
ulint space, /* in: space where the clustered index
|
||||
of the table is placed; this parameter
|
||||
is ignored if the table is made
|
||||
a member of a cluster */
|
||||
ulint n_cols); /* in: number of columns */
|
||||
/**************************************************************************
|
||||
Creates a cluster memory object. */
|
||||
|
||||
dict_cluster_t*
|
||||
dict_mem_cluster_create(
|
||||
/*====================*/
|
||||
/* out, own: cluster object (where the type
|
||||
dict_cluster_t == dict_table_t) */
|
||||
char* name, /* in: cluster name */
|
||||
ulint space, /* in: space where the clustered indexes
|
||||
of the member tables are placed */
|
||||
ulint n_cols, /* in: number of columns */
|
||||
ulint mix_len); /* in: length of the common key prefix in the
|
||||
cluster */
|
||||
/* out, own: cluster object (where the
|
||||
type dict_cluster_t == dict_table_t) */
|
||||
const char* name, /* in: cluster name */
|
||||
ulint space, /* in: space where the clustered
|
||||
indexes of the member tables are
|
||||
placed */
|
||||
ulint n_cols, /* in: number of columns */
|
||||
ulint mix_len); /* in: length of the common key prefix
|
||||
in the cluster */
|
||||
/**************************************************************************
|
||||
Declares a non-published table as a member in a cluster. */
|
||||
|
||||
|
|
@ -76,7 +77,7 @@ void
|
|||
dict_mem_table_make_cluster_member(
|
||||
/*===============================*/
|
||||
dict_table_t* table, /* in: non-published table */
|
||||
char* cluster_name); /* in: cluster name */
|
||||
const char* cluster_name); /* in: cluster name */
|
||||
/**************************************************************************
|
||||
Adds a column definition to a table. */
|
||||
|
||||
|
|
@ -84,7 +85,7 @@ void
|
|||
dict_mem_table_add_col(
|
||||
/*===================*/
|
||||
dict_table_t* table, /* in: table */
|
||||
char* name, /* in: column name */
|
||||
const char* name, /* in: column name */
|
||||
ulint mtype, /* in: main datatype */
|
||||
ulint prtype, /* in: precise type */
|
||||
ulint len, /* in: length */
|
||||
|
|
@ -95,14 +96,15 @@ Creates an index memory object. */
|
|||
dict_index_t*
|
||||
dict_mem_index_create(
|
||||
/*==================*/
|
||||
/* out, own: index object */
|
||||
char* table_name, /* in: table name */
|
||||
char* index_name, /* in: index name */
|
||||
ulint space, /* in: space where the index tree is placed,
|
||||
ignored if the index is of the clustered
|
||||
type */
|
||||
ulint type, /* in: DICT_UNIQUE, DICT_CLUSTERED, ... ORed */
|
||||
ulint n_fields); /* in: number of fields */
|
||||
/* out, own: index object */
|
||||
const char* table_name, /* in: table name */
|
||||
const char* index_name, /* in: index name */
|
||||
ulint space, /* in: space where the index tree is
|
||||
placed, ignored if the index is of
|
||||
the clustered type */
|
||||
ulint type, /* in: DICT_UNIQUE,
|
||||
DICT_CLUSTERED, ... ORed */
|
||||
ulint n_fields); /* in: number of fields */
|
||||
/**************************************************************************
|
||||
Adds a field definition to an index. NOTE: does not take a copy
|
||||
of the column name if the field is a column. The memory occupied
|
||||
|
|
@ -112,7 +114,7 @@ void
|
|||
dict_mem_index_add_field(
|
||||
/*=====================*/
|
||||
dict_index_t* index, /* in: index */
|
||||
char* name, /* in: column name */
|
||||
const char* name, /* in: column name */
|
||||
ulint order, /* in: order criterion; 0 means an
|
||||
ascending order */
|
||||
ulint prefix_len); /* in: 0 or the column prefix length
|
||||
|
|
@ -142,7 +144,7 @@ struct dict_col_struct{
|
|||
clustered index */
|
||||
ulint ord_part;/* count of how many times this column
|
||||
appears in ordering fields of an index */
|
||||
char* name; /* name */
|
||||
const char* name; /* name */
|
||||
dtype_t type; /* data type */
|
||||
dict_table_t* table; /* back pointer to table of this column */
|
||||
ulint aux; /* this is used as an auxiliary variable
|
||||
|
|
@ -154,7 +156,7 @@ struct dict_col_struct{
|
|||
/* Data structure for a field in an index */
|
||||
struct dict_field_struct{
|
||||
dict_col_t* col; /* pointer to the table column */
|
||||
char* name; /* name of the column */
|
||||
const char* name; /* name of the column */
|
||||
ulint order; /* flags for ordering this field:
|
||||
DICT_DESCEND, ... */
|
||||
ulint prefix_len; /* 0 or the length of the column
|
||||
|
|
@ -197,8 +199,8 @@ struct dict_index_struct{
|
|||
dulint id; /* id of the index */
|
||||
mem_heap_t* heap; /* memory heap */
|
||||
ulint type; /* index type */
|
||||
char* name; /* index name */
|
||||
char* table_name; /* table name */
|
||||
const char* name; /* index name */
|
||||
const char* table_name; /* table name */
|
||||
dict_table_t* table; /* back pointer to table */
|
||||
ulint space; /* space where the index tree is placed */
|
||||
ulint page_no;/* page number of the index tree root */
|
||||
|
|
@ -254,12 +256,12 @@ struct dict_foreign_struct{
|
|||
or DICT_FOREIGN_ON_DELETE_SET_NULL */
|
||||
char* foreign_table_name;/* foreign table name */
|
||||
dict_table_t* foreign_table; /* table where the foreign key is */
|
||||
char** foreign_col_names;/* names of the columns in the
|
||||
const char** foreign_col_names;/* names of the columns in the
|
||||
foreign key */
|
||||
char* referenced_table_name;/* referenced table name */
|
||||
dict_table_t* referenced_table;/* table where the referenced key
|
||||
is */
|
||||
char** referenced_col_names;/* names of the referenced
|
||||
const char** referenced_col_names;/* names of the referenced
|
||||
columns in the referenced table */
|
||||
ulint n_fields; /* number of indexes' first fields
|
||||
for which the the foreign key
|
||||
|
|
@ -295,7 +297,7 @@ struct dict_table_struct{
|
|||
dulint id; /* id of the table or cluster */
|
||||
ulint type; /* DICT_TABLE_ORDINARY, ... */
|
||||
mem_heap_t* heap; /* memory heap */
|
||||
char* name; /* table name */
|
||||
const char* name; /* table name */
|
||||
ulint space; /* space where the clustered index of the
|
||||
table is placed */
|
||||
ibool ibd_file_missing;/* TRUE if this is in a single-table
|
||||
|
|
@ -363,7 +365,7 @@ struct dict_table_struct{
|
|||
byte mix_id_buf[12];
|
||||
/* mix id of a mixed table written in
|
||||
a compressed form */
|
||||
char* cluster_name; /* if the table is a member in a
|
||||
const char* cluster_name; /* if the table is a member in a
|
||||
cluster, this is the name of the cluster */
|
||||
/*----------------------*/
|
||||
ibool does_not_fit_in_memory;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue