summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <serg@serg.mysql.com>2002-11-14 22:39:46 +0100
committerunknown <serg@serg.mysql.com>2002-11-14 22:39:46 +0100
commit4ebb96c6b1973937e743a674ad4f28386f8abca7 (patch)
tree19f39e74f12dc5dbebbc3722d0b2db26f501d58c
parent3a58dc5a4ecb0cf0f3ed29c9250ba7adec784fae (diff)
downloadmariadb-git-4ebb96c6b1973937e743a674ad4f28386f8abca7.tar.gz
better fix for OPTIMIZE bug
-rw-r--r--sql/ha_myisam.cc16
1 files changed, 6 insertions, 10 deletions
diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc
index f96781f83b4..31a8d3c7109 100644
--- a/sql/ha_myisam.cc
+++ b/sql/ha_myisam.cc
@@ -617,16 +617,12 @@ int ha_myisam::repair(THD *thd, MI_CHECK &param, bool optimize)
STATE_CRASHED_ON_REPAIR);
file->update|=HA_STATE_CHANGED | HA_STATE_ROW_CHANGED;
}
- /* Here we need to make file->save_state and file->s->state.state
- equal. Unfortunately, sometime table comes locked here (so
- file->save_state represents actual table state), and sometime
- unlocked (and actual is file->s->state.state instead). This all
- is very confusing, and should be streamlined (TODO).
- */
- if (file->state == & file->save_state)
- file->s->state.state=file->save_state;
- else
- file->save_state=file->s->state.state;
+ /*
+ the following 'if', thought conceptually wrong,
+ is a useful optimization nevertheless.
+ */
+ if (file->state != &file->s->state.state);
+ file->s->state.state = *file->state;
if (file->s->base.auto_key)
update_auto_increment_key(&param, file, 1);
if (optimize_done)