summaryrefslogtreecommitdiff
path: root/storage/innobase/dict/dict0load.c
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@oracle.com>2010-06-22 13:42:39 +0300
committerMarko Mäkelä <marko.makela@oracle.com>2010-06-22 13:42:39 +0300
commit2ec45a26b63b443c0814decd826e0739d9c85e1c (patch)
tree62ae0f7320884efa1db6ae45e8612fd45a4c3303 /storage/innobase/dict/dict0load.c
parentd860510452fd7a86a83d7d81f5c3a2cb76f5ef10 (diff)
downloadmariadb-git-2ec45a26b63b443c0814decd826e0739d9c85e1c.tar.gz
dict_load_column_low(): Initialize pos. Improve documentation.
Approved by Jimmy Yang.
Diffstat (limited to 'storage/innobase/dict/dict0load.c')
-rw-r--r--storage/innobase/dict/dict0load.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/storage/innobase/dict/dict0load.c b/storage/innobase/dict/dict0load.c
index 949c10264d9..b998b157d19 100644
--- a/storage/innobase/dict/dict0load.c
+++ b/storage/innobase/dict/dict0load.c
@@ -782,12 +782,13 @@ const char*
dict_load_column_low(
/*=================*/
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
a SYS_COLUMNS record */
mem_heap_t* heap, /*!< in/out: memory heap
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 */
const char** col_name, /*!< out: column name */
const rec_t* rec) /*!< in: SYS_COLUMNS record */
@@ -800,6 +801,8 @@ dict_load_column_low(
ulint col_len;
ulint pos;
+ ut_ad(table || column);
+
if (UNIV_UNLIKELY(rec_get_deleted_flag(rec, 0))) {
return("delete-marked record in SYS_COLUMNS");
}
@@ -827,9 +830,9 @@ err_len:
goto err_len;
}
- if (!table) {
- pos = mach_read_from_4(field);
- } else if (UNIV_UNLIKELY(table->n_def != mach_read_from_4(field))) {
+ pos = mach_read_from_4(field);
+
+ if (UNIV_UNLIKELY(table && table->n_def != pos)) {
return("SYS_COLUMNS.POS mismatch");
}