Details
-
Type:
Patch
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.5.1
-
Fix Version/s: None
-
Component/s: Zend_Db
-
Labels:
Description
$db->query("SELECT `foo`.`bar` FROM `xxx` WHERE (zzz = 'a\'b+c:d')");
This query was build using Db_Select
single quote was properly escaped and passed to fetch method where it failed
The message is: 'Invalid bind-variable position ':d'
From what I can tell the :d was mistaken for named parameter
it only happens if the single quote was present in the same parameter
after removing it the query is processed correctly
$db->query("SELECT `foo`.`bar` FROM `xxx` WHERE (zzz = 'ab+c:d')");
using Mysqli adapter
Another example
$db->query("REPLACE INTO foo (aaa) VALUES (('a\'s aa '),('rv:1.8.1.11'))");escaped single quote in first parameter confuses the code
'Zend_Db_Statement_Exception' with message 'Invalid bind-variable position ':1'
$db->query("REPLACE INTO foo (aaa) VALUES (('a\'s aa '),('rv:1.8.1.11'))");