Bug #866 COUNT(1) with LIMIT clause returns all rows found
| Submitted: | 17 Jul 2003 9:46 | Modified: | 17 Jul 2003 10:12 |
|---|---|---|---|
| Reporter: | Patrick O'Lone | Email Updates: | |
| Status: | Not a Bug | Impact on me: | |
| Category: | MySQL Server | Severity: | S2 (Serious) |
| Version: | 4.0.13 | OS: | Linux (Linux) |
| Assigned to: | CPU Architecture: | Any |
[17 Jul 2003 9:46]
Patrick O'Lone
[17 Jul 2003 10:12]
Indrek Siitan
This is completely expected behaviour. LIMIT is applied as a last thing in processing the query to limit the rows returned. The COUNT(*) statement is parsed before the LIMIT, so it takes all rows in the table into account.
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.038 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.