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
cb9e23bb
Commit
cb9e23bb
authored
Sep 16, 2011
by
Sergey Vojtovich
Browse files
Options
Browse Files
Download
Plain Diff
Merge.
parents
93f2daf3
3f9cbd77
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
81 additions
and
5 deletions
+81
-5
mysql-test/r/myisampack.result
mysql-test/r/myisampack.result
+32
-0
mysql-test/t/myisampack.test
mysql-test/t/myisampack.test
+44
-0
storage/myisam/ft_boolean_search.c
storage/myisam/ft_boolean_search.c
+1
-1
storage/myisam/ft_nlq_search.c
storage/myisam/ft_nlq_search.c
+1
-1
storage/myisam/mi_check.c
storage/myisam/mi_check.c
+2
-2
storage/myisam/mi_write.c
storage/myisam/mi_write.c
+1
-1
No files found.
mysql-test/r/myisampack.result
View file @
cb9e23bb
...
...
@@ -118,3 +118,35 @@ Aborted: file is not compressed
DROP TABLE t1,t2,t3;
DROP TABLE mysql_db1.t1;
DROP DATABASE mysql_db1;
#
# BUG#11761180 - 53646: MYISAMPACK CORRUPTS TABLES WITH FULLTEXT INDEXES
#
CREATE TABLE t1(a CHAR(4), FULLTEXT(a));
INSERT INTO t1 VALUES('aaaa'),('bbbb'),('cccc');
FLUSH TABLE t1;
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
SELECT * FROM t1 WHERE MATCH(a) AGAINST('aaaa' IN BOOLEAN MODE);
a
aaaa
SELECT * FROM t1 WHERE MATCH(a) AGAINST('aaaa');
a
aaaa
DROP TABLE t1;
# Test table with key_reflength > rec_reflength
CREATE TABLE t1(a CHAR(30), FULLTEXT(a));
# Populating a table, so it's index file exceeds 65K
# Populating a table, so index file has second level fulltext tree
FLUSH TABLE t1;
# Compressing table
# Fixing index (repair by sort)
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
FLUSH TABLE t1;
# Fixing index (repair with keycache)
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1;
mysql-test/t/myisampack.test
View file @
cb9e23bb
...
...
@@ -221,3 +221,47 @@ DROP TABLE t1,t2,t3;
DROP
TABLE
mysql_db1
.
t1
;
DROP
DATABASE
mysql_db1
;
--
echo
#
--
echo
# BUG#11761180 - 53646: MYISAMPACK CORRUPTS TABLES WITH FULLTEXT INDEXES
--
echo
#
CREATE
TABLE
t1
(
a
CHAR
(
4
),
FULLTEXT
(
a
));
INSERT
INTO
t1
VALUES
(
'aaaa'
),(
'bbbb'
),(
'cccc'
);
FLUSH
TABLE
t1
;
--
exec
$MYISAMPACK
-
sf
$MYSQLD_DATADIR
/
test
/
t1
--
exec
$MYISAMCHK
-
srq
$MYSQLD_DATADIR
/
test
/
t1
CHECK
TABLE
t1
;
SELECT
*
FROM
t1
WHERE
MATCH
(
a
)
AGAINST
(
'aaaa'
IN
BOOLEAN
MODE
);
SELECT
*
FROM
t1
WHERE
MATCH
(
a
)
AGAINST
(
'aaaa'
);
DROP
TABLE
t1
;
--
echo
# Test table with key_reflength > rec_reflength
CREATE
TABLE
t1
(
a
CHAR
(
30
),
FULLTEXT
(
a
));
--
disable_query_log
--
echo
# Populating a table, so it's index file exceeds 65K
let
$
1
=
1700
;
while
(
$
1
)
{
eval
INSERT
INTO
t1
VALUES
(
'$1aaaaaaaaaaaaaaaaaaaaaaaaaa'
);
dec
$
1
;
}
--
echo
# Populating a table, so index file has second level fulltext tree
let
$
1
=
60
;
while
(
$
1
)
{
eval
INSERT
INTO
t1
VALUES
(
'aaaa'
),(
'aaaa'
),(
'aaaa'
),(
'aaaa'
),(
'aaaa'
);
dec
$
1
;
}
--
enable_query_log
FLUSH
TABLE
t1
;
--
echo
# Compressing table
--
exec
$MYISAMPACK
-
sf
$MYSQLD_DATADIR
/
test
/
t1
--
echo
# Fixing index (repair by sort)
--
exec
$MYISAMCHK
-
srnq
$MYSQLD_DATADIR
/
test
/
t1
CHECK
TABLE
t1
;
FLUSH
TABLE
t1
;
--
echo
# Fixing index (repair with keycache)
--
exec
$MYISAMCHK
-
soq
$MYSQLD_DATADIR
/
test
/
t1
CHECK
TABLE
t1
;
DROP
TABLE
t1
;
storage/myisam/ft_boolean_search.c
View file @
cb9e23bb
...
...
@@ -360,7 +360,7 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
int
subkeys
=
1
;
my_bool
can_go_down
;
MI_INFO
*
info
=
ftb
->
info
;
uint
UNINIT_VAR
(
off
),
extra
=
HA_FT_WLEN
+
info
->
s
->
base
.
rec_reflength
;
uint
UNINIT_VAR
(
off
),
extra
=
HA_FT_WLEN
+
info
->
s
->
rec_reflength
;
uchar
*
lastkey_buf
=
ftbw
->
word
+
ftbw
->
off
;
if
(
ftbw
->
flags
&
FTB_FLAG_TRUNC
)
...
...
storage/myisam/ft_nlq_search.c
View file @
cb9e23bb
...
...
@@ -72,7 +72,7 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
uchar
*
keybuff
=
aio
->
keybuff
;
MI_KEYDEF
*
keyinfo
=
info
->
s
->
keyinfo
+
aio
->
keynr
;
my_off_t
key_root
=
info
->
s
->
state
.
key_root
[
aio
->
keynr
];
uint
extra
=
HA_FT_WLEN
+
info
->
s
->
base
.
rec_reflength
;
uint
extra
=
HA_FT_WLEN
+
info
->
s
->
rec_reflength
;
#if HA_FT_WTYPE == HA_KEYTYPE_FLOAT
float
tmp_weight
;
#else
...
...
storage/myisam/mi_check.c
View file @
cb9e23bb
...
...
@@ -3899,7 +3899,7 @@ static int sort_ft_key_write(MI_SORT_PARAM *sort_param, const void *a)
SORT_FT_BUF
*
ft_buf
=
sort_info
->
ft_buf
;
SORT_KEY_BLOCKS
*
key_block
=
sort_info
->
key_block
;
val_len
=
HA_FT_WLEN
+
sort_info
->
info
->
s
->
base
.
rec_reflength
;
val_len
=
HA_FT_WLEN
+
sort_info
->
info
->
s
->
rec_reflength
;
get_key_full_length_rdonly
(
a_len
,
(
uchar
*
)
a
);
if
(
!
ft_buf
)
...
...
@@ -3909,7 +3909,7 @@ static int sort_ft_key_write(MI_SORT_PARAM *sort_param, const void *a)
and row format is NOT static - for _mi_dpointer not to garble offsets
*/
if
((
sort_info
->
info
->
s
->
base
.
key_reflength
<=
sort_info
->
info
->
s
->
base
.
rec_reflength
)
&&
sort_info
->
info
->
s
->
rec_reflength
)
&&
(
sort_info
->
info
->
s
->
options
&
(
HA_OPTION_PACK_RECORD
|
HA_OPTION_COMPRESS_RECORD
)))
ft_buf
=
(
SORT_FT_BUF
*
)
my_malloc
(
sort_param
->
keyinfo
->
block_length
+
...
...
storage/myisam/mi_write.c
View file @
cb9e23bb
...
...
@@ -519,7 +519,7 @@ int _mi_insert(register MI_INFO *info, register MI_KEYDEF *keyinfo,
{
if
(
keyinfo
->
block_length
-
a_length
<
32
&&
keyinfo
->
flag
&
HA_FULLTEXT
&&
key_pos
==
endpos
&&
info
->
s
->
base
.
key_reflength
<=
info
->
s
->
base
.
rec_reflength
&&
info
->
s
->
base
.
key_reflength
<=
info
->
s
->
rec_reflength
&&
info
->
s
->
options
&
(
HA_OPTION_PACK_RECORD
|
HA_OPTION_COMPRESS_RECORD
))
{
/*
...
...
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