[fw-general] Specifying a Database Adapter and Zend_Application_Resource_Multidb

2010-10-02 Thread EvilThug
How do I code the correct database adapter into a model class that extends the Zend_Db_Table_Abstract? I am using Zend_Application_Resource_Multidb in my config in application/configs/application.ini: - resources.multidb.db1.adapter = pdo_mysql

[fw-general] Select object behaviour

2010-10-02 Thread Daniel Latter
Hi All, 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

Re: [fw-general] Select object behaviour

2010-10-02 Thread Valeriy Yatsko
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

Re: [fw-general] Select object behaviour

2010-10-02 Thread Daniel Latter
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

Re: [fw-general] Select object behaviour

2010-10-02 Thread Hector Virgen
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

Re: [fw-general] Select object behaviour

2010-10-02 Thread Daniel Latter
The example I am thinking of is an app could very well have millions of rows, and if you did happen to pass a zero you would most probably end up killing the server with an out of memory error, or timeout issues... and thus bring you app crashing down. Daniel. 2010/10/3 Daniel Latter

Re: [fw-general] Select object behaviour

2010-10-02 Thread Daniel Latter
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

Re: [fw-general] Select object behaviour

2010-10-02 Thread Valeriy Yatsko
Good day The example I am thinking of is an app could very well have millions of rows, and if you did happen to pass a zero you would most probably end up killing the server with an out of memory error, or timeout issues... and thus bring you app crashing down. Judging with protected

Re: [fw-general] Select object behaviour

2010-10-02 Thread Hector Virgen
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

Re: [fw-general] Select object behaviour

2010-10-02 Thread Daniel Latter
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

Re: [fw-general] Select object behaviour

2010-10-02 Thread Hector Virgen
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

Re: [fw-general] Select object behaviour

2010-10-02 Thread Valeriy Yatsko
Good day So limit 0 (or limit null, or limit false) would remove the limit portion if the query? True. As long as you have entries amount less than PHP_INT_MAX (which is different for 32-bit and 64-bit systems). Mac OS X Snow Leopard 10.6.4 (64 bit) dwr:~ dwr$ php intmax.php

Re: [fw-general] Select object behaviour

2010-10-02 Thread Daniel Latter
Yes, but it doesnt seem right to assume someones app will have the same amount or rows that is equesl to the max integer the os can hold? Daniel 2010/10/3 Valeriy Yatsko d...@design.ru Good day So limit 0 (or limit null, or limit false) would remove the limit portion if the query?

Re: [fw-general] Select object behaviour

2010-10-02 Thread Valeriy Yatsko
Good day Yes, but it doesnt seem right to assume someones app will have the same amount or rows that is equesl to the max integer the os can hold? You really have table larger than 2 000 000 000 entries on 32-bit servers? :) Let's see... int = 4 bytes on 32 bit systems: 2 000 000 000 x 4 = 8

Re: [fw-general] Specifying a Database Adapter and Zend_Application_Resource_Multidb

2010-10-02 Thread Hector Virgen
The simplest way to do this is to not extend Zend_Db_Table_Abstract. In ZF, tables are not models. I've gone down this route personally and it's very difficult to do anything slightly complex loo ike dealing with multiple tables. Instead, I suggest creating a model that doesn't extend a base