diff options
author | unknown <heikki@hundin.mysql.fi> | 2002-07-25 22:51:43 +0300 |
---|---|---|
committer | unknown <heikki@hundin.mysql.fi> | 2002-07-25 22:51:43 +0300 |
commit | cdddb960be6251fedc6d0f8c2309d898039d7a7b (patch) | |
tree | 537b1f6b8c9385140a81d8e047ffa46a762ae91d /innobase | |
parent | 48e5aa8b2af17874c43b5fe9d1db6753a2c49654 (diff) | |
download | mariadb-git-cdddb960be6251fedc6d0f8c2309d898039d7a7b.tar.gz |
row0vers.c:
Add diagnostic code to track a probable table corruption reported by a user
innobase/row/row0vers.c:
Add diagnostic code to track a probable table corruption reported by a user
Diffstat (limited to 'innobase')
-rw-r--r-- | innobase/row/row0vers.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/innobase/row/row0vers.c b/innobase/row/row0vers.c index 9508e73f45d..cd8b18e5e12 100644 --- a/innobase/row/row0vers.c +++ b/innobase/row/row0vers.c @@ -58,6 +58,7 @@ row_vers_impl_x_locked_off_kernel( ibool rec_del; ulint err; mtr_t mtr; + char err_buf[1000]; ut_ad(mutex_own(&kernel_mutex)); ut_ad(!rw_lock_own(&(purge_sys->latch), RW_LOCK_SHARED)); @@ -74,7 +75,26 @@ row_vers_impl_x_locked_off_kernel( clust_rec = row_get_clust_rec(BTR_SEARCH_LEAF, rec, index, &clust_index, &mtr); - ut_a(clust_rec); + if (!clust_rec) { + rec_sprintf(err_buf, 900, rec); + + ut_print_timestamp(stderr); + fprintf(stderr, +" InnoDB: Error: cannot find the clustered index record\n" +"InnoDB: for a secondary index record in table %s index %s.\n" +"InnoDB: Secondary index record %s.\n" +"InnoDB: The table is probably corrupt. Please run CHECK TABLE on it.\n" +"InnoDB: You can try to repair the table by dump + drop + reimport.\n" +"InnoDB: Send a detailed bug report to mysql@lists.mysql.com.\n", + index->table_name, index->name, err_buf); + mutex_enter(&kernel_mutex); + mtr_commit(&mtr); + + /* We assume there is no lock on the record, though this + is not certain because the table is apparently corrupt */ + + return(NULL); + } trx_id = row_get_rec_trx_id(clust_rec, clust_index); |