Edit report at http://pear.php.net/bugs/bug.php?id=16000&edit=1

ID: 16000
Updated by: aharvey@php.net
Reported By: user2037 at ymail dot com
Summary: Db doesn't commit after first handle when quotes are
escaped with slash
-Status: Open
+Status: Bogus
Type: Bug
Package: DB
Operating System: Ubuntu and Debian
Package Version: 1.7.14RC1
PHP Version: 5.2.9
Roadmap Versions:
New Comment:

-Status: Open
+Status: Bogus
Can't reproduce. Moreover, the given script has a couple of problems
which could
explain the observed behaviour: Both inserts are to the same DB object,
PostgreSQL string quoting isn't backslash based like MySQL.

Previous Comments:

[2009-03-09 18:27:23] #0b833e7d23823fc9ca5

Only the first commit is sent when there are more than multiple db
handles open and inserts involving slash-escaped quotes are executed.

The attached test scripts demonstrate the issue with two handles, but
I've seen the issue with three handles. It also fails to commit even if
the handles connect to completely different database systems (one to
Postgresql and another to Mysql for example).

Db version 1.7.13 also has this flaw.

Test script:
require 'DB.php';

$db1 = DB::connect('pgsql://test:secret@localhost/test1');
$db2 = DB::connect('mysql://test:secret@localhost/test2');


$result = $db1->query('INSERT INTO test (test) '
. 'VALUES (\'db1 some \\\'text\\\' ' . mt_rand() . '\')');
$result = $db1->query('INSERT INTO test (test) '
. 'VALUES (\'db2 some \\\'text\\\' ' . mt_rand() . '\')');


Expected result:
A record inserted into the test table of each database.

Actual result:
All commits after the first are omitted, and the records in the
subsequent databases are missing.


Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
postedDec 24, '10 at 6:18a
activeDec 24, '10 at 6:18a

1 user in discussion

Aharvey: 1 post



site design / logo © 2022 Grokbase