diff options
Diffstat (limited to 'innobase/include')
-rw-r--r-- | innobase/include/btr0btr.h | 13 | ||||
-rw-r--r-- | innobase/include/btr0pcur.h | 8 | ||||
-rw-r--r-- | innobase/include/btr0pcur.ic | 18 | ||||
-rw-r--r-- | innobase/include/db0err.h | 3 |
4 files changed, 41 insertions, 1 deletions
diff --git a/innobase/include/btr0btr.h b/innobase/include/btr0btr.h index f66ad3639d4..3cd44ab5175 100644 --- a/innobase/include/btr0btr.h +++ b/innobase/include/btr0btr.h @@ -399,6 +399,19 @@ btr_print_tree( dict_tree_t* tree, /* in: tree */ ulint width); /* in: print this many entries from start and end */ +/**************************************************************** +Checks the size and number of fields in a record based on the definition of +the index. */ + +ibool +btr_index_rec_validate( +/*====================*/ + /* out: TRUE if ok */ + rec_t* rec, /* in: index record */ + dict_index_t* index, /* in: index */ + ibool dump_on_error); /* in: TRUE if the function + should print hex dump of record + and page on error */ /****************************************************************** Checks the consistency of an index tree. */ diff --git a/innobase/include/btr0pcur.h b/innobase/include/btr0pcur.h index 05b55e4491d..9d07dd0de18 100644 --- a/innobase/include/btr0pcur.h +++ b/innobase/include/btr0pcur.h @@ -298,6 +298,14 @@ btr_pcur_move_to_prev( function may release the page latch */ mtr_t* mtr); /* in: mtr */ /************************************************************* +Moves the persistent cursor to the last record on the same page. */ +UNIV_INLINE +void +btr_pcur_move_to_last_on_page( +/*==========================*/ + btr_pcur_t* cursor, /* in: persistent cursor */ + mtr_t* mtr); /* in: mtr */ +/************************************************************* Moves the persistent cursor to the next user record in the tree. If no user records are left, the cursor ends up 'after last in tree'. */ UNIV_INLINE diff --git a/innobase/include/btr0pcur.ic b/innobase/include/btr0pcur.ic index a60140e4aa9..a1db2cc52dd 100644 --- a/innobase/include/btr0pcur.ic +++ b/innobase/include/btr0pcur.ic @@ -285,6 +285,24 @@ btr_pcur_move_to_prev_on_page( } /************************************************************* +Moves the persistent cursor to the last record on the same page. */ +UNIV_INLINE +void +btr_pcur_move_to_last_on_page( +/*==========================*/ + btr_pcur_t* cursor, /* in: persistent cursor */ + mtr_t* mtr) /* in: mtr */ +{ + UT_NOT_USED(mtr); + ut_ad(cursor->latch_mode != BTR_NO_LATCHES); + + page_cur_set_after_last(buf_frame_align(btr_pcur_get_rec(cursor)), + btr_pcur_get_page_cur(cursor)); + + cursor->old_stored = BTR_PCUR_OLD_NOT_STORED; +} + +/************************************************************* Moves the persistent cursor to the next user record in the tree. If no user records are left, the cursor ends up 'after last in tree'. */ UNIV_INLINE diff --git a/innobase/include/db0err.h b/innobase/include/db0err.h index ddfbd5b7862..86b79b65bf2 100644 --- a/innobase/include/db0err.h +++ b/innobase/include/db0err.h @@ -41,7 +41,8 @@ Created 5/24/1996 Heikki Tuuri which is referenced */ #define DB_CANNOT_ADD_CONSTRAINT 38 /* adding a foreign key constraint to a table failed */ - +#define DB_CORRUPTION 39 /* data structure corruption noticed */ + /* The following are partial failure codes */ #define DB_FAIL 1000 #define DB_OVERFLOW 1001 |