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
4f8bbaed
Commit
4f8bbaed
authored
Aug 19, 2004
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug #4769 - ft in subqueries
parent
96ac7329
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
4 deletions
+32
-4
mysql-test/r/subselect.result
mysql-test/r/subselect.result
+13
-0
mysql-test/t/subselect.test
mysql-test/t/subselect.test
+13
-0
sql/sql_select.cc
sql/sql_select.cc
+6
-4
No files found.
mysql-test/r/subselect.result
View file @
4f8bbaed
...
...
@@ -1899,3 +1899,16 @@ select t000.a, count(*) `C` FROM t1 t000 GROUP BY t000.a HAVING count(*) > ALL (
a C
1 1
drop table t1,t2;
create table t1 (a int not null auto_increment primary key, b varchar(40), fulltext(b));
insert into t1 (b) values ('ball'),('ball games'), ('games'), ('foo'), ('foobar'), ('Serg'), ('Sergei'),('Georg'), ('Patrik'),('Hakan');
create table t2 (a int);
insert into t2 values (1),(3),(2),(7);
select a,b from t1 where match(b) against ('Ball') > 0;
a b
1 ball
2 ball games
select a from t2 where a in (select a from t1 where match(b) against ('Ball') > 0);
a
1
2
drop table t1,t2;
mysql-test/t/subselect.test
View file @
4f8bbaed
...
...
@@ -1222,3 +1222,16 @@ CREATE TABLE `t2` ( `b` int(11) default NULL, `a` int(11) default NULL) ENGINE=M
insert
into
t2
values
(
1
,
2
);
select
t000
.
a
,
count
(
*
)
`C`
FROM
t1
t000
GROUP
BY
t000
.
a
HAVING
count
(
*
)
>
ALL
(
SELECT
count
(
*
)
FROM
t2
t001
WHERE
t001
.
a
=
1
);
drop
table
t1
,
t2
;
#
# BUG#4769 - fulltext in subselect
#
create
table
t1
(
a
int
not
null
auto_increment
primary
key
,
b
varchar
(
40
),
fulltext
(
b
));
insert
into
t1
(
b
)
values
(
'ball'
),(
'ball games'
),
(
'games'
),
(
'foo'
),
(
'foobar'
),
(
'Serg'
),
(
'Sergei'
),(
'Georg'
),
(
'Patrik'
),(
'Hakan'
);
create
table
t2
(
a
int
);
insert
into
t2
values
(
1
),(
3
),(
2
),(
7
);
select
a
,
b
from
t1
where
match
(
b
)
against
(
'Ball'
)
>
0
;
select
a
from
t2
where
a
in
(
select
a
from
t1
where
match
(
b
)
against
(
'Ball'
)
>
0
);
drop
table
t1
,
t2
;
sql/sql_select.cc
View file @
4f8bbaed
...
...
@@ -729,6 +729,10 @@ JOIN::optimize()
(
select_lex
->
ftfunc_list
->
elements
?
SELECT_NO_JOIN_CACHE
:
0
));
/* Perform FULLTEXT search before all regular searches */
if
(
!
(
select_options
&
SELECT_DESCRIBE
))
init_ftfuncs
(
thd
,
select_lex
,
test
(
order
));
/*
is this simple IN subquery?
*/
...
...
@@ -849,8 +853,6 @@ JOIN::optimize()
}
having
=
0
;
/* Perform FULLTEXT search before all regular searches */
init_ftfuncs
(
thd
,
select_lex
,
test
(
order
));
/* Create a tmp table if distinct or if the sort is too complicated */
if
(
need_tmp
)
{
...
...
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