2013-01-25 23:22:37 +01:00
|
|
|
--TEST--
|
|
|
|
cancel
|
|
|
|
--SKIPIF--
|
|
|
|
<?php include "_skipif.inc"; ?>
|
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
echo "Test\n";
|
|
|
|
|
|
|
|
include "_setup.inc";
|
|
|
|
|
|
|
|
$c = new pq\Connection(PQ_DSN);
|
|
|
|
|
|
|
|
$x = new pq\Cancel($c);
|
|
|
|
|
|
|
|
$c->execAsync("SELECT pg_sleep(2)");
|
|
|
|
|
|
|
|
$x->cancel();
|
|
|
|
|
|
|
|
var_dump($c->getResult());
|
|
|
|
|
|
|
|
?>
|
|
|
|
DONE
|
|
|
|
--EXPECTF--
|
|
|
|
Test
|
2013-02-12 10:03:07 +01:00
|
|
|
object(pq\Result)#%d (7) {
|
2013-01-25 23:22:37 +01:00
|
|
|
["status"]=>
|
|
|
|
int(7)
|
2013-02-12 10:03:07 +01:00
|
|
|
["statusMessage"]=>
|
|
|
|
string(11) "FATAL_ERROR"
|
2013-01-25 23:22:37 +01:00
|
|
|
["errorMessage"]=>
|
2013-01-30 17:21:38 +01:00
|
|
|
string(47) "ERROR: canceling statement due to user request"
|
2013-01-25 23:22:37 +01:00
|
|
|
["numRows"]=>
|
|
|
|
int(0)
|
|
|
|
["numCols"]=>
|
|
|
|
int(0)
|
|
|
|
["affectedRows"]=>
|
|
|
|
int(0)
|
|
|
|
["fetchType"]=>
|
|
|
|
int(0)
|
|
|
|
}
|
|
|
|
DONE
|