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
f4565513
Commit
f4565513
authored
Sep 03, 2004
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG#5327 - mi_sort_index() of 2-level tree
parent
f7f85eb6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
9 deletions
+40
-9
myisam/mi_check.c
myisam/mi_check.c
+23
-9
mysql-test/r/fulltext2.result
mysql-test/r/fulltext2.result
+9
-0
mysql-test/t/fulltext2.test
mysql-test/t/fulltext2.test
+8
-0
No files found.
myisam/mi_check.c
View file @
f4565513
...
...
@@ -1585,7 +1585,7 @@ int mi_sort_index(MI_CHECK *param, register MI_INFO *info, my_string name)
int
old_lock
;
MYISAM_SHARE
*
share
=
info
->
s
;
MI_STATE_INFO
old_state
;
DBUG_ENTER
(
"sort_index"
);
DBUG_ENTER
(
"
mi_
sort_index"
);
if
(
!
(
param
->
testflag
&
T_SILENT
))
printf
(
"- Sorting index for MyISAM-table '%s'
\n
"
,
name
);
...
...
@@ -1664,7 +1664,7 @@ err:
err2:
VOID
(
my_delete
(
param
->
temp_filename
,
MYF
(
MY_WME
)));
DBUG_RETURN
(
-
1
);
}
/* sort_index */
}
/*
mi_
sort_index */
/* Sort records recursive using one index */
...
...
@@ -1672,7 +1672,7 @@ err2:
static
int
sort_one_index
(
MI_CHECK
*
param
,
MI_INFO
*
info
,
MI_KEYDEF
*
keyinfo
,
my_off_t
pagepos
,
File
new_file
)
{
uint
length
,
nod_flag
,
used_length
;
uint
length
,
nod_flag
,
used_length
,
key_length
;
uchar
*
buff
,
*
keypos
,
*
endpos
;
uchar
key
[
MI_MAX_POSSIBLE_KEY_BUFF
];
my_off_t
new_page_pos
,
next_page
;
...
...
@@ -1693,7 +1693,7 @@ static int sort_one_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
llstr
(
pagepos
,
llbuff
));
goto
err
;
}
if
((
nod_flag
=
mi_test_if_nod
(
buff
)))
if
((
nod_flag
=
mi_test_if_nod
(
buff
))
||
keyinfo
->
flag
&
HA_FULLTEXT
)
{
used_length
=
mi_getint
(
buff
);
keypos
=
buff
+
2
+
nod_flag
;
...
...
@@ -1704,7 +1704,7 @@ static int sort_one_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
{
next_page
=
_mi_kpos
(
nod_flag
,
keypos
);
_mi_kpointer
(
info
,
keypos
-
nod_flag
,
param
->
new_file_pos
);
/* Save new pos */
if
(
sort_one_index
(
param
,
info
,
keyinfo
,
next_page
,
new_file
))
if
(
sort_one_index
(
param
,
info
,
keyinfo
,
next_page
,
new_file
))
{
DBUG_PRINT
(
"error"
,(
"From page: %ld, keyoffset: %d used_length: %d"
,
(
ulong
)
pagepos
,
(
int
)
(
keypos
-
buff
),
...
...
@@ -1714,11 +1714,25 @@ static int sort_one_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
}
}
if
(
keypos
>=
endpos
||
((
*
keyinfo
->
get_key
)(
keyinfo
,
nod_flag
,
&
keypos
,
key
))
==
0
)
(
key_length
=
(
*
keyinfo
->
get_key
)(
keyinfo
,
nod_flag
,
&
keypos
,
key
))
==
0
)
break
;
#ifdef EXTRA_DEBUG
assert
(
keypos
<=
endpos
);
#endif
DBUG_ASSERT
(
keypos
<=
endpos
);
if
(
keyinfo
->
flag
&
HA_FULLTEXT
)
{
uint
off
;
int
subkeys
;
get_key_full_length_rdonly
(
off
,
key
);
subkeys
=
ft_sintXkorr
(
key
+
off
);
if
(
subkeys
<
0
)
{
next_page
=
_mi_dpos
(
info
,
0
,
key
+
key_length
);
_mi_dpointer
(
info
,
keypos
-
nod_flag
-
info
->
s
->
rec_reflength
,
param
->
new_file_pos
);
/* Save new pos */
if
(
sort_one_index
(
param
,
info
,
&
info
->
s
->
ft2_keyinfo
,
next_page
,
new_file
))
goto
err
;
}
}
}
}
...
...
mysql-test/r/fulltext2.result
View file @
f4565513
...
...
@@ -7,6 +7,15 @@ FULLTEXT KEY (a)
repair table t1 quick;
Table Op Msg_type Msg_text
test.t1 repair status OK
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
optimize table t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
select count(*) from t1 where match a against ('aaaxxx');
count(*)
260
...
...
mysql-test/t/fulltext2.test
View file @
f4565513
...
...
@@ -44,6 +44,9 @@ while ($1)
# converting to two-level
repair
table
t1
quick
;
check
table
t1
;
optimize
table
t1
;
# BUG#5327 - mi_sort_index() of 2-level tree
check
table
t1
;
select
count
(
*
)
from
t1
where
match
a
against
(
'aaaxxx'
);
select
count
(
*
)
from
t1
where
match
a
against
(
'aaayyy'
);
...
...
@@ -102,6 +105,11 @@ CREATE TABLE t1 (
FULLTEXT
KEY
(
a
)
)
ENGINE
=
MyISAM
;
#
# now same as about but w/o repair table
# 2-level tree created by mi_write
#
# two-level entry, second-level tree with depth 2
--
disable_query_log
let
$
1
=
260
;
...
...
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