From 25c2d1adb09a3dd521a110013ab03eac3e1fc01a Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 22 Jan 2005 02:40:27 -0800 Subject: select_found.result, select_found.test: Added a test case for bug #7945. sql_select.cc: Fixed bug #7945. If DISTINCT is used only with constants in a query with GROUP BY, we can apply an optimization that set LIMIT to 1 only in the case when there is no SQL_CALC_FOUND_ROWS. sql/sql_select.cc: Fixed bug #7945. If DISTINCT is used only with constants in a query with GROUP BY, we can apply an optimization that set LIMIT to 1 only in the case when there is no SQL_CALC_FOUND_ROWS. mysql-test/t/select_found.test: Added a test case for bug #7945. mysql-test/r/select_found.result: Added a test case for bug #7945. --- mysql-test/r/select_found.result | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'mysql-test/r/select_found.result') diff --git a/mysql-test/r/select_found.result b/mysql-test/r/select_found.result index 444124bcd67..11629addba4 100644 --- a/mysql-test/r/select_found.result +++ b/mysql-test/r/select_found.result @@ -223,3 +223,11 @@ SELECT FOUND_ROWS(); FOUND_ROWS() 0 DROP TABLE t1; +CREATE TABLE t1 (a int, b int); +INSERT INTO t1 VALUES (1,2), (1,3), (1,4), (1,5); +SELECT SQL_CALC_FOUND_ROWS DISTINCT 'a' FROM t1 GROUP BY b LIMIT 2; +a +a +SELECT FOUND_ROWS(); +FOUND_ROWS() +1 -- cgit v1.2.1