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
af5785c6
Commit
af5785c6
authored
Sep 08, 2004
by
bell@sanja.is.com.ua
Browse files
Options
Browse Files
Download
Plain Diff
Merge abelkin@bk-internal.mysql.com:/home/bk/mysql-4.1
into sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.1
parents
b30570be
31c63b07
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
+22
-0
mysql-test/r/subselect_innodb.result
mysql-test/r/subselect_innodb.result
+8
-0
mysql-test/t/subselect_innodb.test
mysql-test/t/subselect_innodb.test
+14
-0
No files found.
mysql-test/r/subselect_innodb.result
View file @
af5785c6
...
...
@@ -106,3 +106,11 @@ a b
2 12
4 105
drop table t1, t2;
CREATE TABLE `t1` ( `unit` varchar(50) NOT NULL default '', `ingredient` varchar(50) NOT NULL default '') ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `t2` ( `ingredient` varchar(50) NOT NULL default '', `unit` varchar(50) NOT NULL default '', PRIMARY KEY (ingredient, unit)) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `t1` VALUES ('xx','yy');
INSERT INTO `t2` VALUES ('yy','xx');
SELECT R.unit, R.ingredient FROM t1 R WHERE R.ingredient IN (SELECT N.ingredient FROM t2 N WHERE N.unit = R.unit);
unit ingredient
xx yy
drop table t1, t2;
mysql-test/t/subselect_innodb.test
View file @
af5785c6
...
...
@@ -111,3 +111,17 @@ create table t2 (a int) engine=innodb;
insert
into
t2
values
(
1
),(
2
),(
3
),(
4
);
select
a
,
sum
(
b
)
as
b
from
t1
group
by
a
having
b
>
(
select
max
(
a
)
from
t2
);
drop
table
t1
,
t2
;
#
# bug #5220 test suite
#
CREATE
TABLE
`t1`
(
`unit`
varchar
(
50
)
NOT
NULL
default
''
,
`ingredient`
varchar
(
50
)
NOT
NULL
default
''
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
latin1
;
CREATE
TABLE
`t2`
(
`ingredient`
varchar
(
50
)
NOT
NULL
default
''
,
`unit`
varchar
(
50
)
NOT
NULL
default
''
,
PRIMARY
KEY
(
ingredient
,
unit
))
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
latin1
;
INSERT
INTO
`t1`
VALUES
(
'xx'
,
'yy'
);
INSERT
INTO
`t2`
VALUES
(
'yy'
,
'xx'
);
SELECT
R
.
unit
,
R
.
ingredient
FROM
t1
R
WHERE
R
.
ingredient
IN
(
SELECT
N
.
ingredient
FROM
t2
N
WHERE
N
.
unit
=
R
.
unit
);
drop
table
t1
,
t2
;
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