Bug #69144 sql_calc_found_rows, found_rows() in 5.6.11 differs from 5.6.10
Submitted: 4 May 2013 5:53 Modified: 4 May 2013 10:55
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: DML Severity:S2 (Serious)
Version:5.6.11 OS:Any
Assigned to: CPU Architecture:Any
Tags: found_rows, sql_calc_found_rows

[4 May 2013 5:53] Shane Bester
Description:
found_rows() broke in 5.6.11:

wrong:

25 rows in set (0.00 sec)
mysql> select found_rows(),version();
+--------------+--------------+
| found_rows() | version()    |
+--------------+--------------+
|           18 | 5.6.11-debug |
+--------------+--------------+
1 row in set (0.00 sec)

correct:

25 rows in set (0.00 sec)
mysql> select found_rows(),version();
+--------------+--------------+
| found_rows() | version()    |
+--------------+--------------+
|           25 | 5.6.10-debug |
+--------------+--------------+
1 row in set (0.00 sec)

How to repeat:
drop table if exists `t1`,`t2`;
create table `t1` (`a` int) engine=innodb;
create table `t2`(`a` int) engine=innodb;
insert into `t1` values (1),(1),(1),(1),(1);
insert into `t1` select null from `t1`,`t1` `d`;
insert into `t2` select * from `t1`;
select sql_calc_found_rows * from `t1` join `t2` using(`a`) order by 1;
select sql_calc_found_rows * from `t1` join `t2` using(`a`) order by 1 limit 9,9;
select found_rows(),version();
[4 May 2013 10:55] MySQL Verification Team
somebody beat me to it:
http://bugs.mysql.com/bug.php?id=69119
[4 May 2013 10:58] Piotr Tomasik
Con confirm repro
[8 May 2013 9:18] Tor Didriksen
oops, this is a regression caused by the patch for
Bug#68458 Wrong count from FOUND_ROWS() on MySQL 5.6