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
40e25a30
Commit
40e25a30
authored
Nov 12, 2004
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wrong constant fixed - boolean fulltext searches like "+something +smth*"
were stopping at docid 0xffffffff
parent
0f3b604d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
myisam/ft_boolean_search.c
myisam/ft_boolean_search.c
+10
-10
No files found.
myisam/ft_boolean_search.c
View file @
40e25a30
...
@@ -161,7 +161,7 @@ static void _ftb_parse_query(FTB *ftb, byte **start, byte *end,
...
@@ -161,7 +161,7 @@ static void _ftb_parse_query(FTB *ftb, byte **start, byte *end,
if
(
param
.
trunc
)
ftbw
->
flags
|=
FTB_FLAG_TRUNC
;
if
(
param
.
trunc
)
ftbw
->
flags
|=
FTB_FLAG_TRUNC
;
ftbw
->
weight
=
weight
;
ftbw
->
weight
=
weight
;
ftbw
->
up
=
up
;
ftbw
->
up
=
up
;
ftbw
->
docid
[
0
]
=
ftbw
->
docid
[
1
]
=
HA_
POS
_ERROR
;
ftbw
->
docid
[
0
]
=
ftbw
->
docid
[
1
]
=
HA_
OFFSET
_ERROR
;
ftbw
->
ndepth
=
(
param
.
yesno
<
0
)
+
depth
;
ftbw
->
ndepth
=
(
param
.
yesno
<
0
)
+
depth
;
memcpy
(
ftbw
->
word
+
1
,
w
.
pos
,
w
.
len
);
memcpy
(
ftbw
->
word
+
1
,
w
.
pos
,
w
.
len
);
ftbw
->
word
[
0
]
=
w
.
len
;
ftbw
->
word
[
0
]
=
w
.
len
;
...
@@ -177,7 +177,7 @@ static void _ftb_parse_query(FTB *ftb, byte **start, byte *end,
...
@@ -177,7 +177,7 @@ static void _ftb_parse_query(FTB *ftb, byte **start, byte *end,
ftbe
->
weight
=
weight
;
ftbe
->
weight
=
weight
;
ftbe
->
up
=
up
;
ftbe
->
up
=
up
;
ftbe
->
ythresh
=
ftbe
->
yweaks
=
0
;
ftbe
->
ythresh
=
ftbe
->
yweaks
=
0
;
ftbe
->
docid
[
0
]
=
ftbe
->
docid
[
1
]
=
HA_
POS
_ERROR
;
ftbe
->
docid
[
0
]
=
ftbe
->
docid
[
1
]
=
HA_
OFFSET
_ERROR
;
if
((
ftbe
->
quot
=
param
.
quot
))
ftb
->
with_scan
|=
2
;
if
((
ftbe
->
quot
=
param
.
quot
))
ftb
->
with_scan
|=
2
;
if
(
param
.
yesno
>
0
)
up
->
ythresh
++
;
if
(
param
.
yesno
>
0
)
up
->
ythresh
++
;
_ftb_parse_query
(
ftb
,
start
,
end
,
ftbe
,
depth
+
1
);
_ftb_parse_query
(
ftb
,
start
,
end
,
ftbe
,
depth
+
1
);
...
@@ -245,7 +245,7 @@ static void _ftb_init_index_search(FT_INFO *ftb)
...
@@ -245,7 +245,7 @@ static void _ftb_init_index_search(FT_INFO *ftb)
ftbe
->
up
->
ythresh
-
ftbe
->
up
->
yweaks
>
1
)
/* 1 */
ftbe
->
up
->
ythresh
-
ftbe
->
up
->
yweaks
>
1
)
/* 1 */
{
{
FTB_EXPR
*
top_ftbe
=
ftbe
->
up
->
up
;
FTB_EXPR
*
top_ftbe
=
ftbe
->
up
->
up
;
ftbw
->
docid
[
0
]
=
HA_
POS
_ERROR
;
ftbw
->
docid
[
0
]
=
HA_
OFFSET
_ERROR
;
for
(
ftbe
=
ftbw
->
up
;
ftbe
!=
top_ftbe
;
ftbe
=
ftbe
->
up
)
for
(
ftbe
=
ftbw
->
up
;
ftbe
!=
top_ftbe
;
ftbe
=
ftbe
->
up
)
if
(
ftbe
->
flags
&
FTB_FLAG_YES
)
if
(
ftbe
->
flags
&
FTB_FLAG_YES
)
ftbe
->
yweaks
++
;
ftbe
->
yweaks
++
;
...
@@ -319,7 +319,7 @@ FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, byte *query,
...
@@ -319,7 +319,7 @@ FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, byte *query,
default_charset_info
:
default_charset_info
:
info
->
s
->
keyinfo
[
keynr
].
seg
->
charset
);
info
->
s
->
keyinfo
[
keynr
].
seg
->
charset
);
ftb
->
with_scan
=
0
;
ftb
->
with_scan
=
0
;
ftb
->
lastpos
=
HA_
POS
_ERROR
;
ftb
->
lastpos
=
HA_
OFFSET
_ERROR
;
bzero
(
&
ftb
->
no_dupes
,
sizeof
(
TREE
));
bzero
(
&
ftb
->
no_dupes
,
sizeof
(
TREE
));
init_alloc_root
(
&
ftb
->
mem_root
,
1024
,
1024
);
init_alloc_root
(
&
ftb
->
mem_root
,
1024
,
1024
);
...
@@ -342,7 +342,7 @@ FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, byte *query,
...
@@ -342,7 +342,7 @@ FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, byte *query,
ftbe
->
quot
=
0
;
ftbe
->
quot
=
0
;
ftbe
->
up
=
0
;
ftbe
->
up
=
0
;
ftbe
->
ythresh
=
ftbe
->
yweaks
=
0
;
ftbe
->
ythresh
=
ftbe
->
yweaks
=
0
;
ftbe
->
docid
[
0
]
=
ftbe
->
docid
[
1
]
=
HA_
POS
_ERROR
;
ftbe
->
docid
[
0
]
=
ftbe
->
docid
[
1
]
=
HA_
OFFSET
_ERROR
;
ftb
->
root
=
ftbe
;
ftb
->
root
=
ftbe
;
_ftb_parse_query
(
ftb
,
&
query
,
query
+
query_len
,
ftbe
,
0
);
_ftb_parse_query
(
ftb
,
&
query
,
query
+
query_len
,
ftbe
,
0
);
ftb
->
list
=
(
FTB_WORD
**
)
alloc_root
(
&
ftb
->
mem_root
,
ftb
->
list
=
(
FTB_WORD
**
)
alloc_root
(
&
ftb
->
mem_root
,
...
@@ -496,7 +496,7 @@ int ft_boolean_read_next(FT_INFO *ftb, char *record)
...
@@ -496,7 +496,7 @@ int ft_boolean_read_next(FT_INFO *ftb, char *record)
while
(
ftb
->
state
==
INDEX_SEARCH
&&
while
(
ftb
->
state
==
INDEX_SEARCH
&&
(
curdoc
=
((
FTB_WORD
*
)
queue_top
(
&
ftb
->
queue
))
->
docid
[
0
])
!=
(
curdoc
=
((
FTB_WORD
*
)
queue_top
(
&
ftb
->
queue
))
->
docid
[
0
])
!=
HA_
POS
_ERROR
)
HA_
OFFSET
_ERROR
)
{
{
while
(
curdoc
==
(
ftbw
=
(
FTB_WORD
*
)
queue_top
(
&
ftb
->
queue
))
->
docid
[
0
])
while
(
curdoc
==
(
ftbw
=
(
FTB_WORD
*
)
queue_top
(
&
ftb
->
queue
))
->
docid
[
0
])
{
{
...
@@ -521,7 +521,7 @@ int ft_boolean_read_next(FT_INFO *ftb, char *record)
...
@@ -521,7 +521,7 @@ int ft_boolean_read_next(FT_INFO *ftb, char *record)
}
}
if
(
r
)
/* not found */
if
(
r
)
/* not found */
{
{
ftbw
->
docid
[
0
]
=
HA_
POS
_ERROR
;
ftbw
->
docid
[
0
]
=
HA_
OFFSET
_ERROR
;
if
(
ftbw
->
flags
&
FTB_FLAG_YES
&&
ftbw
->
up
->
up
==
0
)
if
(
ftbw
->
flags
&
FTB_FLAG_YES
&&
ftbw
->
up
->
up
==
0
)
{
{
/*
/*
...
@@ -580,7 +580,7 @@ float ft_boolean_find_relevance(FT_INFO *ftb, byte *record, uint length)
...
@@ -580,7 +580,7 @@ float ft_boolean_find_relevance(FT_INFO *ftb, byte *record, uint length)
const
byte
*
end
;
const
byte
*
end
;
my_off_t
docid
=
ftb
->
info
->
lastpos
;
my_off_t
docid
=
ftb
->
info
->
lastpos
;
if
(
docid
==
HA_
POS
_ERROR
)
if
(
docid
==
HA_
OFFSET
_ERROR
)
return
-
2
.
0
;
return
-
2
.
0
;
if
(
!
ftb
->
queue
.
elements
)
if
(
!
ftb
->
queue
.
elements
)
return
0
;
return
0
;
...
@@ -592,9 +592,9 @@ float ft_boolean_find_relevance(FT_INFO *ftb, byte *record, uint length)
...
@@ -592,9 +592,9 @@ float ft_boolean_find_relevance(FT_INFO *ftb, byte *record, uint length)
for
(
i
=
0
;
i
<
ftb
->
queue
.
elements
;
i
++
)
for
(
i
=
0
;
i
<
ftb
->
queue
.
elements
;
i
++
)
{
{
ftb
->
list
[
i
]
->
docid
[
1
]
=
HA_
POS
_ERROR
;
ftb
->
list
[
i
]
->
docid
[
1
]
=
HA_
OFFSET
_ERROR
;
for
(
x
=
ftb
->
list
[
i
]
->
up
;
x
;
x
=
x
->
up
)
for
(
x
=
ftb
->
list
[
i
]
->
up
;
x
;
x
=
x
->
up
)
x
->
docid
[
1
]
=
HA_
POS
_ERROR
;
x
->
docid
[
1
]
=
HA_
OFFSET
_ERROR
;
}
}
}
}
...
...
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