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
714cf568
Commit
714cf568
authored
Jan 26, 2006
by
svoj@april.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG#16722 - Fulltext: implicit limit for query word number (depends on length of the query)
Remove implicit limit for query word number.
parent
d07232a0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
18 deletions
+25
-18
mysql-test/r/fulltext.result
mysql-test/r/fulltext.result
+5
-5
storage/myisam/ft_boolean_search.c
storage/myisam/ft_boolean_search.c
+20
-13
No files found.
mysql-test/r/fulltext.result
View file @
714cf568
...
@@ -182,13 +182,13 @@ create table t1 (a varchar(200) not null, fulltext (a));
...
@@ -182,13 +182,13 @@ create table t1 (a varchar(200) not null, fulltext (a));
insert t1 values ("aaa10 bbb20"), ("aaa20 bbb15"), ("aaa30 bbb10");
insert t1 values ("aaa10 bbb20"), ("aaa20 bbb15"), ("aaa30 bbb10");
select * from t1 where match a against ("+aaa* +bbb*" in boolean mode);
select * from t1 where match a against ("+aaa* +bbb*" in boolean mode);
a
a
aaa10 bbb20
aaa20 bbb15
aaa30 bbb10
aaa30 bbb10
aaa20 bbb15
aaa10 bbb20
select * from t1 where match a against ("+aaa* +bbb1*" in boolean mode);
select * from t1 where match a against ("+aaa* +bbb1*" in boolean mode);
a
a
aaa20 bbb15
aaa30 bbb10
aaa30 bbb10
aaa20 bbb15
select * from t1 where match a against ("+aaa* +ccc*" in boolean mode);
select * from t1 where match a against ("+aaa* +ccc*" in boolean mode);
a
a
select * from t1 where match a against ("+aaa10 +(bbb*)" in boolean mode);
select * from t1 where match a against ("+aaa10 +(bbb*)" in boolean mode);
...
@@ -196,12 +196,12 @@ a
...
@@ -196,12 +196,12 @@ a
aaa10 bbb20
aaa10 bbb20
select * from t1 where match a against ("+(+aaa* +bbb1*)" in boolean mode);
select * from t1 where match a against ("+(+aaa* +bbb1*)" in boolean mode);
a
a
aaa20 bbb15
aaa30 bbb10
aaa30 bbb10
aaa20 bbb15
select * from t1 where match a against ("(+aaa* +bbb1*)" in boolean mode);
select * from t1 where match a against ("(+aaa* +bbb1*)" in boolean mode);
a
a
aaa20 bbb15
aaa30 bbb10
aaa30 bbb10
aaa20 bbb15
drop table t1;
drop table t1;
CREATE TABLE t1 (
CREATE TABLE t1 (
id int(11),
id int(11),
...
...
storage/myisam/ft_boolean_search.c
View file @
714cf568
...
@@ -107,6 +107,7 @@ typedef struct st_ftb_word
...
@@ -107,6 +107,7 @@ typedef struct st_ftb_word
my_off_t
key_root
;
my_off_t
key_root
;
my_off_t
*
max_docid
;
my_off_t
*
max_docid
;
MI_KEYDEF
*
keyinfo
;
MI_KEYDEF
*
keyinfo
;
struct
st_ftb_word
*
prev
;
float
weight
;
float
weight
;
uint
ndepth
;
uint
ndepth
;
uint
len
;
uint
len
;
...
@@ -121,6 +122,7 @@ typedef struct st_ft_info
...
@@ -121,6 +122,7 @@ typedef struct st_ft_info
CHARSET_INFO
*
charset
;
CHARSET_INFO
*
charset
;
FTB_EXPR
*
root
;
FTB_EXPR
*
root
;
FTB_WORD
**
list
;
FTB_WORD
**
list
;
FTB_WORD
*
last_word
;
MEM_ROOT
mem_root
;
MEM_ROOT
mem_root
;
QUEUE
queue
;
QUEUE
queue
;
TREE
no_dupes
;
TREE
no_dupes
;
...
@@ -199,7 +201,9 @@ static int ftb_query_add_word(void *param, byte *word, uint word_len,
...
@@ -199,7 +201,9 @@ static int ftb_query_add_word(void *param, byte *word, uint word_len,
memcpy
(
ftbw
->
word
+
1
,
word
,
word_len
);
memcpy
(
ftbw
->
word
+
1
,
word
,
word_len
);
ftbw
->
word
[
0
]
=
word_len
;
ftbw
->
word
[
0
]
=
word_len
;
if
(
info
->
yesno
>
0
)
ftbw
->
up
->
ythresh
++
;
if
(
info
->
yesno
>
0
)
ftbw
->
up
->
ythresh
++
;
queue_insert
(
&
ftb_param
->
ftb
->
queue
,
(
byte
*
)
ftbw
);
ftb_param
->
ftb
->
queue
.
max_elements
++
;
ftbw
->
prev
=
ftb_param
->
ftb
->
last_word
;
ftb_param
->
ftb
->
last_word
=
ftbw
;
ftb_param
->
ftb
->
with_scan
|=
(
info
->
trunc
&
FTB_FLAG_TRUNC
);
ftb_param
->
ftb
->
with_scan
|=
(
info
->
trunc
&
FTB_FLAG_TRUNC
);
for
(
tmp_expr
=
ftb_param
->
ftbe
;
tmp_expr
->
up
;
tmp_expr
=
tmp_expr
->
up
)
for
(
tmp_expr
=
ftb_param
->
ftbe
;
tmp_expr
->
up
;
tmp_expr
=
tmp_expr
->
up
)
if
(
!
(
tmp_expr
->
flags
&
FTB_FLAG_YES
))
if
(
!
(
tmp_expr
->
flags
&
FTB_FLAG_YES
))
...
@@ -505,7 +509,7 @@ FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, byte *query,
...
@@ -505,7 +509,7 @@ FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, byte *query,
{
{
FTB
*
ftb
;
FTB
*
ftb
;
FTB_EXPR
*
ftbe
;
FTB_EXPR
*
ftbe
;
uint
res
;
FTB_WORD
*
ftbw
;
if
(
!
(
ftb
=
(
FTB
*
)
my_malloc
(
sizeof
(
FTB
),
MYF
(
MY_WME
))))
if
(
!
(
ftb
=
(
FTB
*
)
my_malloc
(
sizeof
(
FTB
),
MYF
(
MY_WME
))))
return
0
;
return
0
;
...
@@ -518,19 +522,10 @@ FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, byte *query,
...
@@ -518,19 +522,10 @@ FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, byte *query,
ftb
->
with_scan
=
0
;
ftb
->
with_scan
=
0
;
ftb
->
lastpos
=
HA_OFFSET_ERROR
;
ftb
->
lastpos
=
HA_OFFSET_ERROR
;
bzero
(
&
ftb
->
no_dupes
,
sizeof
(
TREE
));
bzero
(
&
ftb
->
no_dupes
,
sizeof
(
TREE
));
ftb
->
last_word
=
0
;
init_alloc_root
(
&
ftb
->
mem_root
,
1024
,
1024
);
init_alloc_root
(
&
ftb
->
mem_root
,
1024
,
1024
);
ftb
->
queue
.
max_elements
=
0
;
/*
Hack: instead of init_queue, we'll use reinit queue to be able
to alloc queue with alloc_root()
*/
res
=
ftb
->
queue
.
max_elements
=
1
+
query_len
/
2
;
if
(
!
(
ftb
->
queue
.
root
=
(
byte
**
)
alloc_root
(
&
ftb
->
mem_root
,
(
res
+
1
)
*
sizeof
(
void
*
))))
goto
err
;
reinit_queue
(
&
ftb
->
queue
,
res
,
0
,
0
,
(
int
(
*
)(
void
*
,
byte
*
,
byte
*
))
FTB_WORD_cmp
,
0
);
if
(
!
(
ftbe
=
(
FTB_EXPR
*
)
alloc_root
(
&
ftb
->
mem_root
,
sizeof
(
FTB_EXPR
))))
if
(
!
(
ftbe
=
(
FTB_EXPR
*
)
alloc_root
(
&
ftb
->
mem_root
,
sizeof
(
FTB_EXPR
))))
goto
err
;
goto
err
;
ftbe
->
weight
=
1
;
ftbe
->
weight
=
1
;
...
@@ -545,6 +540,18 @@ FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, byte *query,
...
@@ -545,6 +540,18 @@ FT_INFO * ft_init_boolean_search(MI_INFO *info, uint keynr, byte *query,
_ftb_parse_query
(
ftb
,
query
,
query_len
,
keynr
==
NO_SUCH_KEY
?
_ftb_parse_query
(
ftb
,
query
,
query_len
,
keynr
==
NO_SUCH_KEY
?
&
ft_default_parser
:
&
ft_default_parser
:
info
->
s
->
keyinfo
[
keynr
].
parser
);
info
->
s
->
keyinfo
[
keynr
].
parser
);
/*
Hack: instead of init_queue, we'll use reinit queue to be able
to alloc queue with alloc_root()
*/
if
(
!
(
ftb
->
queue
.
root
=
(
byte
**
)
alloc_root
(
&
ftb
->
mem_root
,
(
ftb
->
queue
.
max_elements
+
1
)
*
sizeof
(
void
*
))))
goto
err
;
reinit_queue
(
&
ftb
->
queue
,
ftb
->
queue
.
max_elements
,
0
,
0
,
(
int
(
*
)(
void
*
,
byte
*
,
byte
*
))
FTB_WORD_cmp
,
0
);
for
(
ftbw
=
ftb
->
last_word
;
ftbw
;
ftbw
=
ftbw
->
prev
)
queue_insert
(
&
ftb
->
queue
,
(
byte
*
)
ftbw
);
ftb
->
list
=
(
FTB_WORD
**
)
alloc_root
(
&
ftb
->
mem_root
,
ftb
->
list
=
(
FTB_WORD
**
)
alloc_root
(
&
ftb
->
mem_root
,
sizeof
(
FTB_WORD
*
)
*
ftb
->
queue
.
elements
);
sizeof
(
FTB_WORD
*
)
*
ftb
->
queue
.
elements
);
memcpy
(
ftb
->
list
,
ftb
->
queue
.
root
+
1
,
sizeof
(
FTB_WORD
*
)
*
ftb
->
queue
.
elements
);
memcpy
(
ftb
->
list
,
ftb
->
queue
.
root
+
1
,
sizeof
(
FTB_WORD
*
)
*
ftb
->
queue
.
elements
);
...
...
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