summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/r/select.result8
-rw-r--r--mysql-test/t/select.test9
-rw-r--r--netware/mysql_test_run.c2
-rw-r--r--sql/sql_select.cc1
4 files changed, 19 insertions, 1 deletions
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index be46d180f2d..64c329ee104 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -2698,3 +2698,11 @@ a b c d
1 2 2 1
1 2 3 1
DROP TABLE IF EXISTS 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;
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index 56fab52729e..39c7cdfa8a9 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -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;
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
diff --git a/netware/mysql_test_run.c b/netware/mysql_test_run.c
index fd328777ec9..37800c5d79b 100644
--- a/netware/mysql_test_run.c
+++ b/netware/mysql_test_run.c
@@ -172,7 +172,7 @@ void report_stats()
log_msg("\nFailed %u/%u test(s), %.02f%% successful.\n",
total_fail, total_test, percent);
log_msg("\nThe .out and .err files in %s may give you some\n", result_dir);
- log_msg("hint of what when wrong.\n");
+ log_msg("hint of what went wrong.\n");
log_msg("\nIf 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");
}
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index c485d6cd04e..fe5428abf45 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -689,6 +689,7 @@ JOIN::optimize()
{
order=0; // The output has only one row
simple_order=1;
+ select_distinct= 0; // No need in distinct for 1 row
}
calc_group_buffer(this, group_list);