ZF-8048: cannot use bind variables with Zend_Db_Adapter_Abstract::query

Description

I've a query like

$q = "INSERT INTO my_t (c1, c2, c3, field_val, mtime) VALUES (?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE field_val = ?, mtime = ?" $db->query($query, array($a, $b, $c, $d, $e, $d, $e);

This call apparently fails to bind all variables; the query does nothing.

Comments

Assigning to Ralph.

Here's a patch implementing a Zend_Db_Adapter method for insertUpdating() . Zend_Db_Adapter_Abstract gets a default implementation that throws an exception, because I assume that most RDBMSs do not have INSERT ... ON DUPLICATE KEY or similar functionality. Zend_Db_Adapter_Pdo_Mysql gets an actual implementation, overriding the Zend_Db_Adapter_Abstract one.

The point of attaching this patch here is that it demonstrates how I'd like to call Zend_Db_Adapter_Abstract::query with bound parameters. Perhaps this patch can also serve as a starting point for implementing insertUpdating() for the framework.

Set component to Zend_Db

Bulk change of all issues last updated before 1st January 2010 as "Won't Fix".

Feel free to re-open and provide a patch if you want to fix this issue.