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
cfdd9890
Commit
cfdd9890
authored
Sep 17, 2003
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-4.0
into narttu.mysql.fi:/my/mysql-4.0
parents
65cf37d3
bfc155f0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
12 deletions
+41
-12
myisam/mi_check.c
myisam/mi_check.c
+27
-8
myisam/mi_dynrec.c
myisam/mi_dynrec.c
+14
-4
No files found.
myisam/mi_check.c
View file @
cfdd9890
...
...
@@ -200,21 +200,33 @@ int chk_del(MI_CHECK *param, register MI_INFO *info, uint test_flag)
empty
+=
info
->
s
->
base
.
pack_reclength
;
}
}
if
(
test_flag
&
T_VERBOSE
)
puts
(
"
\n
"
);
if
(
empty
!=
info
->
state
->
empty
)
{
if
(
test_flag
&
T_VERBOSE
)
puts
(
""
);
mi_check_print_warning
(
param
,
"Not used space is supposed to be: %s but is: %s"
,
llstr
(
info
->
state
->
empty
,
buff
),
llstr
(
empty
,
buff2
));
info
->
state
->
empty
=
empty
;
"Found %s deleted space in delete link chain. Should be %s"
,
llstr
(
empty
,
buff2
),
llstr
(
info
->
state
->
empty
,
buff
));
}
if
(
i
!=
0
||
next_link
!=
HA_OFFSET_ERROR
)
if
(
next_link
!=
HA_OFFSET_ERROR
)
{
mi_check_print_error
(
param
,
"Found more than the expected %s deleted rows in delete link chain"
,
llstr
(
info
->
state
->
del
,
buff
));
goto
wrong
;
if
(
test_flag
&
T_VERBOSE
)
puts
(
"
\n
"
);
}
if
(
i
!=
0
)
{
mi_check_print_error
(
param
,
"Found %s deleted rows in delete link chain. Should be %s"
,
llstr
(
info
->
state
->
del
-
i
,
buff2
),
llstr
(
info
->
state
->
del
,
buff
));
goto
wrong
;
}
}
DBUG_RETURN
(
0
);
wrong:
param
->
testflag
|=
T_RETRY_WITHOUT_QUICK
;
if
(
test_flag
&
T_VERBOSE
)
puts
(
""
);
...
...
@@ -1040,6 +1052,13 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
}
}
if
(
del_length
!=
info
->
state
->
empty
)
{
mi_check_print_warning
(
param
,
"Found %s deleted space. Should be %s"
,
llstr
(
del_length
,
llbuff2
),
llstr
(
info
->
state
->
empty
,
llbuff
));
}
if
(
used
+
empty
+
del_length
!=
info
->
state
->
data_file_length
)
{
mi_check_print_warning
(
param
,
...
...
myisam/mi_dynrec.c
View file @
cfdd9890
...
...
@@ -167,7 +167,6 @@ static int _mi_find_writepos(MI_INFO *info,
if
(
info
->
s
->
state
.
dellink
!=
HA_OFFSET_ERROR
)
{
/* Deleted blocks exists; Get last used block */
*
filepos
=
info
->
s
->
state
.
dellink
;
block_info
.
second_read
=
0
;
info
->
rec_cache
.
seek_not_done
=
1
;
...
...
@@ -211,7 +210,11 @@ static int _mi_find_writepos(MI_INFO *info,
/* Remove a deleted block from the deleted list */
/*
Unlink a deleted block from the deleted list.
This block will be combined with the preceding or next block to form
a big block.
*/
static
bool
unlink_deleted_block
(
MI_INFO
*
info
,
MI_BLOCK_INFO
*
block_info
)
{
...
...
@@ -225,6 +228,7 @@ static bool unlink_deleted_block(MI_INFO *info, MI_BLOCK_INFO *block_info)
{
MI_BLOCK_INFO
tmp
;
tmp
.
second_read
=
0
;
/* Unlink block from the previous block */
if
(
!
(
_mi_get_block_info
(
&
tmp
,
info
->
dfile
,
block_info
->
prev_filepos
)
&
BLOCK_DELETED
))
DBUG_RETURN
(
1
);
/* Something is wrong */
...
...
@@ -232,6 +236,7 @@ static bool unlink_deleted_block(MI_INFO *info, MI_BLOCK_INFO *block_info)
if
(
my_pwrite
(
info
->
dfile
,(
char
*
)
tmp
.
header
+
4
,
8
,
block_info
->
prev_filepos
+
4
,
MYF
(
MY_NABP
)))
DBUG_RETURN
(
1
);
/* Unlink block from next block */
if
(
block_info
->
next_filepos
!=
HA_OFFSET_ERROR
)
{
if
(
!
(
_mi_get_block_info
(
&
tmp
,
info
->
dfile
,
block_info
->
next_filepos
)
...
...
@@ -244,11 +249,16 @@ static bool unlink_deleted_block(MI_INFO *info, MI_BLOCK_INFO *block_info)
DBUG_RETURN
(
1
);
}
}
/* We now have one less deleted block */
info
->
state
->
del
--
;
info
->
state
->
empty
-=
block_info
->
block_len
;
info
->
s
->
state
.
split
--
;
/* Removing block that we are using through mi_rrnd */
/*
If this was a block that we where accessing through table scan
(mi_rrnd() or mi_scan(), then ensure that we skip over this block
when doing next mi_rrnd() or mi_scan().
*/
if
(
info
->
nextpos
==
block_info
->
filepos
)
info
->
nextpos
+=
block_info
->
block_len
;
DBUG_RETURN
(
0
);
...
...
@@ -325,7 +335,7 @@ static int delete_dynamic_record(MI_INFO *info, my_off_t filepos,
info
->
state
->
empty
+=
length
;
filepos
=
block_info
.
next_filepos
;
/* Now it's safe to unlink the
block
*/
/* Now it's safe to unlink the
deleted block directly after this one
*/
if
(
remove_next_block
&&
unlink_deleted_block
(
info
,
&
del_block
))
error
=
1
;
}
while
(
!
(
b_type
&
BLOCK_LAST
));
...
...
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