ZF-5790: A db WHERE with a ? and a ' in it, raise an exception

Description

This is the minimal test case:

$model = new Project();
$q = "test?'";
$rs = $model->fetchAll($model->select()->where('name=?',$q));

Raises "SQLSTATE[HY093]: Invalid parameter number: no parameters were bound"

Note that $q contains a ? AND a ' (single quote)

With a single "?" or a single "'" it works as expected.

Using PDO_MYSQL adapter PHP 5.2.6 (Ubuntu)

php_value magic_quotes_gpc "0" php_value magic_quotes_runtime "0" php_value magic_quotes_sybase "0"

UPDATE: with the MYSQLI adapter it works.

Comments

The Project model is simply something like that

Class Project extends Zend_Db_Table_Abstract {

}

Mysql version is 5.0.67

It duplicates ZF-1343