From 9630eda0de3c176615925d15eddba8d1780b1398 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 11 Feb 2016 20:42:16 +0100 Subject: MDEV-9390 Function found_rows() gives incorrect result where the previous SELECT contains ORDER BY clause use the raw found_rows value only when SQL_CALC_FOUND_ROWS was specified --- mysql-test/r/select_found.result | 15 +++++++++++++++ 1 file changed, 15 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 92758fa134b..7b38515cf70 100644 --- a/mysql-test/r/select_found.result +++ b/mysql-test/r/select_found.result @@ -348,3 +348,18 @@ select found_rows(); found_rows() 75 drop table t1; +create table t1(c1 int); +insert into t1 values(1),(2),(3),(4),(5); +select * from t1 order by c1 limit 2,1; +c1 +3 +select found_rows(); +found_rows() +3 +select sql_calc_found_rows * from t1 order by c1 limit 2,1; +c1 +3 +select found_rows(); +found_rows() +5 +drop table t1; -- cgit v1.2.1