Details
Description
We discover a problem with quoteInto and SQLite.
The Zend Framework generate this kind of SQL (we use quoteInto for projects_id and users_id):
DELETE FROM "usvn_users_to_projects" WHERE (projects_id = '1' AND users_id = 1)
But in SQlite quote seems to be mandatory and we need write:
DELETE FROM "usvn_users_to_projects" WHERE (projects_id = '1' AND users_id = '1')
We made an ugly hack to fix the problem into Zend/Db/Adapter/Pdo/Sqlite.php
public function quote($value) { if (is_int($value) || is_float($value)) { return parent::quote("$value"); } return parent::quote($value); }
I'm not sure I understand. Are the SQL datatypes of projects_id and users_id integer or varchar?
Does SQLite have a problem comparing an integer literal to a varchar? Some RDBMS brands have the opposite problem, you can't compare a string literal to an integer column.
You also have a workaround:
$expr = $db->quoteInto('users_id = ?', (string) 1);$expr = $db->quoteInto('users_id = ?', (string) 1);