diff options
author | unknown <monty@hundin.mysql.fi> | 2002-06-10 13:33:25 +0300 |
---|---|---|
committer | unknown <monty@hundin.mysql.fi> | 2002-06-10 13:33:25 +0300 |
commit | 45e0cd61290d8c11edb9f6bbb5cc753bff35ccec (patch) | |
tree | da77e35875e5ea4fe29bf0d97a53ab041b985667 /mysql-test | |
parent | 3a395a994a3d1f5d38e16e7b4781297692114cfc (diff) | |
download | mariadb-git-45e0cd61290d8c11edb9f6bbb5cc753bff35ccec.tar.gz |
Fixed bug in SQL_CALC_FOUND_ROWS + LIMIT
Docs/manual.texi:
Changelog
mysql-test/r/select_found.result:
Test of FOUND_ROWS() bug fix
mysql-test/t/select_found.test:
Test of FOUND_ROWS() bug fix
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/select_found.result | 18 | ||||
-rw-r--r-- | mysql-test/t/select_found.test | 17 |
2 files changed, 34 insertions, 1 deletions
diff --git a/mysql-test/r/select_found.result b/mysql-test/r/select_found.result index 3d2f2154b37..1c2cd7da894 100644 --- a/mysql-test/r/select_found.result +++ b/mysql-test/r/select_found.result @@ -66,7 +66,7 @@ a 2 select FOUND_ROWS(); FOUND_ROWS() -5 +3 drop table t1; CREATE TABLE t1 ( `id` smallint(5) unsigned NOT NULL auto_increment, @@ -153,3 +153,19 @@ SELECT FOUND_ROWS(); FOUND_ROWS() 199 drop table t1,t2; +CREATE TABLE `t1` ( +`titre` char(80) NOT NULL default '', +`numeropost` mediumint(8) unsigned NOT NULL auto_increment, +`maxnumrep` int(10) unsigned NOT NULL default '0', +PRIMARY KEY (`numeropost`), +KEY `maxnumrep` (`maxnumrep`) +) TYPE=MyISAM ROW_FORMAT=FIXED; +INSERT INTO t1 (titre,maxnumrep) VALUES +('test1','1'),('test2','2'),('test3','3'); +SELECT SQL_CALC_FOUND_ROWS titre,numeropost,maxnumrep FROM t1 WHERE numeropost IN (1,2) ORDER BY maxnumrep DESC LIMIT 0, 1; +titre numeropost maxnumrep +test2 2 2 +SELECT FOUND_ROWS(); +FOUND_ROWS() +2 +drop table t1; diff --git a/mysql-test/t/select_found.test b/mysql-test/t/select_found.test index c95d46b166c..0a483c860cb 100644 --- a/mysql-test/t/select_found.test +++ b/mysql-test/t/select_found.test @@ -68,3 +68,20 @@ SELECT SQL_CALC_FOUND_ROWS DISTINCT email FROM t2 LEFT JOIN t1 ON kid = t2.id W SELECT FOUND_ROWS(); drop table t1,t2; + +# +# Test bug when using range optimization +# + +CREATE TABLE `t1` ( + `titre` char(80) NOT NULL default '', + `numeropost` mediumint(8) unsigned NOT NULL auto_increment, + `maxnumrep` int(10) unsigned NOT NULL default '0', + PRIMARY KEY (`numeropost`), + KEY `maxnumrep` (`maxnumrep`) +) TYPE=MyISAM ROW_FORMAT=FIXED; +INSERT INTO t1 (titre,maxnumrep) VALUES +('test1','1'),('test2','2'),('test3','3'); +SELECT SQL_CALC_FOUND_ROWS titre,numeropost,maxnumrep FROM t1 WHERE numeropost IN (1,2) ORDER BY maxnumrep DESC LIMIT 0, 1; +SELECT FOUND_ROWS(); +drop table t1; |