Regardless of how it actually works, I would expect limit null or limit
false to remove the limit portion if the query, while limit 0 would do an
actual limit 0. Having it do a limit 2.1 bajillion is just strange and
unexpected behavior.

Just my 2c.

--
Hector Virgen
Sent from my Droid X
On Oct 2, 2010 5:28 PM, "Daniel Latter" <dan.lat...@gmail.com> wrote:
> OK, so it doesnt seem to be a bug judging by what Valeriy said and the
link
> posted but i think this maybe a bit drastic, as Hector said I think limit
0,
> null or false should just remove or even dont add the limit part?
>
> Daniel.
>
> On 3 October 2010 01:24, Hector Virgen <djvir...@gmail.com> wrote:
>
>> So limit 0 (or limit null, or limit false) would remove the limit portion
>> if the query?
>>
>> --
>> Hector Virgen
>> Sent from my Droid X
>> On Oct 2, 2010 5:21 PM, "Daniel Latter" <dan.lat...@gmail.com> wrote:
>> > or just throw away the limit part altogether?
>> >
>> > Daniel
>> >
>> > On 3 October 2010 01:17, Hector Virgen <djvir...@gmail.com> wrote:
>> >
>> >> Limit 0 us definitely an incorrect usage, so maybe an exception should
>> be
>> >> thrown?
>> >>
>> >> --
>> >> Hector Virgen
>> >> Sent from my Droid X
>> >> On Oct 2, 2010 5:15 PM, "Daniel Latter" <dan.lat...@gmail.com> wrote:
>> >> > Hi,
>> >> >
>> >> > I know what your saying but my point is that, is this intended
>> behaviour
>> >> to
>> >> > return a number so large if a zero happend to be passed.?
>> >> >
>> >> > Thanks
>> >> > Daniel.
>> >> >
>> >> > 2010/10/3 Valeriy Yatsko <d...@design.ru>
>> >> >
>> >> >> Good day
>> >> >>
>> >> >> > dont know if this is a bug or not but if you pass the following
>> >> >> parameters
>> >> >> > to the limit method on select object like so:
>> >> >> >
>> >> >> > ->limit(0, 10);
>> >> >> >
>> >> >> > It produces the following SQL:
>> >> >> >
>> >> >> > LIMIT 2147483647 OFFSET 10
>> >> >> >
>> >> >> > now i know you should vaidate the limit val beforehand but this
>> could
>> >> >> > potentially kill someones app?
>> >> >>
>> >> >>
>> >> >> In Zend_Db_Select, you can use the limit() method to specify the
>> count
>> >> of
>> >> >> rows and the number of rows to skip. The first argument to this
>> method
>> >> is
>> >> >> the desired count of rows. The second argument is the number of
rows
>> to
>> >> >> skip.
>> >> >>
>> >> >> So you should use
>> >> >> ->limit(10,0)
>> >> >> instead.
>> >> >>
>> >> >> --
>> >> >> Валерий Яцко
>> >> >>
>> ______________________________________________________________________
>> >> >> d...@design.ru | http://www.artlebedev.ru
>> >> >>
>> >> >>
>> >>
>>

Reply via email to