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
4c4c7ccc
Commit
4c4c7ccc
authored
Jun 16, 2009
by
Martin Hansson
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
4b691ace
f7ae0382
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
99 additions
and
1 deletion
+99
-1
mysql-test/r/group_min_max.result
mysql-test/r/group_min_max.result
+58
-0
mysql-test/t/group_min_max.test
mysql-test/t/group_min_max.test
+40
-0
sql/opt_range.cc
sql/opt_range.cc
+1
-1
No files found.
mysql-test/r/group_min_max.result
View file @
4c4c7ccc
...
@@ -2502,3 +2502,61 @@ a MAX(b)
...
@@ -2502,3 +2502,61 @@ a MAX(b)
2 1
2 1
DROP TABLE t;
DROP TABLE t;
End of 5.0 tests
End of 5.0 tests
CREATE TABLE t1 ( a INT, b INT, c INT, KEY bc(b, c) )
PARTITION BY KEY (a, b) PARTITIONS 3
;
INSERT INTO t1 VALUES
(17, 1, -8),
(3, 1, -7),
(23, 1, -6),
(22, 1, -5),
(11, 1, -4),
(21, 1, -3),
(19, 1, -2),
(30, 1, -1),
(20, 1, 1),
(16, 1, 2),
(18, 1, 3),
(9, 1, 4),
(15, 1, 5),
(28, 1, 6),
(29, 1, 7),
(25, 1, 8),
(10, 1, 9),
(13, 1, 10),
(27, 1, 11),
(24, 1, 12),
(12, 1, 13),
(26, 1, 14),
(14, 1, 15)
;
SELECT b, c FROM t1 WHERE b = 1 GROUP BY b, c;
b c
1 -8
1 -7
1 -6
1 -5
1 -4
1 -3
1 -2
1 -1
1 1
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
EXPLAIN
SELECT b, c FROM t1 WHERE b = 1 GROUP BY b, c;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range bc bc 10 NULL 7 Using where; Using index for group-by
DROP TABLE t1;
mysql-test/t/group_min_max.test
View file @
4c4c7ccc
...
@@ -1018,3 +1018,43 @@ DROP TABLE t;
...
@@ -1018,3 +1018,43 @@ DROP TABLE t;
--
echo
End
of
5.0
tests
--
echo
End
of
5.0
tests
#
# Bug#44821: select distinct on partitioned table returns wrong results
#
CREATE
TABLE
t1
(
a
INT
,
b
INT
,
c
INT
,
KEY
bc
(
b
,
c
)
)
PARTITION
BY
KEY
(
a
,
b
)
PARTITIONS
3
;
INSERT
INTO
t1
VALUES
(
17
,
1
,
-
8
),
(
3
,
1
,
-
7
),
(
23
,
1
,
-
6
),
(
22
,
1
,
-
5
),
(
11
,
1
,
-
4
),
(
21
,
1
,
-
3
),
(
19
,
1
,
-
2
),
(
30
,
1
,
-
1
),
(
20
,
1
,
1
),
(
16
,
1
,
2
),
(
18
,
1
,
3
),
(
9
,
1
,
4
),
(
15
,
1
,
5
),
(
28
,
1
,
6
),
(
29
,
1
,
7
),
(
25
,
1
,
8
),
(
10
,
1
,
9
),
(
13
,
1
,
10
),
(
27
,
1
,
11
),
(
24
,
1
,
12
),
(
12
,
1
,
13
),
(
26
,
1
,
14
),
(
14
,
1
,
15
)
;
SELECT
b
,
c
FROM
t1
WHERE
b
=
1
GROUP
BY
b
,
c
;
EXPLAIN
SELECT
b
,
c
FROM
t1
WHERE
b
=
1
GROUP
BY
b
,
c
;
DROP
TABLE
t1
;
sql/opt_range.cc
View file @
4c4c7ccc
...
@@ -8556,7 +8556,7 @@ int QUICK_RANGE_SELECT::get_next_prefix(uint prefix_length,
...
@@ -8556,7 +8556,7 @@ int QUICK_RANGE_SELECT::get_next_prefix(uint prefix_length,
result
=
file
->
read_range_first
(
last_range
->
min_keypart_map
?
&
start_key
:
0
,
result
=
file
->
read_range_first
(
last_range
->
min_keypart_map
?
&
start_key
:
0
,
last_range
->
max_keypart_map
?
&
end_key
:
0
,
last_range
->
max_keypart_map
?
&
end_key
:
0
,
test
(
last_range
->
flag
&
EQ_RANGE
),
test
(
last_range
->
flag
&
EQ_RANGE
),
sorted
);
TRUE
);
if
(
last_range
->
flag
==
(
UNIQUE_RANGE
|
EQ_RANGE
))
if
(
last_range
->
flag
==
(
UNIQUE_RANGE
|
EQ_RANGE
))
last_range
=
0
;
// Stop searching
last_range
=
0
;
// Stop searching
...
...
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