Bug #44247 wrong results comming from selecting a range of records usint LIMIT keyword
Submitted: 13 Apr 2009 21:02 Modified: 13 Apr 2009 21:13
Reporter: AHMED TAWFIK Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: DDL Severity:S3 (Non-critical)
Version:5.0.77 MySQL Community Server OS:Solaris (SunOS medhat 5.10 Generic_137138-09 i86pc i386 i86pc)
Assigned to: CPU Architecture:Any

[13 Apr 2009 21:02] AHMED TAWFIK
Description:
Dear,
when I'm trying to issue this select statement:
SELECT * FROM MATERIALS ORDER BY ID DESC LIMIT 50,60;
i get records starting from 50 till the end of the all rows, while i should get Only 10 records.

the same also happens if i try:
SELECT * FROM MATERIALS where ID between 1 and 100  LIMIT 50,60;
i got all the records starting from 50 till 100.

it also happens for :
SELECT * FROM MATERIALS   LIMIT 50,60;

to summarize, the upper limit is not applied.

screen shots available: (max records in the table are 70)

http://rapidshare.com/files/220972851/mysql_bugs.rar.html

Please Advise

How to repeat:
create a dummy table and insert fr example 100 row, then select * from it and use LIMIT to select a range.
[13 Apr 2009 21:08] AHMED TAWFIK
screen shots

Attachment: mysql bugs.rar (, text), 226.44 KiB.

[13 Apr 2009 21:09] AHMED TAWFIK
screen shots uploaded to mysql site instead of rapidshare
[13 Apr 2009 21:13] Sveta Smirnova
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://dev.mysql.com/doc/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php

Please read at http://dev.mysql.com/doc/refman/5.0/en/select.html how LIMIT works:

With two arguments, the first argument specifies the offset of the first row to return, and the second specifies the maximum number of rows to return.