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
37537b4b
Commit
37537b4b
authored
Apr 16, 2005
by
ingo@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/mydev/mysql-4.1-bug9487
into mysql.com:/home/mydev/mysql-4.1-bug9188
parents
e0e3def7
e2356c71
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
3 deletions
+16
-3
myisam/myisampack.c
myisam/myisampack.c
+16
-3
No files found.
myisam/myisampack.c
View file @
37537b4b
...
@@ -1709,7 +1709,7 @@ static int compress_isam_file(PACK_MRG_INFO *mrg, HUFF_COUNTS *huff_counts)
...
@@ -1709,7 +1709,7 @@ static int compress_isam_file(PACK_MRG_INFO *mrg, HUFF_COUNTS *huff_counts)
ulong
tot_blob_length
=
0
;
ulong
tot_blob_length
=
0
;
if
(
!
error
)
if
(
!
error
)
{
{
if
(
flush_buffer
(
max_calc_length
+
max_pack_length
))
if
(
flush_buffer
(
(
ulong
)
max_calc_length
+
(
ulong
)
max_pack_length
))
break
;
break
;
record_pos
=
file_buffer
.
pos
;
record_pos
=
file_buffer
.
pos
;
file_buffer
.
pos
+=
max_pack_length
;
file_buffer
.
pos
+=
max_pack_length
;
...
@@ -1930,7 +1930,20 @@ static void init_file_buffer(File file, pbool read_buffer)
...
@@ -1930,7 +1930,20 @@ static void init_file_buffer(File file, pbool read_buffer)
static
int
flush_buffer
(
ulong
neaded_length
)
static
int
flush_buffer
(
ulong
neaded_length
)
{
{
ulong
length
;
ulong
length
;
if
((
ulong
)
(
file_buffer
.
end
-
file_buffer
.
pos
)
>
neaded_length
)
/*
file_buffer.end is 8 bytes lower than the real end of the buffer.
This is done so that the end-of-buffer condition does not need to be
checked for every byte (see write_bits()). Consequently,
file_buffer.pos can become greater than file_buffer.end. The
algorithms in the other functions ensure that there will never be
more than 8 bytes written to the buffer without an end-of-buffer
check. So the buffer cannot be overrun. But we need to check for the
near-to-buffer-end condition to avoid a negative result, which is
casted to unsigned and thus becomes giant.
*/
if
((
file_buffer
.
pos
<
file_buffer
.
end
)
&&
((
ulong
)
(
file_buffer
.
end
-
file_buffer
.
pos
)
>
neaded_length
))
return
0
;
return
0
;
length
=
(
ulong
)
(
file_buffer
.
pos
-
file_buffer
.
buffer
);
length
=
(
ulong
)
(
file_buffer
.
pos
-
file_buffer
.
buffer
);
file_buffer
.
pos
=
file_buffer
.
buffer
;
file_buffer
.
pos
=
file_buffer
.
buffer
;
...
@@ -2002,7 +2015,7 @@ static void write_bits (register ulong value, register uint bits)
...
@@ -2002,7 +2015,7 @@ static void write_bits (register ulong value, register uint bits)
}
}
#endif
#endif
if
(
file_buffer
.
pos
>=
file_buffer
.
end
)
if
(
file_buffer
.
pos
>=
file_buffer
.
end
)
VOID
(
flush_buffer
(
(
uint
)
~
0
));
VOID
(
flush_buffer
(
~
(
ulong
)
0
));
file_buffer
.
bits
=
(
int
)
(
BITS_SAVED
-
bits
);
file_buffer
.
bits
=
(
int
)
(
BITS_SAVED
-
bits
);
file_buffer
.
current_byte
=
(
uint
)
(
value
<<
(
BITS_SAVED
-
bits
));
file_buffer
.
current_byte
=
(
uint
)
(
value
<<
(
BITS_SAVED
-
bits
));
}
}
...
...
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