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


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.

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);


$cond = $this->getAdapter()->quoteInto('count >= ?', $minimalCount, Zend_Db::INT_TYPE);



Can you propose a patch and unit test by chance?

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

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

Ralph: I'll try to do it tomorrow.

Dorf: Sorry...

Attaching patch.

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

Applied patch by Martin Hujer in r22850

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.