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
bd275bc6
Commit
bd275bc6
authored
Jul 14, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/opt/local/work/mysql-4.1-root
parents
253af6eb
97f79493
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
243 additions
and
3 deletions
+243
-3
mysql-test/r/fulltext_order_by.result
mysql-test/r/fulltext_order_by.result
+74
-0
mysql-test/r/select.result
mysql-test/r/select.result
+35
-0
mysql-test/t/fulltext_order_by.test
mysql-test/t/fulltext_order_by.test
+81
-0
mysql-test/t/select.test
mysql-test/t/select.test
+41
-0
sql/item_func.cc
sql/item_func.cc
+3
-0
sql/sql_select.cc
sql/sql_select.cc
+9
-3
No files found.
mysql-test/r/fulltext_order_by.result
View file @
bd275bc6
...
...
@@ -86,3 +86,77 @@ a rel
1 1
2 2
drop table t1;
CREATE TABLE t1 (
id int(11) NOT NULL auto_increment,
thread int(11) NOT NULL default '0',
beitrag longtext NOT NULL,
PRIMARY KEY (id),
KEY thread (thread),
FULLTEXT KEY beitrag (beitrag)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=7923 ;
CREATE TABLE t2 (
id int(11) NOT NULL auto_increment,
text varchar(100) NOT NULL default '',
PRIMARY KEY (id),
KEY text (text)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=63 ;
CREATE TABLE t3 (
id int(11) NOT NULL auto_increment,
forum int(11) NOT NULL default '0',
betreff varchar(70) NOT NULL default '',
PRIMARY KEY (id),
KEY forum (forum),
FULLTEXT KEY betreff (betreff)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=996 ;
select a.text, b.id, b.betreff
from
t2 a inner join t3 b on a.id = b.forum inner join
t1 c on b.id = c.thread
where
match(b.betreff) against ('+abc' in boolean mode)
group by a.text, b.id, b.betreff
union
select a.text, b.id, b.betreff
from
t2 a inner join t3 b on a.id = b.forum inner join
t1 c on b.id = c.thread
where
match(c.beitrag) against ('+abc' in boolean mode)
group by
a.text, b.id, b.betreff
order by
match(b.betreff) against ('+abc' in boolean mode) desc;
ERROR 42S02: Unknown table 'b' in order clause
select a.text, b.id, b.betreff
from
t2 a inner join t3 b on a.id = b.forum inner join
t1 c on b.id = c.thread
where
match(b.betreff) against ('+abc' in boolean mode)
union
select a.text, b.id, b.betreff
from
t2 a inner join t3 b on a.id = b.forum inner join
t1 c on b.id = c.thread
where
match(c.beitrag) against ('+abc' in boolean mode)
order by
match(b.betreff) against ('+abc' in boolean mode) desc;
ERROR 42S02: Unknown table 'b' in order clause
select a.text, b.id, b.betreff
from
t2 a inner join t3 b on a.id = b.forum inner join
t1 c on b.id = c.thread
where
match(b.betreff) against ('+abc' in boolean mode)
union
select a.text, b.id, b.betreff
from
t2 a inner join t3 b on a.id = b.forum inner join
t1 c on b.id = c.thread
where
match(c.beitrag) against ('+abc' in boolean mode)
order by
match(betreff) against ('+abc' in boolean mode) desc;
text id betreff
drop table t1,t2,t3;
mysql-test/r/select.result
View file @
bd275bc6
...
...
@@ -2524,3 +2524,38 @@ select * from t3 left join t1 on t3.id = t1.uid, t2 where t2.ident in (0, t1.gid
id name gid uid ident level
1 fs NULL NULL 0 READ
drop table t1,t2,t3;
CREATE TABLE t1 (
acct_id int(11) NOT NULL default '0',
profile_id smallint(6) default NULL,
UNIQUE KEY t1$acct_id (acct_id),
KEY t1$profile_id (profile_id)
);
INSERT INTO t1 VALUES (132,17),(133,18);
CREATE TABLE t2 (
profile_id smallint(6) default NULL,
queue_id int(11) default NULL,
seq int(11) default NULL,
KEY t2$queue_id (queue_id)
);
INSERT INTO t2 VALUES (17,31,4),(17,30,3),(17,36,2),(17,37,1);
CREATE TABLE t3 (
id int(11) NOT NULL default '0',
qtype int(11) default NULL,
seq int(11) default NULL,
warn_lvl int(11) default NULL,
crit_lvl int(11) default NULL,
rr1 tinyint(4) NOT NULL default '0',
rr2 int(11) default NULL,
default_queue tinyint(4) NOT NULL default '0',
KEY t3$qtype (qtype),
KEY t3$id (id)
);
INSERT INTO t3 VALUES (30,1,29,NULL,NULL,0,NULL,0),(31,1,28,NULL,NULL,0,NULL,0),
(36,1,34,NULL,NULL,0,NULL,0),(37,1,35,NULL,NULL,0,121,0);
SELECT COUNT(*) FROM t1 a STRAIGHT_JOIN t2 pq STRAIGHT_JOIN t3 q
WHERE
(pq.profile_id = a.profile_id) AND (a.acct_id = 132) AND
(pq.queue_id = q.id) AND (q.rr1 <> 1);
COUNT(*)
4
drop table t1,t2,t3;
mysql-test/t/fulltext_order_by.test
View file @
bd275bc6
...
...
@@ -54,3 +54,84 @@ SELECT a, MATCH (message) AGAINST ('t* f*' IN BOOLEAN MODE) as rel FROM t1;
SELECT
a
,
MATCH
(
message
)
AGAINST
(
't* f*'
IN
BOOLEAN
MODE
)
as
rel
FROM
t1
ORDER
BY
rel
,
a
;
drop
table
t1
;
# BUG#11869
CREATE
TABLE
t1
(
id
int
(
11
)
NOT
NULL
auto_increment
,
thread
int
(
11
)
NOT
NULL
default
'0'
,
beitrag
longtext
NOT
NULL
,
PRIMARY
KEY
(
id
),
KEY
thread
(
thread
),
FULLTEXT
KEY
beitrag
(
beitrag
)
)
ENGINE
=
MyISAM
DEFAULT
CHARSET
=
utf8
AUTO_INCREMENT
=
7923
;
CREATE
TABLE
t2
(
id
int
(
11
)
NOT
NULL
auto_increment
,
text
varchar
(
100
)
NOT
NULL
default
''
,
PRIMARY
KEY
(
id
),
KEY
text
(
text
)
)
ENGINE
=
MyISAM
DEFAULT
CHARSET
=
utf8
AUTO_INCREMENT
=
63
;
CREATE
TABLE
t3
(
id
int
(
11
)
NOT
NULL
auto_increment
,
forum
int
(
11
)
NOT
NULL
default
'0'
,
betreff
varchar
(
70
)
NOT
NULL
default
''
,
PRIMARY
KEY
(
id
),
KEY
forum
(
forum
),
FULLTEXT
KEY
betreff
(
betreff
)
)
ENGINE
=
MyISAM
DEFAULT
CHARSET
=
utf8
AUTO_INCREMENT
=
996
;
--
error
1109
select
a
.
text
,
b
.
id
,
b
.
betreff
from
t2
a
inner
join
t3
b
on
a
.
id
=
b
.
forum
inner
join
t1
c
on
b
.
id
=
c
.
thread
where
match
(
b
.
betreff
)
against
(
'+abc'
in
boolean
mode
)
group
by
a
.
text
,
b
.
id
,
b
.
betreff
union
select
a
.
text
,
b
.
id
,
b
.
betreff
from
t2
a
inner
join
t3
b
on
a
.
id
=
b
.
forum
inner
join
t1
c
on
b
.
id
=
c
.
thread
where
match
(
c
.
beitrag
)
against
(
'+abc'
in
boolean
mode
)
group
by
a
.
text
,
b
.
id
,
b
.
betreff
order
by
match
(
b
.
betreff
)
against
(
'+abc'
in
boolean
mode
)
desc
;
--
error
1109
select
a
.
text
,
b
.
id
,
b
.
betreff
from
t2
a
inner
join
t3
b
on
a
.
id
=
b
.
forum
inner
join
t1
c
on
b
.
id
=
c
.
thread
where
match
(
b
.
betreff
)
against
(
'+abc'
in
boolean
mode
)
union
select
a
.
text
,
b
.
id
,
b
.
betreff
from
t2
a
inner
join
t3
b
on
a
.
id
=
b
.
forum
inner
join
t1
c
on
b
.
id
=
c
.
thread
where
match
(
c
.
beitrag
)
against
(
'+abc'
in
boolean
mode
)
order
by
match
(
b
.
betreff
)
against
(
'+abc'
in
boolean
mode
)
desc
;
select
a
.
text
,
b
.
id
,
b
.
betreff
from
t2
a
inner
join
t3
b
on
a
.
id
=
b
.
forum
inner
join
t1
c
on
b
.
id
=
c
.
thread
where
match
(
b
.
betreff
)
against
(
'+abc'
in
boolean
mode
)
union
select
a
.
text
,
b
.
id
,
b
.
betreff
from
t2
a
inner
join
t3
b
on
a
.
id
=
b
.
forum
inner
join
t1
c
on
b
.
id
=
c
.
thread
where
match
(
c
.
beitrag
)
against
(
'+abc'
in
boolean
mode
)
order
by
match
(
betreff
)
against
(
'+abc'
in
boolean
mode
)
desc
;
drop
table
t1
,
t2
,
t3
;
mysql-test/t/select.test
View file @
bd275bc6
...
...
@@ -2075,3 +2075,44 @@ INSERT INTO `t3` VALUES (1,'fs');
select
*
from
t3
left
join
t1
on
t3
.
id
=
t1
.
uid
,
t2
where
t2
.
ident
in
(
0
,
t1
.
gid
,
t3
.
id
,
0
);
drop
table
t1
,
t2
,
t3
;
# Test for BUG#11700
CREATE
TABLE
t1
(
acct_id
int
(
11
)
NOT
NULL
default
'0'
,
profile_id
smallint
(
6
)
default
NULL
,
UNIQUE
KEY
t1
$acct_id
(
acct_id
),
KEY
t1
$profile_id
(
profile_id
)
);
INSERT
INTO
t1
VALUES
(
132
,
17
),(
133
,
18
);
CREATE
TABLE
t2
(
profile_id
smallint
(
6
)
default
NULL
,
queue_id
int
(
11
)
default
NULL
,
seq
int
(
11
)
default
NULL
,
KEY
t2
$queue_id
(
queue_id
)
);
INSERT
INTO
t2
VALUES
(
17
,
31
,
4
),(
17
,
30
,
3
),(
17
,
36
,
2
),(
17
,
37
,
1
);
CREATE
TABLE
t3
(
id
int
(
11
)
NOT
NULL
default
'0'
,
qtype
int
(
11
)
default
NULL
,
seq
int
(
11
)
default
NULL
,
warn_lvl
int
(
11
)
default
NULL
,
crit_lvl
int
(
11
)
default
NULL
,
rr1
tinyint
(
4
)
NOT
NULL
default
'0'
,
rr2
int
(
11
)
default
NULL
,
default_queue
tinyint
(
4
)
NOT
NULL
default
'0'
,
KEY
t3
$qtype
(
qtype
),
KEY
t3
$id
(
id
)
);
INSERT
INTO
t3
VALUES
(
30
,
1
,
29
,
NULL
,
NULL
,
0
,
NULL
,
0
),(
31
,
1
,
28
,
NULL
,
NULL
,
0
,
NULL
,
0
),
(
36
,
1
,
34
,
NULL
,
NULL
,
0
,
NULL
,
0
),(
37
,
1
,
35
,
NULL
,
NULL
,
0
,
121
,
0
);
SELECT
COUNT
(
*
)
FROM
t1
a
STRAIGHT_JOIN
t2
pq
STRAIGHT_JOIN
t3
q
WHERE
(
pq
.
profile_id
=
a
.
profile_id
)
AND
(
a
.
acct_id
=
132
)
AND
(
pq
.
queue_id
=
q
.
id
)
AND
(
q
.
rr1
<>
1
);
drop
table
t1
,
t2
,
t3
;
sql/item_func.cc
View file @
bd275bc6
...
...
@@ -3210,6 +3210,9 @@ bool Item_func_match::fix_index()
if
(
key
==
NO_SUCH_KEY
)
return
0
;
if
(
!
table
)
goto
err
;
for
(
keynr
=
0
;
keynr
<
table
->
keys
;
keynr
++
)
{
if
((
table
->
key_info
[
keynr
].
flags
&
HA_FULLTEXT
)
&&
...
...
sql/sql_select.cc
View file @
bd275bc6
...
...
@@ -3539,11 +3539,17 @@ static void add_not_null_conds(JOIN *join)
DBUG_ASSERT
(
item
->
type
()
==
Item
::
FIELD_ITEM
);
Item_field
*
not_null_item
=
(
Item_field
*
)
item
;
JOIN_TAB
*
referred_tab
=
not_null_item
->
field
->
table
->
reginfo
.
join_tab
;
Item
_func_isnotnull
*
notnull
;
Item
*
notnull
;
if
(
!
(
notnull
=
new
Item_func_isnotnull
(
not_null_item
)))
DBUG_VOID_RETURN
;
notnull
->
quick_fix_field
();
/*
We need to do full fix_fields() call here in order to have correct
notnull->const_item(). This is needed e.g. by test_quick_select
when it is called from make_join_select after this function is
called.
*/
if
(
notnull
->
fix_fields
(
join
->
thd
,
join
->
tables_list
,
&
notnull
))
DBUG_VOID_RETURN
;
DBUG_EXECUTE
(
"where"
,
print_where
(
notnull
,
referred_tab
->
table
->
table_name
););
add_cond_and_fix
(
&
referred_tab
->
select_cond
,
notnull
);
...
...
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