ZF-11110: Zend_Db_Statement_Pdo uses unsuitable PDO methods
Description
Some PDO methods have different semantics compared to Zend_Db:
When no $type argument is given to PDOStatement::bindValue(...), it always assumes a string type. However, Zend_Db_Statement::bindValue(...) is expected to determine the database type from the value's PHP type.
PDOStatement::execute($params) treats all values of $params as strings, while Zend_Db_Statement::execute($params) is expected to respect their PHP types.
This means that the Zend_Db_Statement_Pdo implementation can only make use of:
* PDOStatement::bindValue(...) with an explicit $type argument
* PDOStatement::execute() without the $params argument
The attached patch fixes both issues for ZF 1.11.3, so all types including Boolean types will work properly.
This solves, among others, the issue with PDO/PostgreSQL and FALSE (ZF-538). However, in contrast to the solution discussed in ZF-538, this patch only affects the Pdo adapter and does not force all other adapters to use explicit binds.
Comments
Posted by Volker Grabsch (vog) on 2011-02-24T02:40:33.000+0000
Since this issue tracking system doesn't allow me to upload a patch, I'm providing it here. Sorry for the inconvenience:
Posted by Volker Grabsch (vog) on 2011-04-05T12:40:43.000+0000
This is duplicate of ZF-538.