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
deaf7f96
Commit
deaf7f96
authored
Jun 16, 2005
by
igor@rurik.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge rurik.mysql.com:/home/igor/mysql-4.1
into rurik.mysql.com:/home/igor/dev/mysql-4.1-0
parents
869882f3
2095758a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
4 deletions
+32
-4
mysql-test/r/group_by.result
mysql-test/r/group_by.result
+10
-0
mysql-test/t/group_by.test
mysql-test/t/group_by.test
+14
-1
sql/sql_select.cc
sql/sql_select.cc
+8
-3
No files found.
mysql-test/r/group_by.result
View file @
deaf7f96
...
@@ -722,3 +722,13 @@ WHERE hostname LIKE '%aol%'
...
@@ -722,3 +722,13 @@ WHERE hostname LIKE '%aol%'
GROUP BY hostname;
GROUP BY hostname;
hostname no
hostname no
cache-dtc-af05.proxy.aol.com 1
cache-dtc-af05.proxy.aol.com 1
DROP TABLE t1;
CREATE TABLE t1 (a int, b int);
INSERT INTO t1 VALUES (1,2), (1,3);
SELECT a, b FROM t1 GROUP BY 'const';
a b
1 2
SELECT DISTINCT a, b FROM t1 GROUP BY 'const';
a b
1 2
DROP TABLE t1;
mysql-test/t/group_by.test
View file @
deaf7f96
# Initialise
# Initialise
--
disable_warnings
--
disable_warnings
drop
table
if
exists
t1
,
t2
,
t3
;
drop
table
if
exists
t1
,
t2
,
t3
;
...
@@ -524,7 +525,7 @@ select min(b) from t1;
...
@@ -524,7 +525,7 @@ select min(b) from t1;
drop
table
t1
;
drop
table
t1
;
#
#
# Test for bug #11088: GROUP BY a BLOB col
i
mn with COUNT(DISTINCT column1)
# Test for bug #11088: GROUP BY a BLOB col
u
mn with COUNT(DISTINCT column1)
#
#
CREATE
TABLE
t1
(
id
int
PRIMARY
KEY
,
user_id
int
,
hostname
longtext
);
CREATE
TABLE
t1
(
id
int
PRIMARY
KEY
,
user_id
int
,
hostname
longtext
);
...
@@ -539,3 +540,15 @@ SELECT hostname, COUNT(DISTINCT user_id) as no FROM t1
...
@@ -539,3 +540,15 @@ SELECT hostname, COUNT(DISTINCT user_id) as no FROM t1
WHERE
hostname
LIKE
'%aol%'
WHERE
hostname
LIKE
'%aol%'
GROUP
BY
hostname
;
GROUP
BY
hostname
;
DROP
TABLE
t1
;
#
# Test for bug #8614: GROUP BY 'const with DISTINCT
#
CREATE
TABLE
t1
(
a
int
,
b
int
);
INSERT
INTO
t1
VALUES
(
1
,
2
),
(
1
,
3
);
SELECT
a
,
b
FROM
t1
GROUP
BY
'const'
;
SELECT
DISTINCT
a
,
b
FROM
t1
GROUP
BY
'const'
;
DROP
TABLE
t1
;
sql/sql_select.cc
View file @
deaf7f96
...
@@ -676,9 +676,14 @@ JOIN::optimize()
...
@@ -676,9 +676,14 @@ JOIN::optimize()
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
}
}
simple_group
=
0
;
simple_group
=
0
;
group_list
=
remove_const
(
this
,
group_list
,
conds
,
{
ORDER
*
old_group_list
;
group_list
=
remove_const
(
this
,
(
old_group_list
=
group_list
),
conds
,
rollup
.
state
==
ROLLUP
::
STATE_NONE
,
rollup
.
state
==
ROLLUP
::
STATE_NONE
,
&
simple_group
);
&
simple_group
);
if
(
old_group_list
&&
!
group_list
)
select_distinct
=
0
;
}
if
(
!
group_list
&&
group
)
if
(
!
group_list
&&
group
)
{
{
order
=
0
;
// The output has only one row
order
=
0
;
// The output has only one row
...
...
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