Commit 1595953a authored by marko's avatar marko

branches/zip: Add some const qualifiers or in/out comments to the

dict_index_t* and dict_table_t* parameters of some functions.
parent 9bbb520f
...@@ -309,7 +309,7 @@ Decrements the count of open MySQL handles to a table. */ ...@@ -309,7 +309,7 @@ Decrements the count of open MySQL handles to a table. */
void void
dict_table_decrement_handle_count( dict_table_decrement_handle_count(
/*==============================*/ /*==============================*/
dict_table_t* table, /* in: table */ dict_table_t* table, /* in/out: table */
ibool dict_locked) /* in: TRUE=data dictionary locked */ ibool dict_locked) /* in: TRUE=data dictionary locked */
{ {
if (!dict_locked) { if (!dict_locked) {
...@@ -363,7 +363,7 @@ Acquire the autoinc lock.*/ ...@@ -363,7 +363,7 @@ Acquire the autoinc lock.*/
void void
dict_table_autoinc_lock( dict_table_autoinc_lock(
/*====================*/ /*====================*/
dict_table_t* table) dict_table_t* table) /* in/out: table */
{ {
mutex_enter(&table->autoinc_mutex); mutex_enter(&table->autoinc_mutex);
} }
...@@ -375,7 +375,7 @@ initialized counter. */ ...@@ -375,7 +375,7 @@ initialized counter. */
void void
dict_table_autoinc_initialize( dict_table_autoinc_initialize(
/*==========================*/ /*==========================*/
dict_table_t* table, /* in: table */ dict_table_t* table, /* in/out: table */
ib_longlong value) /* in: next value to assign to a row */ ib_longlong value) /* in: next value to assign to a row */
{ {
table->autoinc_inited = TRUE; table->autoinc_inited = TRUE;
...@@ -390,7 +390,7 @@ ib_longlong ...@@ -390,7 +390,7 @@ ib_longlong
dict_table_autoinc_read( dict_table_autoinc_read(
/*====================*/ /*====================*/
/* out: value for a new row, or 0 */ /* out: value for a new row, or 0 */
dict_table_t* table) /* in: table */ const dict_table_t* table) /* in: table */
{ {
ib_longlong value; ib_longlong value;
...@@ -412,7 +412,7 @@ void ...@@ -412,7 +412,7 @@ void
dict_table_autoinc_update( dict_table_autoinc_update(
/*======================*/ /*======================*/
dict_table_t* table, /* in: table */ dict_table_t* table, /* in/out: table */
ib_longlong value) /* in: value which was assigned to a row */ ib_longlong value) /* in: value which was assigned to a row */
{ {
if (table->autoinc_inited && value > table->autoinc) { if (table->autoinc_inited && value > table->autoinc) {
...@@ -427,7 +427,7 @@ Release the autoinc lock.*/ ...@@ -427,7 +427,7 @@ Release the autoinc lock.*/
void void
dict_table_autoinc_unlock( dict_table_autoinc_unlock(
/*======================*/ /*======================*/
dict_table_t* table) /* in: release autoinc lock for this table */ dict_table_t* table) /* in/out: table */
{ {
mutex_exit(&table->autoinc_mutex); mutex_exit(&table->autoinc_mutex);
} }
...@@ -507,9 +507,9 @@ Returns TRUE if the index contains a column or a prefix of that column. */ ...@@ -507,9 +507,9 @@ Returns TRUE if the index contains a column or a prefix of that column. */
ibool ibool
dict_index_contains_col_or_prefix( dict_index_contains_col_or_prefix(
/*==============================*/ /*==============================*/
/* out: TRUE if contains the column or its /* out: TRUE if contains the column
prefix */ or its prefix */
dict_index_t* index, /* in: index */ const dict_index_t* index, /* in: index */
ulint n) /* in: column number */ ulint n) /* in: column number */
{ {
const dict_field_t* field; const dict_field_t* field;
...@@ -550,15 +550,16 @@ from the prefix in index. */ ...@@ -550,15 +550,16 @@ from the prefix in index. */
ulint ulint
dict_index_get_nth_field_pos( dict_index_get_nth_field_pos(
/*=========================*/ /*=========================*/
/* out: position in internal representation /* out: position in internal
of the index; if not contained, returns representation of the index;
if not contained, returns
ULINT_UNDEFINED */ ULINT_UNDEFINED */
dict_index_t* index, /* in: index from which to search */ const dict_index_t* index, /* in: index from which to search */
dict_index_t* index2, /* in: index */ const dict_index_t* index2, /* in: index */
ulint n) /* in: field number in index2 */ ulint n) /* in: field number in index2 */
{ {
dict_field_t* field; const dict_field_t* field;
dict_field_t* field2; const dict_field_t* field2;
ulint n_fields; ulint n_fields;
ulint pos; ulint pos;
...@@ -624,9 +625,10 @@ Looks for column n position in the clustered index. */ ...@@ -624,9 +625,10 @@ Looks for column n position in the clustered index. */
ulint ulint
dict_table_get_nth_col_pos( dict_table_get_nth_col_pos(
/*=======================*/ /*=======================*/
/* out: position in internal representation /* out: position in internal
of the clustered index */ representation of
dict_table_t* table, /* in: table */ the clustered index */
const dict_table_t* table, /* in: table */
ulint n) /* in: column number */ ulint n) /* in: column number */
{ {
return(dict_index_get_nth_col_pos(dict_table_get_first_index(table), return(dict_index_get_nth_col_pos(dict_table_get_first_index(table),
...@@ -640,12 +642,12 @@ table. Column prefixes are treated like whole columns. */ ...@@ -640,12 +642,12 @@ table. Column prefixes are treated like whole columns. */
ibool ibool
dict_table_col_in_clustered_key( dict_table_col_in_clustered_key(
/*============================*/ /*============================*/
/* out: TRUE if the column, or its prefix, is /* out: TRUE if the column, or its
in the clustered key */ prefix, is in the clustered key */
dict_table_t* table, /* in: table */ const dict_table_t* table, /* in: table */
ulint n) /* in: column number */ ulint n) /* in: column number */
{ {
dict_index_t* index; const dict_index_t* index;
const dict_field_t* field; const dict_field_t* field;
const dict_col_t* col; const dict_col_t* col;
ulint pos; ulint pos;
...@@ -903,7 +905,7 @@ ibool ...@@ -903,7 +905,7 @@ ibool
dict_table_rename_in_cache( dict_table_rename_in_cache(
/*=======================*/ /*=======================*/
/* out: TRUE if success */ /* out: TRUE if success */
dict_table_t* table, /* in: table */ dict_table_t* table, /* in/out: table */
const char* new_name, /* in: new name */ const char* new_name, /* in: new name */
ibool rename_also_foreigns)/* in: in ALTER TABLE we want ibool rename_also_foreigns)/* in: in ALTER TABLE we want
to preserve the original table name to preserve the original table name
...@@ -1119,7 +1121,7 @@ DISCARD TABLESPACE. */ ...@@ -1119,7 +1121,7 @@ DISCARD TABLESPACE. */
void void
dict_table_change_id_in_cache( dict_table_change_id_in_cache(
/*==========================*/ /*==========================*/
dict_table_t* table, /* in: table object already in cache */ dict_table_t* table, /* in/out: table object already in cache */
dulint new_id) /* in: new id to set */ dulint new_id) /* in: new id to set */
{ {
ut_ad(table); ut_ad(table);
...@@ -1329,7 +1331,7 @@ Removes an index from the dictionary cache. */ ...@@ -1329,7 +1331,7 @@ Removes an index from the dictionary cache. */
void void
dict_index_remove_from_cache( dict_index_remove_from_cache(
/*=========================*/ /*=========================*/
dict_table_t* table, /* in: table */ dict_table_t* table, /* in/out: table */
dict_index_t* index) /* in, own: index */ dict_index_t* index) /* in, own: index */
{ {
ulint size; ulint size;
...@@ -1396,8 +1398,8 @@ Adds a column to index. */ ...@@ -1396,8 +1398,8 @@ Adds a column to index. */
void void
dict_index_add_col( dict_index_add_col(
/*===============*/ /*===============*/
dict_index_t* index, /* in: index */ dict_index_t* index, /* in/out: index */
dict_table_t* table, /* in: table */ const dict_table_t* table, /* in: table */
dict_col_t* col, /* in: column */ dict_col_t* col, /* in: column */
ulint prefix_len) /* in: column prefix length */ ulint prefix_len) /* in: column prefix length */
{ {
...@@ -3604,7 +3606,7 @@ ibool ...@@ -3604,7 +3606,7 @@ ibool
dict_index_check_search_tuple( dict_index_check_search_tuple(
/*==========================*/ /*==========================*/
/* out: TRUE if ok */ /* out: TRUE if ok */
dict_index_t* index, /* in: index tree */ const dict_index_t* index, /* in: index tree */
const dtuple_t* tuple) /* in: tuple used in a search */ const dtuple_t* tuple) /* in: tuple used in a search */
{ {
ut_a(index); ut_a(index);
...@@ -3621,13 +3623,15 @@ dtuple_t* ...@@ -3621,13 +3623,15 @@ dtuple_t*
dict_index_build_node_ptr( dict_index_build_node_ptr(
/*======================*/ /*======================*/
/* out, own: node pointer */ /* out, own: node pointer */
dict_index_t* index, /* in: index tree */ const dict_index_t* index, /* in: index */
rec_t* rec, /* in: record for which to build node const rec_t* rec, /* in: record for which to build node
pointer */
ulint page_no,/* in: page number to put in node
pointer */ pointer */
ulint page_no,/* in: page number to put in node pointer */ mem_heap_t* heap, /* in: memory heap where pointer
mem_heap_t* heap, /* in: memory heap where pointer created */ created */
ulint level) /* in: level of rec in tree: 0 means leaf ulint level) /* in: level of rec in tree:
level */ 0 means leaf level */
{ {
dtuple_t* tuple; dtuple_t* tuple;
dfield_t* field; dfield_t* field;
...@@ -3745,7 +3749,7 @@ Calculates the minimum record length in an index. */ ...@@ -3745,7 +3749,7 @@ Calculates the minimum record length in an index. */
ulint ulint
dict_index_calc_min_rec_len( dict_index_calc_min_rec_len(
/*========================*/ /*========================*/
dict_index_t* index) /* in: index */ const dict_index_t* index) /* in: index */
{ {
ulint sum = 0; ulint sum = 0;
ulint i; ulint i;
...@@ -3796,7 +3800,7 @@ are used in query optimization. */ ...@@ -3796,7 +3800,7 @@ are used in query optimization. */
void void
dict_update_statistics_low( dict_update_statistics_low(
/*=======================*/ /*=======================*/
dict_table_t* table, /* in: table */ dict_table_t* table, /* in/out: table */
ibool has_dict_mutex __attribute__((unused))) ibool has_dict_mutex __attribute__((unused)))
/* in: TRUE if the caller has the /* in: TRUE if the caller has the
dictionary mutex */ dictionary mutex */
...@@ -3880,7 +3884,7 @@ are used in query optimization. */ ...@@ -3880,7 +3884,7 @@ are used in query optimization. */
void void
dict_update_statistics( dict_update_statistics(
/*===================*/ /*===================*/
dict_table_t* table) /* in: table */ dict_table_t* table) /* in/out: table */
{ {
dict_update_statistics_low(table, FALSE); dict_update_statistics_low(table, FALSE);
} }
...@@ -4456,20 +4460,21 @@ dict_table_get_index_by_max_id( ...@@ -4456,20 +4460,21 @@ dict_table_get_index_by_max_id(
return(dict_find_index_by_max_id(table, name, column_names, n_cols)); return(dict_find_index_by_max_id(table, name, column_names, n_cols));
} }
#ifdef UNIV_DEBUG
/************************************************************************** /**************************************************************************
Check for duplicate index entries in a table [using the index name] */ Check for duplicate index entries in a table [using the index name] */
#ifdef UNIV_DEBUG
void void
dict_table_check_for_dup_indexes( dict_table_check_for_dup_indexes(
/*=============================*/ /*=============================*/
dict_table_t* table) /* in: Check for dup indexes in this table */ const dict_table_t* table) /* in: Check for dup indexes
in this table */
{ {
/* Check for duplicates, ignoring indexes that are marked /* Check for duplicates, ignoring indexes that are marked
as to be dropped */ as to be dropped */
dict_index_t* index1; const dict_index_t* index1;
dict_index_t* index2; const dict_index_t* index2;
/* The primary index _must_ exist */ /* The primary index _must_ exist */
ut_a(UT_LIST_GET_LEN(table->indexes) > 0); ut_a(UT_LIST_GET_LEN(table->indexes) > 0);
......
...@@ -68,7 +68,7 @@ Decrements the count of open MySQL handles to a table. */ ...@@ -68,7 +68,7 @@ Decrements the count of open MySQL handles to a table. */
void void
dict_table_decrement_handle_count( dict_table_decrement_handle_count(
/*==============================*/ /*==============================*/
dict_table_t* table, /* in: table */ dict_table_t* table, /* in/out: table */
ibool dict_locked); /* in: TRUE=data dictionary locked */ ibool dict_locked); /* in: TRUE=data dictionary locked */
/************************************************************************** /**************************************************************************
Inits the data dictionary module. */ Inits the data dictionary module. */
...@@ -170,7 +170,7 @@ Acquire the autoinc lock.*/ ...@@ -170,7 +170,7 @@ Acquire the autoinc lock.*/
void void
dict_table_autoinc_lock( dict_table_autoinc_lock(
/*====================*/ /*====================*/
dict_table_t* table); /* in: table */ dict_table_t* table); /* in/out: table */
/************************************************************************ /************************************************************************
Initializes the autoinc counter. It is not an error to initialize an already Initializes the autoinc counter. It is not an error to initialize an already
initialized counter. */ initialized counter. */
...@@ -178,7 +178,7 @@ initialized counter. */ ...@@ -178,7 +178,7 @@ initialized counter. */
void void
dict_table_autoinc_initialize( dict_table_autoinc_initialize(
/*==========================*/ /*==========================*/
dict_table_t* table, /* in: table */ dict_table_t* table, /* in/out: table */
ib_longlong value); /* in: next value to assign to a row */ ib_longlong value); /* in: next value to assign to a row */
/************************************************************************ /************************************************************************
Reads the next autoinc value (== autoinc counter value), 0 if not yet Reads the next autoinc value (== autoinc counter value), 0 if not yet
...@@ -188,7 +188,7 @@ ib_longlong ...@@ -188,7 +188,7 @@ ib_longlong
dict_table_autoinc_read( dict_table_autoinc_read(
/*====================*/ /*====================*/
/* out: value for a new row, or 0 */ /* out: value for a new row, or 0 */
dict_table_t* table); /* in: table */ const dict_table_t* table); /* in: table */
/************************************************************************ /************************************************************************
Updates the autoinc counter if the value supplied is equal or bigger than the Updates the autoinc counter if the value supplied is equal or bigger than the
current value. If not inited, does nothing. */ current value. If not inited, does nothing. */
...@@ -197,7 +197,7 @@ void ...@@ -197,7 +197,7 @@ void
dict_table_autoinc_update( dict_table_autoinc_update(
/*======================*/ /*======================*/
dict_table_t* table, /* in: table */ dict_table_t* table, /* in/out: table */
ib_longlong value); /* in: value which was assigned to a row */ ib_longlong value); /* in: value which was assigned to a row */
/************************************************************************ /************************************************************************
Release the autoinc lock.*/ Release the autoinc lock.*/
...@@ -205,7 +205,7 @@ Release the autoinc lock.*/ ...@@ -205,7 +205,7 @@ Release the autoinc lock.*/
void void
dict_table_autoinc_unlock( dict_table_autoinc_unlock(
/*======================*/ /*======================*/
dict_table_t* table); /* in: table */ dict_table_t* table); /* in/out: table */
/************************************************************************** /**************************************************************************
Adds system columns to a table object. */ Adds system columns to a table object. */
...@@ -236,7 +236,7 @@ ibool ...@@ -236,7 +236,7 @@ ibool
dict_table_rename_in_cache( dict_table_rename_in_cache(
/*=======================*/ /*=======================*/
/* out: TRUE if success */ /* out: TRUE if success */
dict_table_t* table, /* in: table */ dict_table_t* table, /* in/out: table */
const char* new_name, /* in: new name */ const char* new_name, /* in: new name */
ibool rename_also_foreigns);/* in: in ALTER TABLE we want ibool rename_also_foreigns);/* in: in ALTER TABLE we want
to preserve the original table name to preserve the original table name
...@@ -247,7 +247,7 @@ Removes an index from the dictionary cache. */ ...@@ -247,7 +247,7 @@ Removes an index from the dictionary cache. */
void void
dict_index_remove_from_cache( dict_index_remove_from_cache(
/*=========================*/ /*=========================*/
dict_table_t* table, /* in: table */ dict_table_t* table, /* in/out: table */
dict_index_t* index); /* in, own: index */ dict_index_t* index); /* in, own: index */
/************************************************************************** /**************************************************************************
Change the id of a table object in the dictionary cache. This is used in Change the id of a table object in the dictionary cache. This is used in
...@@ -256,7 +256,7 @@ DISCARD TABLESPACE. */ ...@@ -256,7 +256,7 @@ DISCARD TABLESPACE. */
void void
dict_table_change_id_in_cache( dict_table_change_id_in_cache(
/*==========================*/ /*==========================*/
dict_table_t* table, /* in: table object already in cache */ dict_table_t* table, /* in/out: table object already in cache */
dulint new_id);/* in: new id to set */ dulint new_id);/* in: new id to set */
/************************************************************************** /**************************************************************************
Adds a foreign key constraint object to the dictionary cache. May free Adds a foreign key constraint object to the dictionary cache. May free
...@@ -634,9 +634,9 @@ table. Column prefixes are treated like whole columns. */ ...@@ -634,9 +634,9 @@ table. Column prefixes are treated like whole columns. */
ibool ibool
dict_table_col_in_clustered_key( dict_table_col_in_clustered_key(
/*============================*/ /*============================*/
/* out: TRUE if the column, or its prefix, is /* out: TRUE if the column, or its
in the clustered key */ prefix, is in the clustered key */
dict_table_t* table, /* in: table */ const dict_table_t* table, /* in: table */
ulint n); /* in: column number */ ulint n); /* in: column number */
/*********************************************************************** /***********************************************************************
Copies types of columns contained in table to tuple. */ Copies types of columns contained in table to tuple. */
...@@ -672,7 +672,7 @@ Removes an index from the dictionary cache. */ ...@@ -672,7 +672,7 @@ Removes an index from the dictionary cache. */
void void
dict_index_remove_from_cache( dict_index_remove_from_cache(
/*=========================*/ /*=========================*/
dict_table_t* table, /* in: table */ dict_table_t* table, /* in/out: table */
dict_index_t* index); /* in, own: index */ dict_index_t* index); /* in, own: index */
/************************************************************************ /************************************************************************
Gets the number of fields in the internal representation of an index, Gets the number of fields in the internal representation of an index,
...@@ -718,8 +718,8 @@ ulint ...@@ -718,8 +718,8 @@ ulint
dict_index_get_n_ordering_defined_by_user( dict_index_get_n_ordering_defined_by_user(
/*======================================*/ /*======================================*/
/* out: number of fields */ /* out: number of fields */
dict_index_t* index); /* in: an internal representation of index const dict_index_t* index); /* in: an internal representation
(in the dictionary cache) */ of index (in the dictionary cache) */
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
/************************************************************************ /************************************************************************
Gets the nth field of an index. */ Gets the nth field of an index. */
...@@ -769,9 +769,9 @@ Returns TRUE if the index contains a column or a prefix of that column. */ ...@@ -769,9 +769,9 @@ Returns TRUE if the index contains a column or a prefix of that column. */
ibool ibool
dict_index_contains_col_or_prefix( dict_index_contains_col_or_prefix(
/*==============================*/ /*==============================*/
/* out: TRUE if contains the column or its /* out: TRUE if contains the column
prefix */ or its prefix */
dict_index_t* index, /* in: index */ const dict_index_t* index, /* in: index */
ulint n); /* in: column number */ ulint n); /* in: column number */
/************************************************************************ /************************************************************************
Looks for a matching field in an index. The column has to be the same. The Looks for a matching field in an index. The column has to be the same. The
...@@ -782,11 +782,12 @@ from the prefix in index. */ ...@@ -782,11 +782,12 @@ from the prefix in index. */
ulint ulint
dict_index_get_nth_field_pos( dict_index_get_nth_field_pos(
/*=========================*/ /*=========================*/
/* out: position in internal representation /* out: position in internal
of the index; if not contained, returns representation of the index;
if not contained, returns
ULINT_UNDEFINED */ ULINT_UNDEFINED */
dict_index_t* index, /* in: index from which to search */ const dict_index_t* index, /* in: index from which to search */
dict_index_t* index2, /* in: index */ const dict_index_t* index2, /* in: index */
ulint n); /* in: field number in index2 */ ulint n); /* in: field number in index2 */
/************************************************************************ /************************************************************************
Looks for column n position in the clustered index. */ Looks for column n position in the clustered index. */
...@@ -794,9 +795,10 @@ Looks for column n position in the clustered index. */ ...@@ -794,9 +795,10 @@ Looks for column n position in the clustered index. */
ulint ulint
dict_table_get_nth_col_pos( dict_table_get_nth_col_pos(
/*=======================*/ /*=======================*/
/* out: position in internal representation /* out: position in internal
of the clustered index */ representation of
dict_table_t* table, /* in: table */ the clustered index */
const dict_table_t* table, /* in: table */
ulint n); /* in: column number */ ulint n); /* in: column number */
/************************************************************************ /************************************************************************
Returns the position of a system column in an index. */ Returns the position of a system column in an index. */
...@@ -814,8 +816,8 @@ Adds a column to index. */ ...@@ -814,8 +816,8 @@ Adds a column to index. */
void void
dict_index_add_col( dict_index_add_col(
/*===============*/ /*===============*/
dict_index_t* index, /* in: index */ dict_index_t* index, /* in/out: index */
dict_table_t* table, /* in: table */ const dict_table_t* table, /* in: table */
dict_col_t* col, /* in: column */ dict_col_t* col, /* in: column */
ulint prefix_len); /* in: column prefix length */ ulint prefix_len); /* in: column prefix length */
/*********************************************************************** /***********************************************************************
...@@ -864,7 +866,7 @@ ibool ...@@ -864,7 +866,7 @@ ibool
dict_index_check_search_tuple( dict_index_check_search_tuple(
/*==========================*/ /*==========================*/
/* out: TRUE if ok */ /* out: TRUE if ok */
dict_index_t* index, /* in: index */ const dict_index_t* index, /* in: index tree */
const dtuple_t* tuple); /* in: tuple used in a search */ const dtuple_t* tuple); /* in: tuple used in a search */
/************************************************************************** /**************************************************************************
Check for duplicate index entries in a table [using the index name] */ Check for duplicate index entries in a table [using the index name] */
...@@ -872,7 +874,8 @@ Check for duplicate index entries in a table [using the index name] */ ...@@ -872,7 +874,8 @@ Check for duplicate index entries in a table [using the index name] */
void void
dict_table_check_for_dup_indexes( dict_table_check_for_dup_indexes(
/*=============================*/ /*=============================*/
dict_table_t* table); /* in: Check for dup indexes in this table */ const dict_table_t* table); /* in: Check for dup indexes
in this table */
#endif /* UNIV_DEBUG */ #endif /* UNIV_DEBUG */
/************************************************************************** /**************************************************************************
...@@ -882,13 +885,15 @@ dtuple_t* ...@@ -882,13 +885,15 @@ dtuple_t*
dict_index_build_node_ptr( dict_index_build_node_ptr(
/*======================*/ /*======================*/
/* out, own: node pointer */ /* out, own: node pointer */
dict_index_t* index, /* in: index */ const dict_index_t* index, /* in: index */
rec_t* rec, /* in: record for which to build node const rec_t* rec, /* in: record for which to build node
pointer */
ulint page_no,/* in: page number to put in node
pointer */ pointer */
ulint page_no,/* in: page number to put in node pointer */ mem_heap_t* heap, /* in: memory heap where pointer
mem_heap_t* heap, /* in: memory heap where pointer created */ created */
ulint level); /* in: level of rec in tree: 0 means leaf ulint level); /* in: level of rec in tree:
level */ 0 means leaf level */
/************************************************************************** /**************************************************************************
Copies an initial segment of a physical record, long enough to specify an Copies an initial segment of a physical record, long enough to specify an
index entry uniquely. */ index entry uniquely. */
...@@ -921,14 +926,14 @@ ulint ...@@ -921,14 +926,14 @@ ulint
dict_index_get_space( dict_index_get_space(
/*=================*/ /*=================*/
/* out: space id */ /* out: space id */
dict_index_t* index); /* in: index */ const dict_index_t* index); /* in: index */
/************************************************************************* /*************************************************************************
Sets the space id of the root of the index tree. */ Sets the space id of the root of the index tree. */
UNIV_INLINE UNIV_INLINE
void void
dict_index_set_space( dict_index_set_space(
/*=================*/ /*=================*/
dict_index_t* index, /* in: index */ dict_index_t* index, /* in/out: index */
ulint space); /* in: space id */ ulint space); /* in: space id */
/************************************************************************* /*************************************************************************
Gets the page number of the root of the index tree. */ Gets the page number of the root of the index tree. */
...@@ -937,14 +942,14 @@ ulint ...@@ -937,14 +942,14 @@ ulint
dict_index_get_page( dict_index_get_page(
/*================*/ /*================*/
/* out: page number */ /* out: page number */
dict_index_t* tree); /* in: index */ const dict_index_t* tree); /* in: index */
/************************************************************************* /*************************************************************************
Sets the page number of the root of index tree. */ Sets the page number of the root of index tree. */
UNIV_INLINE UNIV_INLINE
void void
dict_index_set_page( dict_index_set_page(
/*================*/ /*================*/
dict_index_t* index, /* in: index */ dict_index_t* index, /* in/out: index */
ulint page); /* in: page number */ ulint page); /* in: page number */
/************************************************************************* /*************************************************************************
Gets the type of the index tree. */ Gets the type of the index tree. */
...@@ -953,7 +958,7 @@ ulint ...@@ -953,7 +958,7 @@ ulint
dict_index_get_type( dict_index_get_type(
/*================*/ /*================*/
/* out: type */ /* out: type */
dict_index_t* index); /* in: index */ const dict_index_t* index); /* in: index */
/************************************************************************* /*************************************************************************
Gets the read-write lock of the index tree. */ Gets the read-write lock of the index tree. */
UNIV_INLINE UNIV_INLINE
...@@ -978,7 +983,7 @@ Calculates the minimum record length in an index. */ ...@@ -978,7 +983,7 @@ Calculates the minimum record length in an index. */
ulint ulint
dict_index_calc_min_rec_len( dict_index_calc_min_rec_len(
/*========================*/ /*========================*/
dict_index_t* index); /* in: index */ const dict_index_t* index); /* in: index */
/************************************************************************* /*************************************************************************
Calculates new estimates for table and index statistics. The statistics Calculates new estimates for table and index statistics. The statistics
are used in query optimization. */ are used in query optimization. */
...@@ -986,7 +991,7 @@ are used in query optimization. */ ...@@ -986,7 +991,7 @@ are used in query optimization. */
void void
dict_update_statistics_low( dict_update_statistics_low(
/*=======================*/ /*=======================*/
dict_table_t* table, /* in: table */ dict_table_t* table, /* in/out: table */
ibool has_dict_mutex);/* in: TRUE if the caller has the ibool has_dict_mutex);/* in: TRUE if the caller has the
dictionary mutex */ dictionary mutex */
/************************************************************************* /*************************************************************************
...@@ -996,7 +1001,7 @@ are used in query optimization. */ ...@@ -996,7 +1001,7 @@ are used in query optimization. */
void void
dict_update_statistics( dict_update_statistics(
/*===================*/ /*===================*/
dict_table_t* table); /* in: table */ dict_table_t* table); /* in/out: table */
/************************************************************************ /************************************************************************
Reserves the dictionary system mutex for MySQL. */ Reserves the dictionary system mutex for MySQL. */
...@@ -1037,7 +1042,7 @@ Removes an index from the cache */ ...@@ -1037,7 +1042,7 @@ Removes an index from the cache */
void void
dict_index_remove_from_cache( dict_index_remove_from_cache(
/*=========================*/ /*=========================*/
dict_table_t* table, /* in: table */ dict_table_t* table, /* in/out: table */
dict_index_t* index); /* in, own: index */ dict_index_t* index); /* in, own: index */
/************************************************************************** /**************************************************************************
Get index by name */ Get index by name */
......
...@@ -420,8 +420,8 @@ ulint ...@@ -420,8 +420,8 @@ ulint
dict_index_get_n_ordering_defined_by_user( dict_index_get_n_ordering_defined_by_user(
/*======================================*/ /*======================================*/
/* out: number of fields */ /* out: number of fields */
dict_index_t* index) /* in: an internal representation of index const dict_index_t* index) /* in: an internal representation
(in the dictionary cache) */ of index (in the dictionary cache) */
{ {
return(index->n_user_defined_cols); return(index->n_user_defined_cols);
} }
...@@ -537,7 +537,7 @@ ulint ...@@ -537,7 +537,7 @@ ulint
dict_index_get_space( dict_index_get_space(
/*=================*/ /*=================*/
/* out: space id */ /* out: space id */
dict_index_t* index) /* in: index */ const dict_index_t* index) /* in: index */
{ {
ut_ad(index); ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
...@@ -551,7 +551,7 @@ UNIV_INLINE ...@@ -551,7 +551,7 @@ UNIV_INLINE
void void
dict_index_set_space( dict_index_set_space(
/*=================*/ /*=================*/
dict_index_t* index, /* in: index */ dict_index_t* index, /* in/out: index */
ulint space) /* in: space id */ ulint space) /* in: space id */
{ {
ut_ad(index); ut_ad(index);
...@@ -567,7 +567,7 @@ ulint ...@@ -567,7 +567,7 @@ ulint
dict_index_get_page( dict_index_get_page(
/*================*/ /*================*/
/* out: page number */ /* out: page number */
dict_index_t* index) /* in: index */ const dict_index_t* index) /* in: index */
{ {
ut_ad(index); ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
...@@ -581,7 +581,7 @@ UNIV_INLINE ...@@ -581,7 +581,7 @@ UNIV_INLINE
void void
dict_index_set_page( dict_index_set_page(
/*================*/ /*================*/
dict_index_t* index, /* in: index */ dict_index_t* index, /* in/out: index */
ulint page) /* in: page number */ ulint page) /* in: page number */
{ {
ut_ad(index); ut_ad(index);
...@@ -597,7 +597,7 @@ ulint ...@@ -597,7 +597,7 @@ ulint
dict_index_get_type( dict_index_get_type(
/*================*/ /*================*/
/* out: type */ /* out: type */
dict_index_t* index) /* in: index */ const dict_index_t* index) /* in: index */
{ {
ut_ad(index); ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N); ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
......
...@@ -322,11 +322,13 @@ rec_get_offsets_func( ...@@ -322,11 +322,13 @@ rec_get_offsets_func(
/*=================*/ /*=================*/
/* out: the new offsets */ /* out: the new offsets */
const rec_t* rec, /* in: physical record */ const rec_t* rec, /* in: physical record */
dict_index_t* index, /* in: record descriptor */ const dict_index_t* index, /* in: record descriptor */
ulint* offsets,/* in: array consisting of offsets[0] ulint* offsets,/* in/out: array consisting of
allocated elements, or an array from offsets[0] allocated elements,
rec_get_offsets(), or NULL */ or an array from rec_get_offsets(),
ulint n_fields,/* in: maximum number of initialized fields or NULL */
ulint n_fields,/* in: maximum number of
initialized fields
(ULINT_UNDEFINED if all fields) */ (ULINT_UNDEFINED if all fields) */
mem_heap_t** heap, /* in/out: memory heap */ mem_heap_t** heap, /* in/out: memory heap */
const char* file, /* in: file name where called */ const char* file, /* in: file name where called */
...@@ -343,11 +345,13 @@ rec_init_offsets() and rec_get_offsets_func(). */ ...@@ -343,11 +345,13 @@ rec_init_offsets() and rec_get_offsets_func(). */
void void
rec_init_offsets_comp_ordinary( rec_init_offsets_comp_ordinary(
/*===========================*/ /*===========================*/
const rec_t* rec, /* in: physical record in ROW_FORMAT=COMPACT */ const rec_t* rec, /* in: physical record in
ulint extra, /* in: number of bytes to reserve between ROW_FORMAT=COMPACT */
the record header and the data payload ulint extra, /* in: number of bytes to reserve
between the record header and
the data payload
(usually REC_N_NEW_EXTRA_BYTES) */ (usually REC_N_NEW_EXTRA_BYTES) */
dict_index_t* index, /* in: record descriptor */ const dict_index_t* index, /* in: record descriptor */
ulint* offsets);/* in/out: array of offsets; ulint* offsets);/* in/out: array of offsets;
in: n=rec_offs_n_fields(offsets) */ in: n=rec_offs_n_fields(offsets) */
...@@ -358,13 +362,15 @@ in the record. It can reuse a previously allocated array. */ ...@@ -358,13 +362,15 @@ in the record. It can reuse a previously allocated array. */
void void
rec_get_offsets_reverse( rec_get_offsets_reverse(
/*====================*/ /*====================*/
const byte* extra, /* in: the extra bytes of a compact record const byte* extra, /* in: the extra bytes of a
in reverse order, excluding the fixed-size compact record in reverse order,
excluding the fixed-size
REC_N_NEW_EXTRA_BYTES */ REC_N_NEW_EXTRA_BYTES */
dict_index_t* index, /* in: record descriptor */ const dict_index_t* index, /* in: record descriptor */
ulint node_ptr,/* in: nonzero=node pointer, 0=leaf node */ ulint node_ptr,/* in: nonzero=node pointer,
ulint* offsets);/* in/out: array consisting of offsets[0] 0=leaf node */
allocated elements */ ulint* offsets);/* in/out: array consisting of
offsets[0] allocated elements */
/**************************************************************** /****************************************************************
Validates offsets returned by rec_get_offsets(). */ Validates offsets returned by rec_get_offsets(). */
...@@ -585,10 +591,12 @@ rec_copy_prefix_to_buf( ...@@ -585,10 +591,12 @@ rec_copy_prefix_to_buf(
/*===================*/ /*===================*/
/* out, own: copied record */ /* out, own: copied record */
const rec_t* rec, /* in: physical record */ const rec_t* rec, /* in: physical record */
dict_index_t* index, /* in: record descriptor */ const dict_index_t* index, /* in: record descriptor */
ulint n_fields, /* in: number of fields to copy */ ulint n_fields, /* in: number of fields
to copy */
byte** buf, /* in/out: memory buffer byte** buf, /* in/out: memory buffer
for the copied prefix, or NULL */ for the copied prefix,
or NULL */
ulint* buf_size); /* in/out: buffer size */ ulint* buf_size); /* in/out: buffer size */
/**************************************************************** /****************************************************************
Folds a prefix of a physical record to a ulint. */ Folds a prefix of a physical record to a ulint. */
...@@ -679,8 +687,9 @@ rec_copy_prefix_to_dtuple( ...@@ -679,8 +687,9 @@ rec_copy_prefix_to_dtuple(
/*======================*/ /*======================*/
dtuple_t* tuple, /* out: data tuple */ dtuple_t* tuple, /* out: data tuple */
const rec_t* rec, /* in: physical record */ const rec_t* rec, /* in: physical record */
dict_index_t* index, /* in: record descriptor */ const dict_index_t* index, /* in: record descriptor */
ulint n_fields, /* in: number of fields to copy */ ulint n_fields, /* in: number of fields
to copy */
mem_heap_t* heap); /* in: memory heap */ mem_heap_t* heap); /* in: memory heap */
/******************************************************************* /*******************************************************************
Validates the consistency of a physical record. */ Validates the consistency of a physical record. */
......
...@@ -219,11 +219,13 @@ rec_init_offsets() and rec_get_offsets_func(). */ ...@@ -219,11 +219,13 @@ rec_init_offsets() and rec_get_offsets_func(). */
void void
rec_init_offsets_comp_ordinary( rec_init_offsets_comp_ordinary(
/*===========================*/ /*===========================*/
const rec_t* rec, /* in: physical record in ROW_FORMAT=COMPACT */ const rec_t* rec, /* in: physical record in
ulint extra, /* in: number of bytes to reserve between ROW_FORMAT=COMPACT */
the record header and the data payload ulint extra, /* in: number of bytes to reserve
between the record header and
the data payload
(usually REC_N_NEW_EXTRA_BYTES) */ (usually REC_N_NEW_EXTRA_BYTES) */
dict_index_t* index, /* in: record descriptor */ const dict_index_t* index, /* in: record descriptor */
ulint* offsets)/* in/out: array of offsets; ulint* offsets)/* in/out: array of offsets;
in: n=rec_offs_n_fields(offsets) */ in: n=rec_offs_n_fields(offsets) */
{ {
...@@ -330,7 +332,7 @@ void ...@@ -330,7 +332,7 @@ void
rec_init_offsets( rec_init_offsets(
/*=============*/ /*=============*/
const rec_t* rec, /* in: physical record */ const rec_t* rec, /* in: physical record */
dict_index_t* index, /* in: record descriptor */ const dict_index_t* index, /* in: record descriptor */
ulint* offsets)/* in/out: array of offsets; ulint* offsets)/* in/out: array of offsets;
in: n=rec_offs_n_fields(offsets) */ in: n=rec_offs_n_fields(offsets) */
{ {
...@@ -482,11 +484,13 @@ rec_get_offsets_func( ...@@ -482,11 +484,13 @@ rec_get_offsets_func(
/*=================*/ /*=================*/
/* out: the new offsets */ /* out: the new offsets */
const rec_t* rec, /* in: physical record */ const rec_t* rec, /* in: physical record */
dict_index_t* index, /* in: record descriptor */ const dict_index_t* index, /* in: record descriptor */
ulint* offsets,/* in/out: array consisting of offsets[0] ulint* offsets,/* in/out: array consisting of
allocated elements, or an array from offsets[0] allocated elements,
rec_get_offsets(), or NULL */ or an array from rec_get_offsets(),
ulint n_fields,/* in: maximum number of initialized fields or NULL */
ulint n_fields,/* in: maximum number of
initialized fields
(ULINT_UNDEFINED if all fields) */ (ULINT_UNDEFINED if all fields) */
mem_heap_t** heap, /* in/out: memory heap */ mem_heap_t** heap, /* in/out: memory heap */
const char* file, /* in: file name where called */ const char* file, /* in: file name where called */
...@@ -550,13 +554,15 @@ in the record. It can reuse a previously allocated array. */ ...@@ -550,13 +554,15 @@ in the record. It can reuse a previously allocated array. */
void void
rec_get_offsets_reverse( rec_get_offsets_reverse(
/*====================*/ /*====================*/
const byte* extra, /* in: the extra bytes of a compact record const byte* extra, /* in: the extra bytes of a
in reverse order, excluding the fixed-size compact record in reverse order,
excluding the fixed-size
REC_N_NEW_EXTRA_BYTES */ REC_N_NEW_EXTRA_BYTES */
dict_index_t* index, /* in: record descriptor */ const dict_index_t* index, /* in: record descriptor */
ulint node_ptr,/* in: nonzero=node pointer, 0=leaf node */ ulint node_ptr,/* in: nonzero=node pointer,
ulint* offsets)/* in/out: array consisting of offsets[0] 0=leaf node */
allocated elements */ ulint* offsets)/* in/out: array consisting of
offsets[0] allocated elements */
{ {
ulint n; ulint n;
ulint i; ulint i;
...@@ -1194,8 +1200,9 @@ rec_copy_prefix_to_dtuple( ...@@ -1194,8 +1200,9 @@ rec_copy_prefix_to_dtuple(
/*======================*/ /*======================*/
dtuple_t* tuple, /* out: data tuple */ dtuple_t* tuple, /* out: data tuple */
const rec_t* rec, /* in: physical record */ const rec_t* rec, /* in: physical record */
dict_index_t* index, /* in: record descriptor */ const dict_index_t* index, /* in: record descriptor */
ulint n_fields, /* in: number of fields to copy */ ulint n_fields, /* in: number of fields
to copy */
mem_heap_t* heap) /* in: memory heap */ mem_heap_t* heap) /* in: memory heap */
{ {
ulint i; ulint i;
...@@ -1281,10 +1288,12 @@ rec_copy_prefix_to_buf( ...@@ -1281,10 +1288,12 @@ rec_copy_prefix_to_buf(
/*===================*/ /*===================*/
/* out, own: copied record */ /* out, own: copied record */
const rec_t* rec, /* in: physical record */ const rec_t* rec, /* in: physical record */
dict_index_t* index, /* in: record descriptor */ const dict_index_t* index, /* in: record descriptor */
ulint n_fields, /* in: number of fields to copy */ ulint n_fields, /* in: number of fields
to copy */
byte** buf, /* in/out: memory buffer byte** buf, /* in/out: memory buffer
for the copied prefix, or NULL */ for the copied prefix,
or NULL */
ulint* buf_size) /* in/out: buffer size */ ulint* buf_size) /* in/out: buffer size */
{ {
const byte* nulls; const byte* nulls;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment