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
7244e84e
Commit
7244e84e
authored
May 16, 2012
by
Venkata Sidagam
Browse files
Options
Browse Files
Download
Plain Diff
Merging the fix from mysql-5.1 to mysql-5.5
parents
453fcc0c
0e9c1e9f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
3 deletions
+31
-3
storage/myisam/ft_boolean_search.c
storage/myisam/ft_boolean_search.c
+14
-2
storage/myisam/ft_nlq_search.c
storage/myisam/ft_nlq_search.c
+17
-1
No files found.
storage/myisam/ft_boolean_search.c
View file @
7244e84e
...
...
@@ -354,7 +354,7 @@ static int _ftb_no_dupes_cmp(void* not_used __attribute__((unused)),
returns 1 if the search was finished (must-word wasn't found)
*/
static
int
_ft2_search
(
FTB
*
ftb
,
FTB_WORD
*
ftbw
,
my_bool
init_search
)
static
int
_ft2_search
_no_lock
(
FTB
*
ftb
,
FTB_WORD
*
ftbw
,
my_bool
init_search
)
{
int
r
;
int
subkeys
=
1
;
...
...
@@ -454,7 +454,7 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
ftbw
->
key_root
=
info
->
s
->
state
.
key_root
[
ftb
->
keynr
];
ftbw
->
keyinfo
=
info
->
s
->
keyinfo
+
ftb
->
keynr
;
ftbw
->
off
=
0
;
return
_ft2_search
(
ftb
,
ftbw
,
0
);
return
_ft2_search
_no_lock
(
ftb
,
ftbw
,
0
);
}
/* matching key found */
...
...
@@ -482,6 +482,18 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
return
0
;
}
static
int
_ft2_search
(
FTB
*
ftb
,
FTB_WORD
*
ftbw
,
my_bool
init_search
)
{
int
r
;
MYISAM_SHARE
*
share
=
ftb
->
info
->
s
;
if
(
share
->
concurrent_insert
)
mysql_rwlock_rdlock
(
&
share
->
key_root_lock
[
ftb
->
keynr
]);
r
=
_ft2_search_no_lock
(
ftb
,
ftbw
,
init_search
);
if
(
share
->
concurrent_insert
)
mysql_rwlock_unlock
(
&
share
->
key_root_lock
[
ftb
->
keynr
]);
return
r
;
}
static
void
_ftb_init_index_search
(
FT_INFO
*
ftb
)
{
int
i
;
...
...
storage/myisam/ft_nlq_search.c
View file @
7244e84e
...
...
@@ -69,9 +69,10 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
TREE_ELEMENT
*
selem
;
double
gweight
=
1
;
MI_INFO
*
info
=
aio
->
info
;
MYISAM_SHARE
*
share
=
info
->
s
;
uchar
*
keybuff
=
aio
->
keybuff
;
MI_KEYDEF
*
keyinfo
=
info
->
s
->
keyinfo
+
aio
->
keynr
;
my_off_t
key_root
=
info
->
s
->
state
.
key_root
[
aio
->
keynr
]
;
my_off_t
key_root
;
uint
extra
=
HA_FT_WLEN
+
info
->
s
->
rec_reflength
;
#if HA_FT_WTYPE == HA_KEYTYPE_FLOAT
float
tmp_weight
;
...
...
@@ -87,6 +88,11 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
keylen
-=
HA_FT_WLEN
;
doc_cnt
=
0
;
if
(
share
->
concurrent_insert
)
mysql_rwlock_rdlock
(
&
share
->
key_root_lock
[
aio
->
keynr
]);
key_root
=
share
->
state
.
key_root
[
aio
->
keynr
];
/* Skip rows inserted by current inserted */
for
(
r
=
_mi_search
(
info
,
keyinfo
,
keybuff
,
keylen
,
SEARCH_FIND
,
key_root
)
;
!
r
&&
...
...
@@ -96,6 +102,9 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
info
->
lastkey_length
,
SEARCH_BIGGER
,
key_root
))
;
if
(
share
->
concurrent_insert
)
mysql_rwlock_unlock
(
&
share
->
key_root_lock
[
aio
->
keynr
]);
info
->
update
|=
HA_STATE_AKTIV
;
/* for _mi_test_if_changed() */
/* The following should be safe, even if we compare doubles */
...
...
@@ -119,6 +128,8 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
keyinfo
=&
info
->
s
->
ft2_keyinfo
;
key_root
=
info
->
lastpos
;
keylen
=
0
;
if
(
share
->
concurrent_insert
)
mysql_rwlock_rdlock
(
&
share
->
key_root_lock
[
aio
->
keynr
]);
r
=
_mi_search_first
(
info
,
keyinfo
,
key_root
);
goto
do_skip
;
}
...
...
@@ -153,6 +164,9 @@ static int walk_and_match(FT_WORD *word, uint32 count, ALL_IN_ONE *aio)
if
(
gweight
<
0
||
doc_cnt
>
2000000
)
gweight
=
0
;
if
(
share
->
concurrent_insert
)
mysql_rwlock_rdlock
(
&
share
->
key_root_lock
[
aio
->
keynr
]);
if
(
_mi_test_if_changed
(
info
)
==
0
)
r
=
_mi_search_next
(
info
,
keyinfo
,
info
->
lastkey
,
info
->
lastkey_length
,
SEARCH_BIGGER
,
key_root
);
...
...
@@ -165,6 +179,8 @@ do_skip:
r
=
_mi_search_next
(
info
,
keyinfo
,
info
->
lastkey
,
info
->
lastkey_length
,
SEARCH_BIGGER
,
key_root
);
if
(
share
->
concurrent_insert
)
mysql_rwlock_unlock
(
&
share
->
key_root_lock
[
aio
->
keynr
]);
}
word
->
weight
=
gweight
;
...
...
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