summaryrefslogtreecommitdiff
path: root/storage/myisam
diff options
context:
space:
mode:
authorAlexey Kopytov <Alexey.Kopytov@Sun.com>2010-03-12 12:51:53 +0300
committerAlexey Kopytov <Alexey.Kopytov@Sun.com>2010-03-12 12:51:53 +0300
commitdbbdc4b19691711c82e42c4def5f5325759524c4 (patch)
tree1d8062b6d5a8ab72361ee3021277a00ca8c6acf1 /storage/myisam
parent6e7b8b6a7ab2b58016403304b1c49cf908a6479d (diff)
parentb182c9bd2030c3b3c548157d1bc4c01c306b2c5c (diff)
downloadmariadb-git-dbbdc4b19691711c82e42c4def5f5325759524c4.tar.gz
Manual merge of mysql-5.1-bugteam to mysql-trunk-merge.
Conflicts: Text conflict in client/mysqlbinlog.cc Text conflict in mysql-test/r/explain.result Text conflict in mysql-test/r/subselect.result Text conflict in mysql-test/r/subselect3.result Text conflict in mysql-test/r/type_datetime.result Text conflict in sql/share/Makefile.am
Diffstat (limited to 'storage/myisam')
-rw-r--r--storage/myisam/ha_myisam.cc14
-rw-r--r--storage/myisam/rt_index.c22
2 files changed, 21 insertions, 15 deletions
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index 612d02bbcd3..0df9bff46f3 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -1449,9 +1449,17 @@ int ha_myisam::enable_indexes(uint mode)
{
sql_print_warning("Warning: Enabling keys got errno %d on %s.%s, retrying",
my_errno, param.db_name, param.table_name);
- /* Repairing by sort failed. Now try standard repair method. */
- param.testflag&= ~(T_REP_BY_SORT | T_QUICK);
- error= (repair(thd,param,0) != HA_ADMIN_OK);
+ /*
+ Repairing by sort failed. Now try standard repair method.
+ Still we want to fix only index file. If data file corruption
+ was detected (T_RETRY_WITHOUT_QUICK), we shouldn't do much here.
+ Let implicit repair do this job.
+ */
+ if (!(param.testflag & T_RETRY_WITHOUT_QUICK))
+ {
+ param.testflag&= ~T_REP_BY_SORT;
+ error= (repair(thd,param,0) != HA_ADMIN_OK);
+ }
/*
If the standard repair succeeded, clear all error messages which
might have been set by the first repair. They can still be seen
diff --git a/storage/myisam/rt_index.c b/storage/myisam/rt_index.c
index e094c302f92..31241a83228 100644
--- a/storage/myisam/rt_index.c
+++ b/storage/myisam/rt_index.c
@@ -404,10 +404,16 @@ int rtree_get_first(MI_INFO *info, uint keynr, uint key_length)
int rtree_get_next(MI_INFO *info, uint keynr, uint key_length)
{
- my_off_t root;
+ my_off_t root= info->s->state.key_root[keynr];
MI_KEYDEF *keyinfo = info->s->keyinfo + keynr;
- if (!info->buff_used)
+ if (root == HA_OFFSET_ERROR)
+ {
+ my_errno= HA_ERR_END_OF_FILE;
+ return -1;
+ }
+
+ if (!info->buff_used && !info->page_changed)
{
uint k_len = keyinfo->keylength - info->s->base.rec_reflength;
/* rt_PAGE_NEXT_KEY(info->int_keypos) */
@@ -428,16 +434,8 @@ int rtree_get_next(MI_INFO *info, uint keynr, uint key_length)
return 0;
}
- else
- {
- if ((root = info->s->state.key_root[keynr]) == HA_OFFSET_ERROR)
- {
- my_errno= HA_ERR_END_OF_FILE;
- return -1;
- }
-
- return rtree_get_req(info, keyinfo, key_length, root, 0);
- }
+
+ return rtree_get_req(info, keyinfo, key_length, root, 0);
}