Commit 332a41ce authored by Marko Mäkelä's avatar Marko Mäkelä

A non-functional change:

dict_load_index_low(): Rename the parameter "cached" to "allocated"
and clarify the comments.
parent 793dee2d
...@@ -1175,23 +1175,23 @@ static const char* dict_load_index_id_err = "SYS_INDEXES.TABLE_ID mismatch"; ...@@ -1175,23 +1175,23 @@ static const char* dict_load_index_id_err = "SYS_INDEXES.TABLE_ID mismatch";
/********************************************************************//** /********************************************************************//**
Loads an index definition from a SYS_INDEXES record to dict_index_t. Loads an index definition from a SYS_INDEXES record to dict_index_t.
If "cached" is set to "TRUE", we will create a dict_index_t structure If allocate=TRUE, we will create a dict_index_t structure and fill it
and fill it accordingly. Otherwise, the dict_index_t will accordingly. If allocated=FALSE, the dict_index_t will be supplied by
be supplied by the caller and filled with information read from the caller and filled with information read from the record. @return
the record. error message, or NULL on success */
@return error message, or NULL on success */
UNIV_INTERN UNIV_INTERN
const char* const char*
dict_load_index_low( dict_load_index_low(
/*================*/ /*================*/
byte* table_id, /*!< in/out: table id (8 bytes), byte* table_id, /*!< in/out: table id (8 bytes),
an "in" value if cached=TRUE an "in" value if allocate=TRUE
and "out" when cached=FALSE */ and "out" when allocate=FALSE */
const char* table_name, /*!< in: table name */ const char* table_name, /*!< in: table name */
mem_heap_t* heap, /*!< in/out: temporary memory heap */ mem_heap_t* heap, /*!< in/out: temporary memory heap */
const rec_t* rec, /*!< in: SYS_INDEXES record */ const rec_t* rec, /*!< in: SYS_INDEXES record */
ibool cached, /*!< in: TRUE = add to cache, ibool allocate, /*!< in: TRUE=allocate *index,
FALSE = do not */ FALSE=fill in a pre-allocated
*index */
dict_index_t** index) /*!< out,own: index, or NULL */ dict_index_t** index) /*!< out,own: index, or NULL */
{ {
const byte* field; const byte* field;
...@@ -1203,8 +1203,8 @@ dict_load_index_low( ...@@ -1203,8 +1203,8 @@ dict_load_index_low(
ulint type; ulint type;
ulint space; ulint space;
if (cached) { if (allocate) {
/* If "cached" is set to TRUE, no dict_index_t will /* If allocate=TRUE, no dict_index_t will
be supplied. Initialize "*index" to NULL */ be supplied. Initialize "*index" to NULL */
*index = NULL; *index = NULL;
} }
...@@ -1223,7 +1223,7 @@ err_len: ...@@ -1223,7 +1223,7 @@ err_len:
return("incorrect column length in SYS_INDEXES"); return("incorrect column length in SYS_INDEXES");
} }
if (!cached) { if (!allocate) {
/* We are reading a SYS_INDEXES record. Copy the table_id */ /* We are reading a SYS_INDEXES record. Copy the table_id */
memcpy(table_id, (const char*)field, 8); memcpy(table_id, (const char*)field, 8);
} else if (memcmp(field, table_id, 8)) { } else if (memcmp(field, table_id, 8)) {
...@@ -1279,7 +1279,7 @@ err_len: ...@@ -1279,7 +1279,7 @@ err_len:
goto err_len; goto err_len;
} }
if (cached) { if (allocate) {
*index = dict_mem_index_create(table_name, name_buf, *index = dict_mem_index_create(table_name, name_buf,
space, type, n_fields); space, type, n_fields);
} else { } else {
......
...@@ -116,19 +116,23 @@ dict_load_column_low( ...@@ -116,19 +116,23 @@ dict_load_column_low(
const rec_t* rec); /*!< in: SYS_COLUMNS record */ const rec_t* rec); /*!< in: SYS_COLUMNS record */
/********************************************************************//** /********************************************************************//**
Loads an index definition from a SYS_INDEXES record to dict_index_t. Loads an index definition from a SYS_INDEXES record to dict_index_t.
@return error message, or NULL on success */ If allocate=TRUE, we will create a dict_index_t structure and fill it
accordingly. If allocated=FALSE, the dict_index_t will be supplied by
the caller and filled with information read from the record. @return
error message, or NULL on success */
UNIV_INTERN UNIV_INTERN
const char* const char*
dict_load_index_low( dict_load_index_low(
/*================*/ /*================*/
byte* table_id, /*!< in/out: table id (8 bytes_, byte* table_id, /*!< in/out: table id (8 bytes),
an "in" value if cached=TRUE an "in" value if allocate=TRUE
and "out" when cached=FALSE */ and "out" when allocate=FALSE */
const char* table_name, /*!< in: table name */ const char* table_name, /*!< in: table name */
mem_heap_t* heap, /*!< in/out: temporary memory heap */ mem_heap_t* heap, /*!< in/out: temporary memory heap */
const rec_t* rec, /*!< in: SYS_INDEXES record */ const rec_t* rec, /*!< in: SYS_INDEXES record */
ibool cached, /*!< in: TRUE = add to cache ibool allocate, /*!< in: TRUE=allocate *index,
FALSE = do not */ FALSE=fill in a pre-allocated
*index */
dict_index_t** index); /*!< out,own: index, or NULL */ dict_index_t** index); /*!< out,own: index, or NULL */
/********************************************************************//** /********************************************************************//**
Loads an index field definition from a SYS_FIELDS record to Loads an index field definition from a SYS_FIELDS record to
......
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