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
21a13688
Commit
21a13688
authored
Apr 10, 2007
by
gkodinov/kgeorge@magare.gmz
Browse files
Options
Browse Files
Download
Plain Diff
Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into magare.gmz:/home/kgeorge/mysql/autopush/B27659-5.0-opt
parents
6b2cb10a
aefc060f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
3 deletions
+29
-3
mysql-test/r/distinct.result
mysql-test/r/distinct.result
+14
-0
mysql-test/t/distinct.test
mysql-test/t/distinct.test
+13
-0
sql/sql_select.cc
sql/sql_select.cc
+2
-3
No files found.
mysql-test/r/distinct.result
View file @
21a13688
...
...
@@ -668,3 +668,17 @@ NULL
3
4
DROP TABLE t1;
CREATE TABLE t1 (a INT, b INT);
INSERT INTO t1 VALUES(1,1),(1,2),(1,3);
SELECT DISTINCT a, b FROM t1;
a b
1 1
1 2
1 3
SELECT DISTINCT a, a, b FROM t1;
a a b
1 1 1
1 1 2
1 1 3
DROP TABLE t1;
End of 5.0 tests
mysql-test/t/distinct.test
View file @
21a13688
...
...
@@ -540,3 +540,16 @@ EXPLAIN SELECT a FROM t1 GROUP BY a;
SELECT
a
FROM
t1
GROUP
BY
a
;
DROP
TABLE
t1
;
#
#Bug #27659: SELECT DISTINCT returns incorrect result set when field is
#repeated
#
#
CREATE
TABLE
t1
(
a
INT
,
b
INT
);
INSERT
INTO
t1
VALUES
(
1
,
1
),(
1
,
2
),(
1
,
3
);
SELECT
DISTINCT
a
,
b
FROM
t1
;
SELECT
DISTINCT
a
,
a
,
b
FROM
t1
;
DROP
TABLE
t1
;
--
echo
End
of
5.0
tests
sql/sql_select.cc
View file @
21a13688
...
...
@@ -13539,9 +13539,7 @@ create_distinct_group(THD *thd, Item **ref_pointer_array,
ORDER
*
ord_iter
;
for
(
ord_iter
=
group
;
ord_iter
;
ord_iter
=
ord_iter
->
next
)
if
((
*
ord_iter
->
item
)
->
eq
(
item
,
1
))
break
;
if
(
ord_iter
)
continue
;
goto
next_item
;
ORDER
*
ord
=
(
ORDER
*
)
thd
->
calloc
(
sizeof
(
ORDER
));
if
(
!
ord
)
...
...
@@ -13556,6 +13554,7 @@ create_distinct_group(THD *thd, Item **ref_pointer_array,
*
prev
=
ord
;
prev
=
&
ord
->
next
;
}
next_item:
ref_pointer_array
++
;
}
*
prev
=
0
;
...
...
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