From 20e100d3b3226566a70f49f3f960bcd8154a0ebe Mon Sep 17 00:00:00 2001 From: "Sinisa@sinisa.nasamreza.org" <> Date: Tue, 19 Nov 2002 19:43:45 +0200 Subject: [PATCH] fixed another small bug with LIMIT ) --- mysql-test/r/select_found.result | 5 +++++ mysql-test/t/select_found.test | 2 ++ sql/sql_select.cc | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/select_found.result b/mysql-test/r/select_found.result index a48e1e16d37..8500e244d08 100644 --- a/mysql-test/r/select_found.result +++ b/mysql-test/r/select_found.result @@ -183,4 +183,9 @@ titre numeropost maxnumrep SELECT FOUND_ROWS(); FOUND_ROWS() 3 +SELECT SQL_CALC_FOUND_ROWS * FROM t1 ORDER BY numeropost LIMIT 0; +titre numeropost maxnumrep +SELECT FOUND_ROWS(); +FOUND_ROWS() +3 drop table t1; diff --git a/mysql-test/t/select_found.test b/mysql-test/t/select_found.test index b380c86d2db..316e7894344 100644 --- a/mysql-test/t/select_found.test +++ b/mysql-test/t/select_found.test @@ -90,4 +90,6 @@ SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE numeropost > 1 LIMIT 0; SELECT FOUND_ROWS(); SELECT SQL_CALC_FOUND_ROWS * FROM t1 LIMIT 0; SELECT FOUND_ROWS(); +SELECT SQL_CALC_FOUND_ROWS * FROM t1 ORDER BY numeropost LIMIT 0; +SELECT FOUND_ROWS(); drop table t1; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index b596d27b5af..05551980309 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -324,7 +324,7 @@ JOIN::prepare(TABLE_LIST *tables_init, this->group= group_list != 0; row_limit= ((select_distinct || order || group_list) ? HA_POS_ERROR : unit->select_limit_cnt); - do_send_rows = (row_limit) ? 1 : 0; + do_send_rows = (unit->select_limit_cnt) ? 1 : 0; this->unit= unit; #ifdef RESTRICTED_GROUP