Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
77102d8d
Commit
77102d8d
authored
Oct 22, 2002
by
serg@serg.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
truncate both MYI and MYD files on DELETE FROM table; to avoid warnings on CHECK TABLE
parent
893cc550
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
myisam/mi_delete_all.c
myisam/mi_delete_all.c
+5
-4
No files found.
myisam/mi_delete_all.c
View file @
77102d8d
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* Remove all rows from a MyISAM table */
/* Remove all rows from a MyISAM table */
/* This
only clears the status information and truncates the data file
*/
/* This
clears the status information and truncates files
*/
#include "myisamdef.h"
#include "myisamdef.h"
...
@@ -49,14 +49,15 @@ int mi_delete_all_rows(MI_INFO *info)
...
@@ -49,14 +49,15 @@ int mi_delete_all_rows(MI_INFO *info)
state
->
key_root
[
i
]
=
HA_OFFSET_ERROR
;
state
->
key_root
[
i
]
=
HA_OFFSET_ERROR
;
myisam_log_command
(
MI_LOG_DELETE_ALL
,
info
,(
byte
*
)
0
,
0
,
0
);
myisam_log_command
(
MI_LOG_DELETE_ALL
,
info
,(
byte
*
)
0
,
0
,
0
);
VOID
(
_mi_writeinfo
(
info
,
WRITEINFO_UPDATE_KEYFILE
));
if
(
my_chsize
(
info
->
dfile
,
0
,
0
,
MYF
(
MY_WME
)))
goto
err
;
/*
/*
If we are using delayed keys or if the user has done changes to the tables
If we are using delayed keys or if the user has done changes to the tables
since it was locked then there may be key blocks in the key cache
since it was locked then there may be key blocks in the key cache
*/
*/
flush_key_blocks
(
share
->
kfile
,
FLUSH_IGNORE_CHANGED
);
flush_key_blocks
(
share
->
kfile
,
FLUSH_IGNORE_CHANGED
);
if
(
my_chsize
(
info
->
dfile
,
0
,
0
,
MYF
(
MY_WME
))
||
my_chsize
(
share
->
kfile
,
share
->
base
.
keystart
,
0
,
MYF
(
MY_WME
))
)
goto
err
;
VOID
(
_mi_writeinfo
(
info
,
WRITEINFO_UPDATE_KEYFILE
));
allow_break
();
/* Allow SIGHUP & SIGINT */
allow_break
();
/* Allow SIGHUP & SIGINT */
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment