diff options
author | Alexey Kopytov <Alexey.Kopytov@Sun.com> | 2010-04-03 12:37:53 +0400 |
---|---|---|
committer | Alexey Kopytov <Alexey.Kopytov@Sun.com> | 2010-04-03 12:37:53 +0400 |
commit | 3678231d5a57e9d36056b75cc29023a376a3cb75 (patch) | |
tree | 2e84ff7f9e6dcd233caa9e22272a48ae20c5209a /storage/archive | |
parent | 5a59d706be5f38768fc861388d92c0f985a5fa1a (diff) | |
parent | 3569fe776fbaf0a750b054b0684d37d7cefeaa94 (diff) | |
download | mariadb-git-3678231d5a57e9d36056b75cc29023a376a3cb75.tar.gz |
Manual merge of mysql-5.1-bugteam into mysql-trunk-merge.
Conflicts:
Text conflict in mysql-test/r/partition.result
Text conflict in mysql-test/t/partition.test
Text conflict in storage/myisam/mi_dynrec.c
Diffstat (limited to 'storage/archive')
-rw-r--r-- | storage/archive/ha_archive.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc index f95a7252f2f..527362ef138 100644 --- a/storage/archive/ha_archive.cc +++ b/storage/archive/ha_archive.cc @@ -1324,13 +1324,12 @@ end: /* This method repairs the meta file. It does this by walking the datafile and - rewriting the meta file. Currently it does this by calling optimize with - the extended flag. + rewriting the meta file. If EXTENDED repair is requested, we attempt to + recover as much data as possible. */ int ha_archive::repair(THD* thd, HA_CHECK_OPT* check_opt) { DBUG_ENTER("ha_archive::repair"); - check_opt->flags= T_EXTEND; int rc= optimize(thd, check_opt); if (rc) @@ -1424,7 +1423,14 @@ int ha_archive::optimize(THD* thd, HA_CHECK_OPT* check_opt) DBUG_PRINT("ha_archive", ("recovered %llu archive rows", (unsigned long long)share->rows_recorded)); - if (rc && rc != HA_ERR_END_OF_FILE) + /* + If REPAIR ... EXTENDED is requested, try to recover as much data + from data file as possible. In this case if we failed to read a + record, we assume EOF. This allows massive data loss, but we can + hardly do more with broken zlib stream. And this is the only way + to restore at least what is still recoverable. + */ + if (rc && rc != HA_ERR_END_OF_FILE && !(check_opt->flags & T_EXTEND)) goto error; } |