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.