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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
b3ca82ee
Commit
b3ca82ee
authored
Oct 15, 2003
by
serg@serg.mylan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
get rid of default_charset_info for index fulltext searches
parent
0ee817e7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
18 deletions
+16
-18
myisam/ft_boolean_search.c
myisam/ft_boolean_search.c
+4
-4
myisam/ft_parser.c
myisam/ft_parser.c
+9
-11
myisam/ft_stopwords.c
myisam/ft_stopwords.c
+1
-1
myisam/ftdefs.h
myisam/ftdefs.h
+2
-2
No files found.
myisam/ft_boolean_search.c
View file @
b3ca82ee
...
...
@@ -144,7 +144,7 @@ static void _ftb_parse_query(FTB *ftb, byte **start, byte *end,
param
.
prev
=
' '
;
param
.
quot
=
up
->
quot
;
while
((
res
=
ft_get_word
(
start
,
end
,
&
w
,
&
param
)))
while
((
res
=
ft_get_word
(
ftb
->
charset
,
start
,
end
,
&
w
,
&
param
)))
{
int
r
=
param
.
plusminus
;
float
weight
=
(
float
)
(
param
.
pmsign
?
nwghts
:
wghts
)[(
r
>
5
)
?
5
:
((
r
<-
5
)
?-
5
:
r
)];
...
...
@@ -354,8 +354,7 @@ FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, byte *query,
ftb
->
info
=
info
;
ftb
->
keynr
=
keynr
;
ftb
->
charset
=
((
keynr
==
NO_SUCH_KEY
)
?
default_charset_info
:
info
->
s
->
keyinfo
[
keynr
].
seg
->
charset
);
default_charset_info
:
info
->
s
->
keyinfo
[
keynr
].
seg
->
charset
);
ftb
->
with_scan
=
0
;
ftb
->
lastpos
=
HA_POS_ERROR
;
bzero
(
&
ftb
->
no_dupes
,
sizeof
(
TREE
));
...
...
@@ -609,7 +608,8 @@ float ft_boolean_find_relevance(FT_INFO *ftb, byte *record, uint length)
continue
;
end
=
ftsi
.
pos
+
ftsi
.
len
;
while
(
ft_simple_get_word
((
byte
**
)
&
ftsi
.
pos
,(
byte
*
)
end
,
&
word
))
while
(
ft_simple_get_word
(
ftb
->
charset
,
(
byte
**
)
&
ftsi
.
pos
,
(
byte
*
)
end
,
&
word
))
{
int
a
,
b
,
c
;
for
(
a
=
0
,
b
=
ftb
->
queue
.
elements
,
c
=
(
a
+
b
)
/
2
;
b
-
a
>
1
;
c
=
(
a
+
b
)
/
2
)
...
...
myisam/ft_parser.c
View file @
b3ca82ee
...
...
@@ -79,7 +79,8 @@ FT_WORD * ft_linearize(TREE *wtree)
* 2 - left bracket
* 3 - right bracket
*/
byte
ft_get_word
(
byte
**
start
,
byte
*
end
,
FT_WORD
*
word
,
FTB_PARAM
*
param
)
byte
ft_get_word
(
CHARSET_INFO
*
cs
,
byte
**
start
,
byte
*
end
,
FT_WORD
*
word
,
FTB_PARAM
*
param
)
{
byte
*
doc
=*
start
;
int
mwc
;
...
...
@@ -91,11 +92,7 @@ byte ft_get_word(byte **start, byte *end, FT_WORD *word, FTB_PARAM *param)
{
for
(;
doc
<
end
;
doc
++
)
{
/*
BAR TODO: discuss with Serge how to remove
default_charset_info correctly
*/
if
(
true_word_char
(
default_charset_info
,
*
doc
))
break
;
if
(
true_word_char
(
cs
,
*
doc
))
break
;
if
(
*
doc
==
FTB_RQUOT
&&
param
->
quot
)
{
param
->
quot
=
doc
;
*
start
=
doc
+
1
;
...
...
@@ -125,7 +122,7 @@ byte ft_get_word(byte **start, byte *end, FT_WORD *word, FTB_PARAM *param)
mwc
=
0
;
for
(
word
->
pos
=
doc
;
doc
<
end
;
doc
++
)
if
(
true_word_char
(
default_charset_info
,
*
doc
))
if
(
true_word_char
(
cs
,
*
doc
))
mwc
=
0
;
else
if
(
!
misc_word_char
(
*
doc
)
||
mwc
++
)
break
;
...
...
@@ -145,7 +142,8 @@ byte ft_get_word(byte **start, byte *end, FT_WORD *word, FTB_PARAM *param)
return
0
;
}
byte
ft_simple_get_word
(
byte
**
start
,
byte
*
end
,
FT_WORD
*
word
)
byte
ft_simple_get_word
(
CHARSET_INFO
*
cs
,
byte
**
start
,
byte
*
end
,
FT_WORD
*
word
)
{
byte
*
doc
=*
start
;
int
mwc
;
...
...
@@ -155,12 +153,12 @@ byte ft_simple_get_word(byte **start, byte *end, FT_WORD *word)
{
for
(;
doc
<
end
;
doc
++
)
{
if
(
true_word_char
(
default_charset_info
,
*
doc
))
break
;
if
(
true_word_char
(
cs
,
*
doc
))
break
;
}
mwc
=
0
;
for
(
word
->
pos
=
doc
;
doc
<
end
;
doc
++
)
if
(
true_word_char
(
default_charset_info
,
*
doc
))
if
(
true_word_char
(
cs
,
*
doc
))
mwc
=
0
;
else
if
(
!
misc_word_char
(
*
doc
)
||
mwc
++
)
break
;
...
...
@@ -191,7 +189,7 @@ int ft_parse(TREE *wtree, byte *doc, int doclen)
FT_WORD
w
;
DBUG_ENTER
(
"ft_parse"
);
while
(
ft_simple_get_word
(
&
doc
,
end
,
&
w
))
while
(
ft_simple_get_word
(
wtree
->
custom_arg
,
&
doc
,
end
,
&
w
))
{
if
(
!
tree_insert
(
wtree
,
&
w
,
0
,
wtree
->
custom_arg
))
goto
err
;
...
...
myisam/ft_stopwords.c
View file @
b3ca82ee
...
...
@@ -81,7 +81,7 @@ int ft_init_stopwords()
goto
err0
;
len
=
my_read
(
fd
,
buffer
,
len
,
MYF
(
MY_WME
));
end
=
start
+
len
;
while
(
ft_simple_get_word
(
&
start
,
end
,
&
w
))
while
(
ft_simple_get_word
(
default_charset_info
,
&
start
,
end
,
&
w
))
{
if
(
ft_add_stopword
(
my_strdup_with_length
(
w
.
pos
,
w
.
len
,
MYF
(
0
))))
goto
err1
;
...
...
myisam/ftdefs.h
View file @
b3ca82ee
...
...
@@ -108,8 +108,8 @@ int is_stopword(char *word, uint len);
uint
_ft_make_key
(
MI_INFO
*
,
uint
,
byte
*
,
FT_WORD
*
,
my_off_t
);
byte
ft_get_word
(
byte
**
,
byte
*
,
FT_WORD
*
,
FTB_PARAM
*
);
byte
ft_simple_get_word
(
byte
**
,
byte
*
,
FT_WORD
*
);
byte
ft_get_word
(
CHARSET_INFO
*
,
byte
**
,
byte
*
,
FT_WORD
*
,
FTB_PARAM
*
);
byte
ft_simple_get_word
(
CHARSET_INFO
*
,
byte
**
,
byte
*
,
FT_WORD
*
);
typedef
struct
_st_ft_seg_iterator
{
uint
num
,
len
;
...
...
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