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
8502705d
Commit
8502705d
authored
Apr 07, 2009
by
Satya B
Browse files
Options
Browse Files
Download
Plain Diff
merge 5.0-bugteam to 5.1-bugteam
parents
83a78142
c045d1dc
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
57 additions
and
27 deletions
+57
-27
mysql-test/r/myisampack.result
mysql-test/r/myisampack.result
+22
-0
mysql-test/t/myisampack.test
mysql-test/t/myisampack.test
+26
-0
storage/myisam/mi_packrec.c
storage/myisam/mi_packrec.c
+9
-27
No files found.
mysql-test/r/myisampack.result
View file @
8502705d
...
...
@@ -65,3 +65,25 @@ SELECT COUNT(*) FROM t1;
COUNT(*)
1024
DROP TABLE t1;
#
# Bug #43973 - backup_myisam.test fails on 6.0-bugteam
#
CREATE DATABASE mysql_db1;
CREATE TABLE mysql_db1.t1 (c1 VARCHAR(5), c2 int);
CREATE INDEX i1 ON mysql_db1.t1 (c1, c2);
INSERT INTO mysql_db1.t1 VALUES ('A',1);
INSERT INTO mysql_db1.t1 SELECT * FROM mysql_db1.t1;
INSERT INTO mysql_db1.t1 SELECT * FROM mysql_db1.t1;
INSERT INTO mysql_db1.t1 SELECT * FROM mysql_db1.t1;
INSERT INTO mysql_db1.t1 SELECT * FROM mysql_db1.t1;
INSERT INTO mysql_db1.t1 SELECT * FROM mysql_db1.t1;
INSERT INTO mysql_db1.t1 SELECT * FROM mysql_db1.t1;
INSERT INTO mysql_db1.t1 SELECT * FROM mysql_db1.t1;
FLUSH TABLE mysql_db1.t1;
# Compress the table using MYISAMPACK tool
# Run MYISAMCHK tool on the compressed table
SELECT COUNT(*) FROM mysql_db1.t1 WHERE c2 < 5;
COUNT(*)
128
DROP TABLE mysql_db1.t1;
DROP DATABASE mysql_db1;
mysql-test/t/myisampack.test
View file @
8502705d
...
...
@@ -81,3 +81,29 @@ let $MYSQLD_DATADIR= `select @@datadir`;
--
exec
$MYISAMPACK
$MYSQLD_DATADIR
/
test
/
t1
SELECT
COUNT
(
*
)
FROM
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# Bug #43973 - backup_myisam.test fails on 6.0-bugteam
--
echo
#
CREATE
DATABASE
mysql_db1
;
CREATE
TABLE
mysql_db1
.
t1
(
c1
VARCHAR
(
5
),
c2
int
);
CREATE
INDEX
i1
ON
mysql_db1
.
t1
(
c1
,
c2
);
INSERT
INTO
mysql_db1
.
t1
VALUES
(
'A'
,
1
);
INSERT
INTO
mysql_db1
.
t1
SELECT
*
FROM
mysql_db1
.
t1
;
INSERT
INTO
mysql_db1
.
t1
SELECT
*
FROM
mysql_db1
.
t1
;
INSERT
INTO
mysql_db1
.
t1
SELECT
*
FROM
mysql_db1
.
t1
;
INSERT
INTO
mysql_db1
.
t1
SELECT
*
FROM
mysql_db1
.
t1
;
INSERT
INTO
mysql_db1
.
t1
SELECT
*
FROM
mysql_db1
.
t1
;
INSERT
INTO
mysql_db1
.
t1
SELECT
*
FROM
mysql_db1
.
t1
;
INSERT
INTO
mysql_db1
.
t1
SELECT
*
FROM
mysql_db1
.
t1
;
FLUSH
TABLE
mysql_db1
.
t1
;
#
--
echo
# Compress the table using MYISAMPACK tool
let
$MYSQLD_DATADIR
=
`select @@datadir`
;
--
exec
$MYISAMPACK
-
s
$MYSQLD_DATADIR
/
mysql_db1
/
t1
--
echo
# Run MYISAMCHK tool on the compressed table
--
exec
$MYISAMCHK
-
srq
$MYSQLD_DATADIR
/
mysql_db1
/
t1
SELECT
COUNT
(
*
)
FROM
mysql_db1
.
t1
WHERE
c2
<
5
;
#
DROP
TABLE
mysql_db1
.
t1
;
DROP
DATABASE
mysql_db1
;
storage/myisam/mi_packrec.c
View file @
8502705d
...
...
@@ -209,10 +209,17 @@ my_bool _mi_read_pack_info(MI_INFO *info, pbool fix_keys)
This segment will be reallocated after construction of the tables.
*/
length
=
(
uint
)
(
elements
*
2
+
trees
*
(
1
<<
myisam_quick_table_bits
));
/*
To keep some algorithms simpler, we accept that they access
bytes beyond the end of the input data. This can affect up to
one byte less than the "word size" size used in this file,
which is BITS_SAVED / 8. To avoid accessing non-allocated
data, we add (BITS_SAVED / 8) - 1 bytes to the buffer size.
*/
if
(
!
(
share
->
decode_tables
=
(
uint16
*
)
my_malloc
((
length
+
OFFSET_TABLE_SIZE
)
*
sizeof
(
uint16
)
+
(
uint
)
(
share
->
pack
.
header_length
-
sizeof
(
header
)
),
MYF
(
MY_WME
|
MY_ZEROFILL
))))
(
uint
)
(
share
->
pack
.
header_length
-
sizeof
(
header
)
+
(
BITS_SAVED
/
8
)
-
1
),
MYF
(
MY_WME
|
MY_ZEROFILL
))))
goto
err1
;
tmp_buff
=
share
->
decode_tables
+
length
;
disk_cache
=
(
uchar
*
)
(
tmp_buff
+
OFFSET_TABLE_SIZE
);
...
...
@@ -1431,31 +1438,6 @@ static void fill_buffer(MI_BIT_BUFF *bit_buff)
bit_buff
->
current_byte
=
0
;
return
;
}
else
{
uint
len
=
0
;
uint
i
=
0
;
/*
Check if the remaining buffer/record to read is less than the word size.
If so read byte by byte
Note: if this branch becomes a bottleneck it can be removed, assuming
that the second memory segment allocates 7 extra bytes (see
_mi_read_pack_info()).
*/
len
=
bit_buff
->
end
-
bit_buff
->
pos
;
if
(
len
<
(
BITS_SAVED
/
8
))
{
bit_buff
->
current_byte
=
0
;
for
(
i
=
0
;
i
<
len
;
i
++
)
{
bit_buff
->
current_byte
+=
(((
uint
)
((
uchar
)
bit_buff
->
pos
[
len
-
i
-
1
]))
<<
(
8
*
i
));
}
bit_buff
->
pos
=
bit_buff
->
end
;
return
;
}
}
#if BITS_SAVED == 64
bit_buff
->
current_byte
=
((((
uint
)
((
uchar
)
bit_buff
->
pos
[
7
])))
+
...
...
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