SQL_CALC_FOUND_ROWS

I use SQL_CALC_FOUND_ROWS on some of my queries to create my paging for my site. It has worked fine for a few months and all of a sudden it quit working.

It doesn’t matter how simple the query it alway’s returns 1.

I have a table with ~(40,000) rows and I run a query like:

SELECT SQL_CALC_FOUND_ROWS media_id FROM media ORDER BY media_id DESC LIMIT 0, 15;

SELECT FOUND_ROWS(); returns 1.

Nothing has changed in the code, and even running this through MySQL command line returns the same result.

Any suggestion?

Does MySQL Command line client returns right result or wrong result ?

Did you upgrade MySQL Server recently ?

If you can repeat such behavior using Command line client you may run into the bug which ether starts to happen with Server upgrade or just due to your data changes. In this case it is best to open the bug at bugs.mysql.com