Bug #63365 [Opn->Fbk]: pg_send_query() blocks on queries to other connections.
| From: | felipe@php.net | Date: | Sun, 28 Oct 2012 13:57:36 +0000 |
| Subject: | Bug #63365 [Opn->Fbk]: pg_send_query() blocks on queries to other connections. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-174384@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=63365&edit=1
ID: 63365
Updated by: felipe@php.net
Reported by: chris at ctgameinfo dot com
Summary: pg_send_query() blocks on queries to other
connections.
-Status: Open
+Status: Feedback
Type: Bug
Package: PostgreSQL related
Operating System: FreeBSD (probably irrevelant)
PHP Version: 5.4.8
Block user comment: N
Private report: N
New Comment:
Please, check out the return from pg_last_error($dbconn); after the pg_send_query() call and post
the result in there.
Previous Comments:
------------------------------------------------------------------------
[2012-10-25 20:58:13] chris at ctgameinfo dot com
Description:
------------
If I open a connection and send a long running query with pg_send_query, then
open a second connection and try to send a query over the second connection with
pg_send_query it will block on the first connection's query not being complete
Test script:
---------------
<?php
for($i=1;$i<=10;$i++)
{
echo "Interation $i\n";
$dbconn = pg_connect("user=pgsql dbname=postgres", PGSQL_CONNECT_FORCE_NEW);
// Will block in the second loop interation
pg_send_query($dbconn, "select pg_sleep(5);");
}
?>
Expected result:
----------------
pg_send_query should only block on incomplete queries on the same connection.
Actual result:
--------------
pg_send_query blocks on incomplete queries on any connection.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=63365&edit=1