diff options
Diffstat (limited to 'mysql-test/t/select_found.test')
-rw-r--r-- | mysql-test/t/select_found.test | 17 |
1 files changed, 17 insertions, 0 deletions
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; |