4104
MySQLWARNINGCriticalHIGH confidence

FOUND_ROWS() is deprecated

Production Risk

Low — The function still works, but will be removed in a future MySQL version.

Why it happens
  1. 1A query calls FOUND_ROWS() after a SELECT with SQL_CALC_FOUND_ROWS.

Fix

Replace FOUND_ROWS() with an explicit COUNT(*)

Replace FOUND_ROWS() with an explicit COUNT(*)
SELECT COUNT(*) FROM t WHERE condition;

Why this works

An explicit COUNT(*) query is more predictable and not subject to deprecation.

What not to do

Sources
Official documentation ↗

MySQL 8.0 — 4104 ER_WARN_DEPRECATED_FOUND_ROWS

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All MySQL errors