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
848548e1
Commit
848548e1
authored
Aug 24, 2006
by
sergefp@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG#16255: Post-review fixes: adjust the testcase.
parent
d4cacdb5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
17 deletions
+40
-17
mysql-test/r/subselect.result
mysql-test/r/subselect.result
+22
-11
mysql-test/t/subselect.test
mysql-test/t/subselect.test
+18
-6
No files found.
mysql-test/r/subselect.result
View file @
848548e1
...
...
@@ -2895,14 +2895,25 @@ select * from t1 where NOT(s1 = ALL (select s1/s1 from t1));
s1
2
drop table t1;
CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a,b));
INSERT INTO t1 VALUES(26, 1), (48, 2);
SELECT * FROM t1 r WHERE (r.a,r.b) IN (SELECT a,MAX(b) FROM t1 GROUP BY a);
a b
26 1
48 2
SELECT * FROM t1 r WHERE (r.a,r.b) IN (SELECT a + 0,MAX(b) FROM t1 GROUP BY a);
a b
26 1
48 2
DROP TABLE t1;
create table t1 (
retailerID varchar(8) NOT NULL,
statusID int(10) unsigned NOT NULL,
changed datetime NOT NULL,
UNIQUE KEY retailerID (retailerID, statusID, changed)
);
INSERT INTO t1 VALUES("0026", "1", "2005-12-06 12:18:56");
INSERT INTO t1 VALUES("0026", "2", "2006-01-06 12:25:53");
INSERT INTO t1 VALUES("0037", "1", "2005-12-06 12:18:56");
INSERT INTO t1 VALUES("0037", "2", "2006-01-06 12:25:53");
INSERT INTO t1 VALUES("0048", "1", "2006-01-06 12:37:50");
INSERT INTO t1 VALUES("0059", "1", "2006-01-06 12:37:50");
select * from t1 r1
where (r1.retailerID,(r1.changed)) in
(SELECT r2.retailerId,(max(changed)) from t1 r2
group by r2.retailerId);
retailerID statusID changed
0026 2 2006-01-06 12:25:53
0037 2 2006-01-06 12:25:53
0048 1 2006-01-06 12:37:50
0059 1 2006-01-06 12:37:50
drop table t1;
mysql-test/t/subselect.test
View file @
848548e1
...
...
@@ -1865,12 +1865,24 @@ drop table t1;
#
# Bug #16255: Subquery in where
#
CREATE
TABLE
t1
(
a
INT
,
b
INT
,
PRIMARY
KEY
(
a
,
b
));
INSERT
INTO
t1
VALUES
(
26
,
1
),
(
48
,
2
);
create
table
t1
(
retailerID
varchar
(
8
)
NOT
NULL
,
statusID
int
(
10
)
unsigned
NOT
NULL
,
changed
datetime
NOT
NULL
,
UNIQUE
KEY
retailerID
(
retailerID
,
statusID
,
changed
)
);
SELECT
*
FROM
t1
r
WHERE
(
r
.
a
,
r
.
b
)
IN
(
SELECT
a
,
MAX
(
b
)
FROM
t1
GROUP
BY
a
);
SELECT
*
FROM
t1
r
WHERE
(
r
.
a
,
r
.
b
)
IN
(
SELECT
a
+
0
,
MAX
(
b
)
FROM
t1
GROUP
BY
a
);
INSERT
INTO
t1
VALUES
(
"0026"
,
"1"
,
"2005-12-06 12:18:56"
);
INSERT
INTO
t1
VALUES
(
"0026"
,
"2"
,
"2006-01-06 12:25:53"
);
INSERT
INTO
t1
VALUES
(
"0037"
,
"1"
,
"2005-12-06 12:18:56"
);
INSERT
INTO
t1
VALUES
(
"0037"
,
"2"
,
"2006-01-06 12:25:53"
);
INSERT
INTO
t1
VALUES
(
"0048"
,
"1"
,
"2006-01-06 12:37:50"
);
INSERT
INTO
t1
VALUES
(
"0059"
,
"1"
,
"2006-01-06 12:37:50"
);
select
*
from
t1
r1
where
(
r1
.
retailerID
,(
r1
.
changed
))
in
(
SELECT
r2
.
retailerId
,(
max
(
changed
))
from
t1
r2
group
by
r2
.
retailerId
);
drop
table
t1
;
DROP
TABLE
t1
;
# End of 4.1 tests
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