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
71b731e9
Commit
71b731e9
authored
Oct 27, 2005
by
evgen@moonbone.local
Browse files
Options
Browse Files
Download
Plain Diff
Manually merged
parents
1c64b2c0
983b7ad1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
1 deletion
+19
-1
mysql-test/r/select.result
mysql-test/r/select.result
+8
-0
mysql-test/t/select.test
mysql-test/t/select.test
+9
-0
netware/mysql_test_run.c
netware/mysql_test_run.c
+1
-1
sql/sql_select.cc
sql/sql_select.cc
+1
-0
No files found.
mysql-test/r/select.result
View file @
71b731e9
...
@@ -2400,6 +2400,14 @@ id select_type table type possible_keys key key_len ref rows Extra
...
@@ -2400,6 +2400,14 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 5
1 SIMPLE t1 ALL NULL NULL NULL NULL 5
1 SIMPLE t2 ref a a 23 test.t1.a 2
1 SIMPLE t2 ref a a 23 test.t1.a 2
DROP TABLE t1, t2;
DROP TABLE t1, t2;
create table t1 (f1 int primary key, f2 int);
create table t2 (f3 int, f4 int, primary key(f3,f4));
insert into t1 values (1,1);
insert into t2 values (1,1),(1,2);
select distinct count(f2) >0 from t1 left join t2 on f1=f3 group by f1;
count(f2) >0
1
drop table t1,t2;
CREATE TABLE t1 ( city char(30) );
CREATE TABLE t1 ( city char(30) );
INSERT INTO t1 VALUES ('London');
INSERT INTO t1 VALUES ('London');
INSERT INTO t1 VALUES ('Paris');
INSERT INTO t1 VALUES ('Paris');
...
...
mysql-test/t/select.test
View file @
71b731e9
...
@@ -2228,4 +2228,13 @@ SELECT t2.a, t2.b, IF(t1.b IS NULL,'',c) AS c, COUNT(*) AS d FROM t2,t1
...
@@ -2228,4 +2228,13 @@ SELECT t2.a, t2.b, IF(t1.b IS NULL,'',c) AS c, COUNT(*) AS d FROM t2,t1
WHERE
t2
.
a
=
t1
.
a
AND
t2
.
b
=
t1
.
b
GROUP
BY
a
,
b
,
c
;
WHERE
t2
.
a
=
t1
.
a
AND
t2
.
b
=
t1
.
b
GROUP
BY
a
,
b
,
c
;
DROP
TABLE
IF
EXISTS
t1
,
t2
;
DROP
TABLE
IF
EXISTS
t1
,
t2
;
#
# Bug #13855 select distinct with group by caused server crash
#
create
table
t1
(
f1
int
primary
key
,
f2
int
);
create
table
t2
(
f3
int
,
f4
int
,
primary
key
(
f3
,
f4
));
insert
into
t1
values
(
1
,
1
);
insert
into
t2
values
(
1
,
1
),(
1
,
2
);
select
distinct
count
(
f2
)
>
0
from
t1
left
join
t2
on
f1
=
f3
group
by
f1
;
drop
table
t1
,
t2
;
# End of 4.1 tests
# End of 4.1 tests
netware/mysql_test_run.c
View file @
71b731e9
...
@@ -172,7 +172,7 @@ void report_stats()
...
@@ -172,7 +172,7 @@ void report_stats()
log_msg
(
"
\n
Failed %u/%u test(s), %.02f%% successful.
\n
"
,
log_msg
(
"
\n
Failed %u/%u test(s), %.02f%% successful.
\n
"
,
total_fail
,
total_test
,
percent
);
total_fail
,
total_test
,
percent
);
log_msg
(
"
\n
The .out and .err files in %s may give you some
\n
"
,
result_dir
);
log_msg
(
"
\n
The .out and .err files in %s may give you some
\n
"
,
result_dir
);
log_msg
(
"hint of what w
hen
wrong.
\n
"
);
log_msg
(
"hint of what w
ent
wrong.
\n
"
);
log_msg
(
"
\n
If you want to report this error, please first read the documentation
\n
"
);
log_msg
(
"
\n
If you want to report this error, please first read the documentation
\n
"
);
log_msg
(
"at: http://www.mysql.com/doc/en/MySQL_test_suite.html
\n
"
);
log_msg
(
"at: http://www.mysql.com/doc/en/MySQL_test_suite.html
\n
"
);
}
}
...
...
sql/sql_select.cc
View file @
71b731e9
...
@@ -689,6 +689,7 @@ JOIN::optimize()
...
@@ -689,6 +689,7 @@ JOIN::optimize()
{
{
order
=
0
;
// The output has only one row
order
=
0
;
// The output has only one row
simple_order
=
1
;
simple_order
=
1
;
select_distinct
=
0
;
// No need in distinct for 1 row
}
}
calc_group_buffer
(
this
,
group_list
);
calc_group_buffer
(
this
,
group_list
);
...
...
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