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
55308671
Commit
55308671
authored
Apr 30, 2009
by
Sergey Vojtovich
Browse files
Options
Browse Files
Download
Plain Diff
Merge to 5.1-bugteam.
parents
943b90fb
f3d921c0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
2 deletions
+36
-2
mysql-test/r/fulltext.result
mysql-test/r/fulltext.result
+8
-0
mysql-test/t/fulltext.test
mysql-test/t/fulltext.test
+9
-0
storage/myisam/ft_boolean_search.c
storage/myisam/ft_boolean_search.c
+19
-2
No files found.
mysql-test/r/fulltext.result
View file @
55308671
...
...
@@ -535,3 +535,11 @@ CREATE TABLE t1(a TEXT);
SELECT GROUP_CONCAT(a) AS st FROM t1 HAVING MATCH(st) AGAINST('test' IN BOOLEAN MODE);
ERROR HY000: Incorrect arguments to AGAINST
DROP TABLE t1;
CREATE TABLE t1(a VARCHAR(64), FULLTEXT(a));
INSERT INTO t1 VALUES('awrd bwrd cwrd'),('awrd bwrd cwrd'),('awrd bwrd cwrd');
SELECT * FROM t1 WHERE MATCH(a) AGAINST('+awrd bwrd* +cwrd*' IN BOOLEAN MODE);
a
awrd bwrd cwrd
awrd bwrd cwrd
awrd bwrd cwrd
DROP TABLE t1;
mysql-test/t/fulltext.test
View file @
55308671
...
...
@@ -462,3 +462,12 @@ CREATE TABLE t1(a TEXT);
--
error
ER_WRONG_ARGUMENTS
SELECT
GROUP_CONCAT
(
a
)
AS
st
FROM
t1
HAVING
MATCH
(
st
)
AGAINST
(
'test'
IN
BOOLEAN
MODE
);
DROP
TABLE
t1
;
#
# BUG#42907 - Multi-term boolean fulltext query containing a single
# quote fails in 5.1.x
#
CREATE
TABLE
t1
(
a
VARCHAR
(
64
),
FULLTEXT
(
a
));
INSERT
INTO
t1
VALUES
(
'awrd bwrd cwrd'
),(
'awrd bwrd cwrd'
),(
'awrd bwrd cwrd'
);
SELECT
*
FROM
t1
WHERE
MATCH
(
a
)
AGAINST
(
'+awrd bwrd* +cwrd*'
IN
BOOLEAN
MODE
);
DROP
TABLE
t1
;
storage/myisam/ft_boolean_search.c
View file @
55308671
...
...
@@ -335,7 +335,23 @@ static int _ftb_no_dupes_cmp(void* not_used __attribute__((unused)),
return
CMP_NUM
((
*
((
my_off_t
*
)
a
)),
(
*
((
my_off_t
*
)
b
)));
}
/* returns 1 if the search was finished (must-word wasn't found) */
/*
When performing prefix search (a word with truncation operator), we
must preserve original prefix to ensure that characters which may be
expanded/contracted do not break the prefix. This is done by storing
newly found key immediatly after the original word in ftbw->word
buffer.
ftbw->word= LENGTH WORD [ LENGTH1 WORD1 ] WEIGHT REFERENCE
LENGTH - 1 byte, length of the WORD
WORD - LENGTH bytes, the word itself
LENGTH1 - 1 byte, length of the WORD1, present in case of prefix search
WORD1 - LENGTH bytes, the word itself, present in case of prefix search
WEIGHT - 4 bytes (HA_FT_WLEN), either weight or number of subkeys
REFERENCE - rec_reflength bytes, pointer to the record
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
)
{
int
r
;
...
...
@@ -369,7 +385,8 @@ static int _ft2_search(FTB *ftb, FTB_WORD *ftbw, my_bool init_search)
if
(
ftbw
->
docid
[
0
]
<
max_docid
)
{
sflag
|=
SEARCH_SAME
;
_mi_dpointer
(
info
,
(
uchar
*
)(
ftbw
->
word
+
ftbw
->
len
+
HA_FT_WLEN
),
_mi_dpointer
(
info
,
(
uchar
*
)
(
lastkey_buf
+
HA_FT_WLEN
+
(
ftbw
->
off
?
0
:
lastkey_buf
[
0
]
+
1
)),
max_docid
);
}
r
=
_mi_search
(
info
,
ftbw
->
keyinfo
,
(
uchar
*
)
lastkey_buf
,
...
...
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