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
12dcd0ed
Commit
12dcd0ed
authored
Mar 26, 2008
by
kaa@kaamos.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge kaamos.(none):/data/src/bugteam/bug34928/my51
into kaamos.(none):/data/src/bugteam/mysql-5.1-bugteam
parents
079a1748
b753e4a0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
5 deletions
+51
-5
mysql-test/r/distinct.result
mysql-test/r/distinct.result
+23
-0
mysql-test/t/distinct.test
mysql-test/t/distinct.test
+23
-0
sql/sql_select.cc
sql/sql_select.cc
+5
-5
No files found.
mysql-test/r/distinct.result
View file @
12dcd0ed
...
...
@@ -682,3 +682,26 @@ a a b
1 1 3
DROP TABLE t1;
End of 5.0 tests
CREATE TABLE t1(a INT, b INT, c INT, d INT, e INT,
PRIMARY KEY(a,b,c,d,e),
KEY(a,b,d,c)
);
INSERT INTO t1(a, b, c) VALUES (1, 1, 1),
(1, 1, 2),
(1, 1, 3),
(1, 2, 1),
(1, 2, 2),
(1, 2, 3);
EXPLAIN SELECT DISTINCT a, b, d, c FROM t1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL a 16 NULL 6 Using index
SELECT DISTINCT a, b, d, c FROM t1;
a b d c
1 1 0 1
1 1 0 2
1 1 0 3
1 2 0 1
1 2 0 2
1 2 0 3
DROP TABLE t1;
End of 5.1 tests
mysql-test/t/distinct.test
View file @
12dcd0ed
...
...
@@ -553,3 +553,26 @@ SELECT DISTINCT a, a, b FROM t1;
DROP
TABLE
t1
;
--
echo
End
of
5.0
tests
#
# Bug #34928: Confusion by having Primary Key and Index
#
CREATE
TABLE
t1
(
a
INT
,
b
INT
,
c
INT
,
d
INT
,
e
INT
,
PRIMARY
KEY
(
a
,
b
,
c
,
d
,
e
),
KEY
(
a
,
b
,
d
,
c
)
);
INSERT
INTO
t1
(
a
,
b
,
c
)
VALUES
(
1
,
1
,
1
),
(
1
,
1
,
2
),
(
1
,
1
,
3
),
(
1
,
2
,
1
),
(
1
,
2
,
2
),
(
1
,
2
,
3
);
EXPLAIN
SELECT
DISTINCT
a
,
b
,
d
,
c
FROM
t1
;
SELECT
DISTINCT
a
,
b
,
d
,
c
FROM
t1
;
DROP
TABLE
t1
;
--
echo
End
of
5.1
tests
sql/sql_select.cc
View file @
12dcd0ed
...
...
@@ -13158,6 +13158,11 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
tab
->
read_first_record
=
best_key_direction
>
0
?
join_read_first:
join_read_last
;
tab
->
type
=
JT_NEXT
;
// Read with index_first(), index_next()
if
(
select
&&
select
->
quick
)
{
delete
select
->
quick
;
select
->
quick
=
0
;
}
if
(
table
->
covering_keys
.
is_set
(
best_key
))
{
table
->
key_read
=
1
;
...
...
@@ -13168,11 +13173,6 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
{
tab
->
ref
.
key
=
-
1
;
tab
->
ref
.
key_parts
=
0
;
if
(
select
&&
select
->
quick
)
{
delete
select
->
quick
;
select
->
quick
=
0
;
}
if
(
select_limit
<
table_records
)
tab
->
limit
=
select_limit
;
}
...
...
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