Bug #16621 [Opn->Bgs]: query() with placeholders messes up in sqlite driver

From: Date: Wed, 16 Sep 2009 22:00:42 +0000
Subject: Bug #16621 [Opn->Bgs]: query() with placeholders messes up in sqlite driver
References: 1  Groups: php.pear.bugs 
Request: Send a blank email to pear-bugs+get-1658@lists.php.net to get a copy of this message
Edit report at http://pear.php.net/bugs/bug.php?id=16621&edit=1 ID: 16621 Updated by: jan@horde.org Reported By: jan at horde dot org Summary: query() with placeholders messes up in sqlite driver -Status: Open +Status: Bogus Type: Bug Package: DB Package Version: 1.7.14RC1 PHP Version: 4.4.9 Roadmap Versions: New Comment: -Status: Open +Status: Bogus Looks like this is a completely broken sqlite extension. sqlite_escape_string() is not returning what it should. Previous Comments: ------------------------------------------------------------------------ [2009-09-16 22:46:09] yunosh Description: ------------ Placeholder values are messed up. Test script: --------------- $query = 'UPDATE turba_objects SET owner_id = ?, object_type = ?, object_members = ?, object_uid = ?, object_firstname = ?, object_lastname = ?, object_middlenames = ?, object_nameprefix = ?, object_namesuffix = ?, object_alias = ?, object_bday = ?, object_photo = ?, object_phototype = ?, object_homestreet = ?, object_homepob = ?, object_homecity = ?, object_homeprovince = ?, object_homepostalcode = ?, object_homecountry = ?, object_workstreet = ?, object_workpob = ?, object_workcity = ?, object_workprovince = ?, object_workpostalcode = ?, object_workcountry = ?, object_tz = ?, object_email = ?, object_homephone = ?, object_workphone = ?, object_cellphone = ?, object_fax = ?, object_pager = ?, object_title = ?, object_role = ?, object_company = ?, object_logo = ?, object_logotype = ?, object_category = ?, object_notes = ?, object_url = ?, object_freebusyurl = ?, object_pgppublickey = ?, object_smimepublickey = ? WHERE object_id = ?'; $values = array ( 0 => 'jan', 1 => 'Object', 2 => NULL, 3 => '20090916221835.160832odk1p7etjw@neo.wg.de', 4 => 'Jan', 5 => 'Schneider', 6 => '', 7 => '', 8 => '', 9 => '', 10 => NULL, 11 => NULL, 12 => NULL, 13 => '', 14 => '', 15 => '', 16 => '', 17 => '', 18 => '', 19 => '', 20 => '', 21 => '', 22 => '', 23 => '', 24 => '', 25 => '', 26 => 'jan@horde.org', 27 => '', 28 => '', 29 => '', 30 => '', 31 => '', 32 => '', 33 => '', 34 => '', 35 => NULL, 36 => NULL, 37 => '', 38 => '', 39 => '', 40 => '', 41 => '', 42 => '', 43 => 'bfc99ba299b78e02ebacc5fa3e148457', ); $db->query($query, $values); echo $db->last_query; Expected result: ---------------- UPDATE turba_objects SET owner_id = 'jan', object_type = 'Object', object_members = NULL, object_uid = '20090916221835.160832odk1p7etjw@neo.wg.de', object_firstname = 'Jan', object_lastname = 'Schneider', object_middlenames = '', object_nameprefix = '', object_namesuffix = '', object_alias = '', object_bday = NULL, object_photo = NULL, object_phototype = NULL, object_homestreet = '', object_homepob = '', object_homecity = '', object_homeprovince = '', object_homepostalcode = '', object_homecountry = '', object_workstreet = '', object_workpob = '', object_workcity = '', object_workprovince = '', object_workpostalcode = '', object_workcountry = '', object_tz = '', object_email = 'jan@horde.org', object_homephone = '', object_workphone = '', object_cellphone = '', object_fax = '', object_pager = '', object_title = '', object_role = '', object_company = '', object_logo = NULL, object_logotype = NULL, object_category = '', object_notes = '', object_url = '', object_freebusyurl = '', object_pgppublickey = '', object_smimepublickey = '' WHERE object_id = 'bfc99ba299b78e02ebacc5fa3e148457' Actual result: -------------- UPDATE turba_objects SET owner_id = 'jan', object_type = 'Object', object_members = NULL, object_uid = '20090916221835.160832odk1p7etjw@neo.wg.de', object_firstname = 'Jan', object_lastname = 'Schneider', object_middlenames = 'S', object_nameprefix = 'S', object_namesuffix = 'S', object_alias = 'S', object_bday = NULL, object_photo = NULL, object_phototype = NULL, object_homestreet = 'S', object_homepob = 'S', object_homecity = 'S', object_homeprovince = 'S', object_homepostalcode = 'S', object_homecountry = 'S', object_workstreet = 'S', object_workpob = 'S', object_workcity = 'S', object_workprovince = 'S', object_workpostalcode = 'S', object_workcountry = 'S', object_tz = 'S', object_email = 'jan@horde.org', object_homephone = 'j', object_workphone = 'j', object_cellphone = 'j', object_fax = 'j', object_pager = 'j', object_title = 'j', object_role = 'j', object_company = 'j', object_logo = NULL, object_logotype = NULL, object_category = 'j', object_notes = 'j', object_url = 'j', object_freebusyurl = 'j', object_pgppublickey = 'j', object_smimepublickey = 'j' WHERE object_id = 'bfc99ba299b78e02ebacc5fa3e148457' ------------------------------------------------------------------------ -- Edit this bug report at http://pear.php.net/bugs/bug.php?id=16621&edit=1

« previous php.pear.bugs (#1658) next »