Bug #79913 Function FOUND_ROW() works incorrectly with previous select w/ aggr ret NULL
Submitted: 11 Jan 2016 7:45 Modified: 11 Jan 2016 7:57
Reporter: Su Dylan Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DML Severity:S3 (Non-critical)
Version:5.7.8, 5.7.10 OS:Any
Assigned to: CPU Architecture:Any
Tags: regression

[11 Jan 2016 7:45] Su Dylan
Description:
Output:
=====
mysql> create table t1(c1 int);
1),(2),(3),(4),(5);
select * from t1;
Query OK, 0 rows affected (0.01 sec)

mysql> insert into t1 values(1),(2),(3),(4),(5);
Query OK, 5 rows affected (0.00 sec)
Records: 5  Duplicates: 0  Warnings: 0

mysql> select * from t1;
+------+
| c1   |
+------+
|    1 |
|    2 |
|    3 |
|    4 |
|    5 |
+------+
5 rows in set (0.00 sec)

mysql> select count(1) from t1 where false;
+----------+
| count(1) |
+----------+
|        0 |
+----------+
1 row in set (0.00 sec)

mysql> select found_rows();
+--------------+
| found_rows() |
+--------------+
|            5 |
+--------------+
1 row in set (0.00 sec)

Problem:
=====
1 expected.

How to repeat:

drop table if exists t1;
create table t1(c1 int);
insert into t1 values(1),(2),(3),(4),(5);
select * from t1;
select count(1) from t1 where false;
select found_rows();

Suggested fix:
1 is returned.
[11 Jan 2016 7:57] Umesh Shastry
Hello Su Dylan,

Thank you for the report and test case.
Observed that 5.7.10 is affected.

Thanks,
Umesh