mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
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.
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user