Commit 5c9122e7 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 a4cc4700
......@@ -309,7 +309,7 @@ Decrements the count of open MySQL handles to a table. */
void
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 */
{
if (!dict_locked) {
......@@ -363,7 +363,7 @@ Acquire the autoinc lock.*/
void
dict_table_autoinc_lock(
/*====================*/
dict_table_t* table)
dict_table_t* table) /* in/out: table */
{
mutex_enter(&table->autoinc_mutex);
}
......@@ -375,7 +375,7 @@ initialized counter. */
void
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 */
{
table->autoinc_inited = TRUE;
......@@ -390,7 +390,7 @@ ib_longlong
dict_table_autoinc_read(
/*====================*/
/* out: value for a new row, or 0 */
dict_table_t* table) /* in: table */
const dict_table_t* table) /* in: table */
{
ib_longlong value;
......@@ -412,7 +412,7 @@ void
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 */
{
if (table->autoinc_inited && value > table->autoinc) {
......@@ -427,7 +427,7 @@ Release the autoinc lock.*/
void
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);
}
......@@ -507,9 +507,9 @@ Returns TRUE if the index contains a column or a prefix of that column. */
ibool
dict_index_contains_col_or_prefix(
/*==============================*/
/* out: TRUE if contains the column or its
prefix */
dict_index_t* index, /* in: index */
/* out: TRUE if contains the column
or its prefix */
const dict_index_t* index, /* in: index */
ulint n) /* in: column number */
{
const dict_field_t* field;
......@@ -550,15 +550,16 @@ from the prefix in index. */
ulint
dict_index_get_nth_field_pos(
/*=========================*/
/* out: position in internal representation
of the index; if not contained, returns
/* out: position in internal
representation of the index;
if not contained, returns
ULINT_UNDEFINED */
dict_index_t* index, /* in: index from which to search */
dict_index_t* index2, /* in: index */
const dict_index_t* index, /* in: index from which to search */
const dict_index_t* index2, /* in: index */
ulint n) /* in: field number in index2 */
{
dict_field_t* field;
dict_field_t* field2;
const dict_field_t* field;
const dict_field_t* field2;
ulint n_fields;
ulint pos;
......@@ -624,9 +625,10 @@ Looks for column n position in the clustered index. */
ulint
dict_table_get_nth_col_pos(
/*=======================*/
/* out: position in internal representation
of the clustered index */
dict_table_t* table, /* in: table */
/* out: position in internal
representation of
the clustered index */
const dict_table_t* table, /* in: table */
ulint n) /* in: column number */
{
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. */
ibool
dict_table_col_in_clustered_key(
/*============================*/
/* out: TRUE if the column, or its prefix, is
in the clustered key */
dict_table_t* table, /* in: table */
/* out: TRUE if the column, or its
prefix, is in the clustered key */
const dict_table_t* table, /* in: table */
ulint n) /* in: column number */
{
dict_index_t* index;
const dict_index_t* index;
const dict_field_t* field;
const dict_col_t* col;
ulint pos;
......@@ -903,7 +905,7 @@ ibool
dict_table_rename_in_cache(
/*=======================*/
/* out: TRUE if success */
dict_table_t* table, /* in: table */
dict_table_t* table, /* in/out: table */
const char* new_name, /* in: new name */
ibool rename_also_foreigns)/* in: in ALTER TABLE we want
to preserve the original table name
......@@ -1119,7 +1121,7 @@ DISCARD TABLESPACE. */
void
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 */
{
ut_ad(table);
......@@ -1329,7 +1331,7 @@ Removes an index from the dictionary cache. */
void
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 */
{
ulint size;
......@@ -1396,8 +1398,8 @@ Adds a column to index. */
void
dict_index_add_col(
/*===============*/
dict_index_t* index, /* in: index */
dict_table_t* table, /* in: table */
dict_index_t* index, /* in/out: index */
const dict_table_t* table, /* in: table */
dict_col_t* col, /* in: column */
ulint prefix_len) /* in: column prefix length */
{
......@@ -3604,7 +3606,7 @@ ibool
dict_index_check_search_tuple(
/*==========================*/
/* 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 */
{
ut_a(index);
......@@ -3621,13 +3623,15 @@ dtuple_t*
dict_index_build_node_ptr(
/*======================*/
/* out, own: node pointer */
dict_index_t* index, /* in: index tree */
rec_t* rec, /* in: record for which to build node
const dict_index_t* index, /* in: index */
const rec_t* rec, /* in: record for which to build node
pointer */
ulint page_no,/* in: page number to put in node
pointer */
ulint page_no,/* in: page number to put in node pointer */
mem_heap_t* heap, /* in: memory heap where pointer created */
ulint level) /* in: level of rec in tree: 0 means leaf
level */
mem_heap_t* heap, /* in: memory heap where pointer
created */
ulint level) /* in: level of rec in tree:
0 means leaf level */
{
dtuple_t* tuple;
dfield_t* field;
......@@ -3745,7 +3749,7 @@ Calculates the minimum record length in an index. */
ulint
dict_index_calc_min_rec_len(
/*========================*/
dict_index_t* index) /* in: index */
const dict_index_t* index) /* in: index */
{
ulint sum = 0;
ulint i;
......@@ -3796,7 +3800,7 @@ are used in query optimization. */
void
dict_update_statistics_low(
/*=======================*/
dict_table_t* table, /* in: table */
dict_table_t* table, /* in/out: table */
ibool has_dict_mutex __attribute__((unused)))
/* in: TRUE if the caller has the
dictionary mutex */
......@@ -3880,7 +3884,7 @@ are used in query optimization. */
void
dict_update_statistics(
/*===================*/
dict_table_t* table) /* in: table */
dict_table_t* table) /* in/out: table */
{
dict_update_statistics_low(table, FALSE);
}
......@@ -4456,20 +4460,21 @@ dict_table_get_index_by_max_id(
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] */
#ifdef UNIV_DEBUG
void
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
as to be dropped */
dict_index_t* index1;
dict_index_t* index2;
const dict_index_t* index1;
const dict_index_t* index2;
/* The primary index _must_ exist */
ut_a(UT_LIST_GET_LEN(table->indexes) > 0);
......
This diff is collapsed.
......@@ -420,8 +420,8 @@ ulint
dict_index_get_n_ordering_defined_by_user(
/*======================================*/
/* out: number of fields */
dict_index_t* index) /* in: an internal representation of index
(in the dictionary cache) */
const dict_index_t* index) /* in: an internal representation
of index (in the dictionary cache) */
{
return(index->n_user_defined_cols);
}
......@@ -537,7 +537,7 @@ ulint
dict_index_get_space(
/*=================*/
/* out: space id */
dict_index_t* index) /* in: index */
const dict_index_t* index) /* in: index */
{
ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
......@@ -551,7 +551,7 @@ UNIV_INLINE
void
dict_index_set_space(
/*=================*/
dict_index_t* index, /* in: index */
dict_index_t* index, /* in/out: index */
ulint space) /* in: space id */
{
ut_ad(index);
......@@ -567,7 +567,7 @@ ulint
dict_index_get_page(
/*================*/
/* out: page number */
dict_index_t* index) /* in: index */
const dict_index_t* index) /* in: index */
{
ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
......@@ -581,7 +581,7 @@ UNIV_INLINE
void
dict_index_set_page(
/*================*/
dict_index_t* index, /* in: index */
dict_index_t* index, /* in/out: index */
ulint page) /* in: page number */
{
ut_ad(index);
......@@ -597,7 +597,7 @@ ulint
dict_index_get_type(
/*================*/
/* out: type */
dict_index_t* index) /* in: index */
const dict_index_t* index) /* in: index */
{
ut_ad(index);
ut_ad(index->magic_n == DICT_INDEX_MAGIC_N);
......
......@@ -322,11 +322,13 @@ rec_get_offsets_func(
/*=================*/
/* out: the new offsets */
const rec_t* rec, /* in: physical record */
dict_index_t* index, /* in: record descriptor */
ulint* offsets,/* in: array consisting of offsets[0]
allocated elements, or an array from
rec_get_offsets(), or NULL */
ulint n_fields,/* in: maximum number of initialized fields
const dict_index_t* index, /* in: record descriptor */
ulint* offsets,/* in/out: array consisting of
offsets[0] allocated elements,
or an array from rec_get_offsets(),
or NULL */
ulint n_fields,/* in: maximum number of
initialized fields
(ULINT_UNDEFINED if all fields) */
mem_heap_t** heap, /* in/out: memory heap */
const char* file, /* in: file name where called */
......@@ -343,11 +345,13 @@ rec_init_offsets() and rec_get_offsets_func(). */
void
rec_init_offsets_comp_ordinary(
/*===========================*/
const rec_t* rec, /* in: physical record in ROW_FORMAT=COMPACT */
ulint extra, /* in: number of bytes to reserve between
the record header and the data payload
const rec_t* rec, /* in: physical record in
ROW_FORMAT=COMPACT */
ulint extra, /* in: number of bytes to reserve
between the record header and
the data payload
(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;
in: n=rec_offs_n_fields(offsets) */
......@@ -358,13 +362,15 @@ in the record. It can reuse a previously allocated array. */
void
rec_get_offsets_reverse(
/*====================*/
const byte* extra, /* in: the extra bytes of a compact record
in reverse order, excluding the fixed-size
const byte* extra, /* in: the extra bytes of a
compact record in reverse order,
excluding the fixed-size
REC_N_NEW_EXTRA_BYTES */
dict_index_t* index, /* in: record descriptor */
ulint node_ptr,/* in: nonzero=node pointer, 0=leaf node */
ulint* offsets);/* in/out: array consisting of offsets[0]
allocated elements */
const dict_index_t* index, /* in: record descriptor */
ulint node_ptr,/* in: nonzero=node pointer,
0=leaf node */
ulint* offsets);/* in/out: array consisting of
offsets[0] allocated elements */
/****************************************************************
Validates offsets returned by rec_get_offsets(). */
......@@ -585,10 +591,12 @@ rec_copy_prefix_to_buf(
/*===================*/
/* out, own: copied record */
const rec_t* rec, /* in: physical record */
dict_index_t* index, /* in: record descriptor */
ulint n_fields, /* in: number of fields to copy */
const dict_index_t* index, /* in: record descriptor */
ulint n_fields, /* in: number of fields
to copy */
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 */
/****************************************************************
Folds a prefix of a physical record to a ulint. */
......@@ -679,8 +687,9 @@ rec_copy_prefix_to_dtuple(
/*======================*/
dtuple_t* tuple, /* out: data tuple */
const rec_t* rec, /* in: physical record */
dict_index_t* index, /* in: record descriptor */
ulint n_fields, /* in: number of fields to copy */
const dict_index_t* index, /* in: record descriptor */
ulint n_fields, /* in: number of fields
to copy */
mem_heap_t* heap); /* in: memory heap */
/*******************************************************************
Validates the consistency of a physical record. */
......
......@@ -219,11 +219,13 @@ rec_init_offsets() and rec_get_offsets_func(). */
void
rec_init_offsets_comp_ordinary(
/*===========================*/
const rec_t* rec, /* in: physical record in ROW_FORMAT=COMPACT */
ulint extra, /* in: number of bytes to reserve between
the record header and the data payload
const rec_t* rec, /* in: physical record in
ROW_FORMAT=COMPACT */
ulint extra, /* in: number of bytes to reserve
between the record header and
the data payload
(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;
in: n=rec_offs_n_fields(offsets) */
{
......@@ -330,7 +332,7 @@ void
rec_init_offsets(
/*=============*/
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;
in: n=rec_offs_n_fields(offsets) */
{
......@@ -482,11 +484,13 @@ rec_get_offsets_func(
/*=================*/
/* out: the new offsets */
const rec_t* rec, /* in: physical record */
dict_index_t* index, /* in: record descriptor */
ulint* offsets,/* in/out: array consisting of offsets[0]
allocated elements, or an array from
rec_get_offsets(), or NULL */
ulint n_fields,/* in: maximum number of initialized fields
const dict_index_t* index, /* in: record descriptor */
ulint* offsets,/* in/out: array consisting of
offsets[0] allocated elements,
or an array from rec_get_offsets(),
or NULL */
ulint n_fields,/* in: maximum number of
initialized fields
(ULINT_UNDEFINED if all fields) */
mem_heap_t** heap, /* in/out: memory heap */
const char* file, /* in: file name where called */
......@@ -550,13 +554,15 @@ in the record. It can reuse a previously allocated array. */
void
rec_get_offsets_reverse(
/*====================*/
const byte* extra, /* in: the extra bytes of a compact record
in reverse order, excluding the fixed-size
const byte* extra, /* in: the extra bytes of a
compact record in reverse order,
excluding the fixed-size
REC_N_NEW_EXTRA_BYTES */
dict_index_t* index, /* in: record descriptor */
ulint node_ptr,/* in: nonzero=node pointer, 0=leaf node */
ulint* offsets)/* in/out: array consisting of offsets[0]
allocated elements */
const dict_index_t* index, /* in: record descriptor */
ulint node_ptr,/* in: nonzero=node pointer,
0=leaf node */
ulint* offsets)/* in/out: array consisting of
offsets[0] allocated elements */
{
ulint n;
ulint i;
......@@ -1194,8 +1200,9 @@ rec_copy_prefix_to_dtuple(
/*======================*/
dtuple_t* tuple, /* out: data tuple */
const rec_t* rec, /* in: physical record */
dict_index_t* index, /* in: record descriptor */
ulint n_fields, /* in: number of fields to copy */
const dict_index_t* index, /* in: record descriptor */
ulint n_fields, /* in: number of fields
to copy */
mem_heap_t* heap) /* in: memory heap */
{
ulint i;
......@@ -1281,10 +1288,12 @@ rec_copy_prefix_to_buf(
/*===================*/
/* out, own: copied record */
const rec_t* rec, /* in: physical record */
dict_index_t* index, /* in: record descriptor */
ulint n_fields, /* in: number of fields to copy */
const dict_index_t* index, /* in: record descriptor */
ulint n_fields, /* in: number of fields
to copy */
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 */
{
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