Commit 84b51676 authored by Marko Mäkelä's avatar Marko Mäkelä

dict_load_column_low(): Initialize pos. Improve documentation.

Approved by Jimmy Yang.
parent 72e5d2ae
...@@ -782,12 +782,13 @@ const char* ...@@ -782,12 +782,13 @@ const char*
dict_load_column_low( dict_load_column_low(
/*=================*/ /*=================*/
dict_table_t* table, /*!< in/out: table, could be NULL dict_table_t* table, /*!< in/out: table, could be NULL
if we just polulate a dict_column_t if we just populate a dict_column_t
struct with information from struct with information from
a SYS_COLUMNS record */ a SYS_COLUMNS record */
mem_heap_t* heap, /*!< in/out: memory heap mem_heap_t* heap, /*!< in/out: memory heap
for temporary storage */ for temporary storage */
dict_col_t* column, /*!< out: dict_column_t to fill */ dict_col_t* column, /*!< out: dict_column_t to fill,
or NULL if table != NULL */
dulint* table_id, /*!< out: table id */ dulint* table_id, /*!< out: table id */
const char** col_name, /*!< out: column name */ const char** col_name, /*!< out: column name */
const rec_t* rec) /*!< in: SYS_COLUMNS record */ const rec_t* rec) /*!< in: SYS_COLUMNS record */
...@@ -800,6 +801,8 @@ dict_load_column_low( ...@@ -800,6 +801,8 @@ dict_load_column_low(
ulint col_len; ulint col_len;
ulint pos; ulint pos;
ut_ad(table || column);
if (UNIV_UNLIKELY(rec_get_deleted_flag(rec, 0))) { if (UNIV_UNLIKELY(rec_get_deleted_flag(rec, 0))) {
return("delete-marked record in SYS_COLUMNS"); return("delete-marked record in SYS_COLUMNS");
} }
...@@ -827,9 +830,9 @@ dict_load_column_low( ...@@ -827,9 +830,9 @@ dict_load_column_low(
goto err_len; goto err_len;
} }
if (!table) { pos = mach_read_from_4(field);
pos = mach_read_from_4(field);
} else if (UNIV_UNLIKELY(table->n_def != mach_read_from_4(field))) { if (UNIV_UNLIKELY(table && table->n_def != pos)) {
return("SYS_COLUMNS.POS mismatch"); return("SYS_COLUMNS.POS mismatch");
} }
......
...@@ -109,7 +109,8 @@ dict_load_column_low( ...@@ -109,7 +109,8 @@ dict_load_column_low(
a SYS_COLUMNS record */ a SYS_COLUMNS record */
mem_heap_t* heap, /*!< in/out: memory heap mem_heap_t* heap, /*!< in/out: memory heap
for temporary storage */ for temporary storage */
dict_col_t* column, /*!< out: dict_column_t to fill */ dict_col_t* column, /*!< out: dict_column_t to fill,
or NULL if table != NULL */
dulint* table_id, /*!< out: table id */ dulint* table_id, /*!< out: table id */
const char** col_name, /*!< out: column name */ const char** col_name, /*!< out: column name */
const rec_t* rec); /*!< in: SYS_COLUMNS record */ const rec_t* rec); /*!< in: SYS_COLUMNS record */
......
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