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
ca1ad1c5
Commit
ca1ad1c5
authored
Nov 18, 2008
by
Sergey Vojtovich
Browse files
Options
Browse Files
Download
Plain Diff
Merge.
parents
5271bee1
780186f9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
1 deletion
+58
-1
mysql-test/r/fulltext.result
mysql-test/r/fulltext.result
+28
-0
mysql-test/t/fulltext.test
mysql-test/t/fulltext.test
+27
-0
sql/item_func.cc
sql/item_func.cc
+3
-1
No files found.
mysql-test/r/fulltext.result
View file @
ca1ad1c5
...
...
@@ -494,3 +494,31 @@ SELECT a FROM t1 WHERE MATCH a AGAINST ('+city* of*' IN BOOLEAN MODE);
a
City Of God
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(255), b INT, FULLTEXT(a), KEY(b));
INSERT INTO t1 VALUES('test', 1),('test', 1),('test', 1),('test', 1),
('test', 1),('test', 2),('test', 3),('test', 4);
EXPLAIN SELECT * FROM t1
WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 fulltext b,a a 0 1 Using where
EXPLAIN SELECT * FROM t1 USE INDEX(a)
WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 fulltext a a 0 1 Using where
EXPLAIN SELECT * FROM t1 FORCE INDEX(a)
WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 fulltext a a 0 1 Using where
EXPLAIN SELECT * FROM t1 IGNORE INDEX(a)
WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref b b 5 const 4 Using where
EXPLAIN SELECT * FROM t1 USE INDEX(b)
WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref b b 5 const 4 Using where
EXPLAIN SELECT * FROM t1 FORCE INDEX(b)
WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref b b 5 const 4 Using where
DROP TABLE t1;
mysql-test/t/fulltext.test
View file @
ca1ad1c5
...
...
@@ -418,3 +418,30 @@ SELECT a FROM t1 WHERE MATCH a AGAINST ('+city* of*' IN BOOLEAN MODE);
DROP
TABLE
t1
;
# End of 4.1 tests
#
# BUG#38842 - Fix for 25951 seems incorrect
#
CREATE
TABLE
t1
(
a
VARCHAR
(
255
),
b
INT
,
FULLTEXT
(
a
),
KEY
(
b
));
INSERT
INTO
t1
VALUES
(
'test'
,
1
),(
'test'
,
1
),(
'test'
,
1
),(
'test'
,
1
),
(
'test'
,
1
),(
'test'
,
2
),(
'test'
,
3
),(
'test'
,
4
);
EXPLAIN
SELECT
*
FROM
t1
WHERE
MATCH
(
a
)
AGAINST
(
'test'
IN
BOOLEAN
MODE
)
AND
b
=
1
;
EXPLAIN
SELECT
*
FROM
t1
USE
INDEX
(a)
WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1
;
EXPLAIN
SELECT
*
FROM
t1
FORCE
INDEX
(
a
)
WHERE
MATCH
(
a
)
AGAINST
(
'test'
IN
BOOLEAN
MODE
)
AND
b
=
1
;
EXPLAIN
SELECT
*
FROM
t1
IGNORE
INDEX
(
a
)
WHERE
MATCH
(
a
)
AGAINST
(
'test'
IN
BOOLEAN
MODE
)
AND
b
=
1
;
EXPLAIN
SELECT
*
FROM
t1
USE
INDEX
(b)
WHERE MATCH(a) AGAINST('test' IN BOOLEAN MODE) AND b=1
;
EXPLAIN
SELECT
*
FROM
t1
FORCE
INDEX
(
b
)
WHERE
MATCH
(
a
)
AGAINST
(
'test'
IN
BOOLEAN
MODE
)
AND
b
=
1
;
DROP
TABLE
t1
;
sql/item_func.cc
View file @
ca1ad1c5
...
...
@@ -5383,7 +5383,9 @@ bool Item_func_match::fix_index()
for
(
keynr
=
0
;
keynr
<
table
->
s
->
keys
;
keynr
++
)
{
if
((
table
->
key_info
[
keynr
].
flags
&
HA_FULLTEXT
)
&&
(
table
->
s
->
keys_in_use
.
is_set
(
keynr
)))
(
flags
&
FT_BOOL
?
table
->
keys_in_use_for_query
.
is_set
(
keynr
)
:
table
->
s
->
keys_in_use
.
is_set
(
keynr
)))
{
ft_to_key
[
fts
]
=
keynr
;
ft_cnt
[
fts
]
=
0
;
...
...
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