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
672b61c5
Commit
672b61c5
authored
Oct 18, 2006
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed test case for bug 22342 to make it platform independent.
parent
b18b419b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
mysql-test/r/group_min_max.result
mysql-test/r/group_min_max.result
+3
-3
mysql-test/t/group_min_max.test
mysql-test/t/group_min_max.test
+1
-1
No files found.
mysql-test/r/group_min_max.result
View file @
672b61c5
...
...
@@ -2143,10 +2143,10 @@ id2 id3 id5 id4 id3 id6 id5 id1
1 1 1 1 1 1 1 1
DROP TABLE t1,t2,t3,t4,t5,t6;
CREATE TABLE t1 (a int, b int, PRIMARY KEY (a,b), KEY b (b));
INSERT INTO t1 VALUES (1,1),(1,2);
INSERT INTO t1 VALUES (1,1),(1,2)
,(1,0),(1,3)
;
explain SELECT MAX(b), a FROM t1 WHERE b < 2 AND a = 1 GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range PRIMARY,b PRIMARY 8 NULL
2
Using where; Using index for group-by
1 SIMPLE t1 range PRIMARY,b PRIMARY 8 NULL
1
Using where; Using index for group-by
SELECT MAX(b), a FROM t1 WHERE b < 2 AND a = 1 GROUP BY a;
MAX(b) a
1 1
...
...
@@ -2157,7 +2157,7 @@ CREATE TABLE t2 (a int, b int, c int, PRIMARY KEY (a,b,c));
INSERT INTO t2 SELECT a,b,b FROM t1;
explain SELECT MIN(c) FROM t2 WHERE b = 2 and a = 1 and c > 1 GROUP BY a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 range PRIMARY PRIMARY 12 NULL
2
Using where; Using index for group-by
1 SIMPLE t2 range PRIMARY PRIMARY 12 NULL
1
Using where; Using index for group-by
SELECT MIN(c) FROM t2 WHERE b = 2 and a = 1 and c > 1 GROUP BY a;
MIN(c)
2
...
...
mysql-test/t/group_min_max.test
View file @
672b61c5
...
...
@@ -799,7 +799,7 @@ DROP TABLE t1,t2,t3,t4,t5,t6;
# Bug#22342: No results returned for query using max and group by
#
CREATE
TABLE
t1
(
a
int
,
b
int
,
PRIMARY
KEY
(
a
,
b
),
KEY
b
(
b
));
INSERT
INTO
t1
VALUES
(
1
,
1
),(
1
,
2
);
INSERT
INTO
t1
VALUES
(
1
,
1
),(
1
,
2
)
,(
1
,
0
),(
1
,
3
)
;
explain
SELECT
MAX
(
b
),
a
FROM
t1
WHERE
b
<
2
AND
a
=
1
GROUP
BY
a
;
SELECT
MAX
(
b
),
a
FROM
t1
WHERE
b
<
2
AND
a
=
1
GROUP
BY
a
;
...
...
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