summaryrefslogtreecommitdiffstats
path: root/storage/maria/ma_check.c
diff options
context:
space:
mode:
Diffstat (limited to 'storage/maria/ma_check.c')
-rw-r--r--storage/maria/ma_check.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/storage/maria/ma_check.c b/storage/maria/ma_check.c
index e4ba0726..8c07e3c6 100644
--- a/storage/maria/ma_check.c
+++ b/storage/maria/ma_check.c
@@ -3656,28 +3656,35 @@ err:
int maria_zerofill(HA_CHECK *param, MARIA_HA *info, const char *name)
{
- my_bool error, reenable_logging,
+ my_bool error= 0, reenable_logging,
zero_lsn= !(param->testflag & T_ZEROFILL_KEEP_LSN);
MARIA_SHARE *share= info->s;
DBUG_ENTER("maria_zerofill");
if ((reenable_logging= share->now_transactional))
_ma_tmp_disable_logging_for_table(info, 0);
- if (!(error= (maria_zerofill_index(param, info, name) ||
- maria_zerofill_data(param, info, name) ||
- _ma_set_uuid(info->s, 0))))
+
+ if (share->state.changed & (STATE_NOT_ZEROFILLED | (zero_lsn ? STATE_HAS_LSN : 0)))
+ error= (maria_zerofill_index(param, info, name) ||
+ maria_zerofill_data(param, info, name));
+ if (!error)
+ error= _ma_set_uuid(info->s, 0);
+
+ if (!error)
{
/*
- Mark that we have done zerofill of data and index. If we zeroed pages'
- LSN, table is movable.
+ Mark that we have done zerofill of data and index. If we zeroed the LSN
+ on the pages, table is movable.
*/
share->state.changed&= ~STATE_NOT_ZEROFILLED;
if (zero_lsn)
{
- share->state.changed&= ~(STATE_NOT_MOVABLE | STATE_MOVED);
+ share->state.changed&= ~(STATE_NOT_MOVABLE | STATE_MOVED | STATE_HAS_LSN);
/* Table should get new LSNs */
share->state.create_rename_lsn= share->state.is_of_horizon=
share->state.skip_redo_lsn= LSN_NEEDS_NEW_STATE_LSNS;
}
+ else
+ share->state.changed|= STATE_HAS_LSN;
/* Ensure state is later flushed to disk, if within maria_chk */
info->update= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED);