Bug #112965 A warning is issued that the FOUND_ROWS() function is deprecated when used alone
Submitted: 4 Nov 2023 3:43 Modified: 12 Mar 2024 13:13
Reporter: Doeyull Kim Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:8.0.32 OS:Windows (Microsoft Windows 11 Pro)
Assigned to: CPU Architecture:x86
Tags: WBBugReporter

[4 Nov 2023 3:43] Doeyull Kim
Description:
Using the FOUND_ROWS() function by itself, rather than in conjunction with the SQL_CALC_FOUND_ROWS query modifier, also raises the following warning. 

FOUND_ROWS() is deprecated and will be removed in a future release. Consider using COUNT(*) instead.

It is our understanding that the FOUND_ROWS() function is not deprecated when used alone, and this warning is confusing to users.

How to repeat:
A warning is always raised when using the FOUND_ROWS() function immediately after using a SELECT statement.
[6 Nov 2023 12:50] MySQL Verification Team
Hello!

Thank you for the bug report.
Could you please provide queries which hit the issue reported? Thanks.

Regards,
Ashwini Patil
[7 Nov 2023 15:15] Doeyull Kim
-- query
SELECT 1 AS col;
SELECT FOUND_ROWS() AS affected_rows;
SHOW WARNINGS;
[7 Nov 2023 15:15] Doeyull Kim
Warning	1287

Attachment: 001.png (image/png, text), 22.86 KiB.

[12 Mar 2024 13:13] MySQL Verification Team
Hello Doeyull Kim,

Thank you the details.
Imho this is not a bug. Please check the documentation available at https://dev.mysql.com/doc/refman/8.0/en/information-functions.html

Regards,
Ashwini Patil