From 605962a9384912cf665ae33b105326abd5f6a486 Mon Sep 17 00:00:00 2001 From: "ram@gw.mysql.r18.ru" <> Date: Fri, 28 May 2004 15:01:16 +0500 Subject: a fix. (Bug#3738: SQL_CALC_FOUND_ROWS ignores WHERE if LIMIT used, Bug#3845: wrong FOUND_ROWS result) --- mysql-test/t/select_found.test | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'mysql-test/t/select_found.test') diff --git a/mysql-test/t/select_found.test b/mysql-test/t/select_found.test index e584fca206f..7599277a867 100644 --- a/mysql-test/t/select_found.test +++ b/mysql-test/t/select_found.test @@ -127,3 +127,22 @@ WHERE ( r = 1 AND a IN ( 1, 2 ) AND ( u = 'w' OR u LIKE 'w/%' ) ) OR ( r = 1 AND a IN ( 1, 2, 3 ) AND ( u = 'w' ) ); drop table t1; +# +# Bug #3738: we have a ref key +# + +CREATE TABLE t1 (a VARCHAR(16), UNIQUE(a)); +INSERT INTO t1 VALUES ('1'), ('2'), ('3'); +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a = '2' LIMIT 0, 1; +SELECT FOUND_ROWS(); +DROP TABLE t1; + +# +# Bug #3845: group by, having and empty result +# + +CREATE TABLE t1 (a INT); +INSERT INTO t1 VALUES (0), (0), (1), (2); +SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a = 0 GROUP BY a HAVING a > 10; +SELECT FOUND_ROWS(); +DROP TABLE t1; -- cgit v1.2.1