47
47
for (i=0 ; i < share->base.keys ; i++)
48
48
state->key_root[i]= HA_OFFSET_ERROR;
50
myisam_log_command(MI_LOG_DELETE_ALL,info,(uchar*) 0,0,0);
50
myisam_log_command_logical(MI_LOG_DELETE_ALL, info, (uchar*) 0, 0, 0);
52
52
If we are using delayed keys or if the user has done changes to the tables
53
53
since it was locked then there may be key blocks in the key cache
55
55
flush_key_blocks(share->key_cache, share->kfile, FLUSH_IGNORE_CHANGED);
56
60
if (my_chsize(info->dfile, 0, 0, MYF(MY_WME)) ||
57
61
my_chsize(share->kfile, share->base.keystart, 0, MYF(MY_WME)) )
59
VOID(_mi_writeinfo(info,WRITEINFO_UPDATE_KEYFILE));
63
if (unlikely(mi_get_physical_logging_state(info->s)))
64
_myisam_log_command(&myisam_physical_log, MI_LOG_DELETE_ALL, share,
66
(void) _mi_writeinfo(info,WRITEINFO_UPDATE_KEYFILE);
61
/* Resize mmaped area */
62
rw_wrlock(&info->s->mmap_lock);
63
mi_remap_file(info, (my_off_t)0);
64
rw_unlock(&info->s->mmap_lock);
70
mi_dynmap_file(info, (my_off_t) 0);
66
72
allow_break(); /* Allow SIGHUP & SIGINT */
71
77
int save_errno=my_errno;
72
VOID(_mi_writeinfo(info,WRITEINFO_UPDATE_KEYFILE));
78
(void) _mi_writeinfo(info,WRITEINFO_UPDATE_KEYFILE);
73
79
info->update|=HA_STATE_WRITTEN; /* Buffer changed */
74
80
allow_break(); /* Allow SIGHUP & SIGINT */
75
81
DBUG_RETURN(my_errno=save_errno);