ZF-10000: Zend_Db_Select having() does not allow passing the type of a value

Issue Type: Improvement Created: 2010-06-16T11:46:00.000+0000 Last Updated: 2010-09-02T07:26:02.000+0000 Status: Resolved Fix version(s): - 1.10.8 (25/Aug/10)

Reporter: Martin Hujer (mhujer) Assignee: Pádraic Brady (padraic) Tags: - Zend_Db_Select

Related issues: Attachments: - ZF-10000.patch


When using where(), you can pass the optional third parameter which way the $value should be quoted. This functionality is not available for having(). It would be nice to have it.

<pre class="highlight">
public function where($cond, $value = null, $type = null)


public function having($cond)
        if (func_num_args() > 1) {
            $val = func_get_arg(1);
            $cond = $this->_adapter->quoteInto($cond, $val);


<pre class="highlight">$cond = $this->getAdapter()->quoteInto('count >= ?', $minimalCount, Zend_Db::INT_TYPE);


Posted by Martin Hujer (mhujer) on 2010-06-16T11:47:42.000+0000


Posted by Ralph Schindler (ralph) on 2010-06-18T13:16:14.000+0000

Can you propose a patch and unit test by chance?

Posted by Dolf Schimmel (Freeaqingme) (freak) on 2010-06-18T13:18:13.000+0000

Can I just say I'm jealous on this issue?

Posted by Dolf Schimmel (Freeaqingme) (freak) on 2010-06-18T13:18:29.000+0000

I'd wanted to add an issue with this id.

Posted by Martin Hujer (mhujer) on 2010-06-18T17:02:47.000+0000

Ralph: I'll try to do it tomorrow.

Dorf: Sorry...

Posted by Martin Hujer (mhujer) on 2010-06-19T01:43:11.000+0000

Attaching patch.

Ralph, it would be great if you have time to review it.

Posted by Pádraic Brady (padraic) on 2010-08-19T11:46:47.000+0000

Applied patch by Martin Hujer in r22850

Posted by Simon Gilliot (alsimon) on 2010-09-02T07:25:59.000+0000

I think this patch has some problems : In Zend_Db_Select, line 535, a test on value is done. That can't allow us to pass 0 or "0" (or an empty string) as value.

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.