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
3c7cc228
Commit
3c7cc228
authored
Jun 21, 2001
by
serg@serg.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug in _mi_prefix_search fixed
parent
4b15a69e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
myisam/mi_search.c
myisam/mi_search.c
+7
-5
No files found.
myisam/mi_search.c
View file @
3c7cc228
...
@@ -264,9 +264,9 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
...
@@ -264,9 +264,9 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
SEARCH_NO_FIND,SEARCH_LAST and HA_REVERSE_SORT flags.
SEARCH_NO_FIND,SEARCH_LAST and HA_REVERSE_SORT flags.
flag is the value returned by _mi_key_cmp and as treated as final */
flag is the value returned by _mi_key_cmp and as treated as final */
int
flag
=
0
,
my_flag
=-
1
;
int
flag
=
0
,
my_flag
=-
1
;
uint
nod_flag
,
length
,
len
,
matched
,
cmplen
,
kseg_len
,
key_len_left
;
uint
nod_flag
,
length
,
len
,
matched
,
cmplen
,
kseg_len
;
uint
prefix_len
,
suffix_len
;
uint
prefix_len
,
suffix_len
;
int
key_len_skip
,
seg_len_pack
;
int
key_len_skip
,
seg_len_pack
,
key_len_left
;
uchar
*
end
,
*
kseg
,
*
vseg
;
uchar
*
end
,
*
kseg
,
*
vseg
;
uchar
*
sort_order
=
keyinfo
->
seg
->
charset
->
sort_order
;
uchar
*
sort_order
=
keyinfo
->
seg
->
charset
->
sort_order
;
uchar
tt_buff
[
MI_MAX_KEY_BUFF
+
2
],
*
t_buff
=
tt_buff
+
2
;
uchar
tt_buff
[
MI_MAX_KEY_BUFF
+
2
],
*
t_buff
=
tt_buff
+
2
;
...
@@ -288,6 +288,7 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
...
@@ -288,6 +288,7 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
key_len_skip
=
lenght_pack
+
kseg_len
;
key_len_skip
=
lenght_pack
+
kseg_len
;
key_len_left
=
key_len
-
key_len_skip
;
key_len_left
=
key_len
-
key_len_skip
;
cmplen
=
(
key_len_left
>=
0
)
?
kseg_len
:
key_len
-
lenght_pack
;
cmplen
=
(
key_len_left
>=
0
)
?
kseg_len
:
key_len
-
lenght_pack
;
DBUG_PRINT
(
"info"
,(
"key: '%.*s'"
,
kseg_len
,
kseg
));
}
}
/*
/*
...
@@ -342,6 +343,7 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
...
@@ -342,6 +343,7 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
saved_vseg
=
vseg
;
saved_vseg
=
vseg
;
saved_prefix_len
=
prefix_len
;
saved_prefix_len
=
prefix_len
;
DBUG_PRINT
(
"loop"
,(
"page: '%.*s%.*s'"
,
prefix_len
,
t_buff
+
seg_len_pack
,
suffix_len
,
vseg
));
{
{
uchar
*
from
=
vseg
+
suffix_len
;
uchar
*
from
=
vseg
+
suffix_len
;
MI_KEYSEG
*
keyseg
;
MI_KEYSEG
*
keyseg
;
...
@@ -409,7 +411,7 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
...
@@ -409,7 +411,7 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page,
}
}
else
if
(
len
>
cmplen
)
else
if
(
len
>
cmplen
)
{
{
if
(
my_flag
=
!
(
nextflag
&
SEARCH_PREFIX
)
&&
key_len_left
>
0
)
if
(
my_flag
=
!
(
nextflag
&
SEARCH_PREFIX
)
||
key_len_left
>
0
)
break
;
break
;
goto
fix_flag
;
goto
fix_flag
;
}
}
...
@@ -688,8 +690,8 @@ static int compare_bin(uchar *a, uint a_length, uchar *b, uint b_length,
...
@@ -688,8 +690,8 @@ static int compare_bin(uchar *a, uint a_length, uchar *b, uint b_length,
/*
/*
** Compare two keys
with is bigger
** Compare two keys
** Returns <0, 0, >0 acording to w
it
h is bigger
** Returns <0, 0, >0 acording to w
hic
h is bigger
** Key_length specifies length of key to use. Number-keys can't
** Key_length specifies length of key to use. Number-keys can't
** be splited
** be splited
** If flag <> SEARCH_FIND compare also position
** If flag <> SEARCH_FIND compare also position
...
...
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