1
0
mirror of https://github.com/danog/ext-pq.git synced 2024-12-02 09:18:02 +01:00
ext-pq/tests/cancel001.phpt

84 lines
1.4 KiB
Plaintext
Raw Normal View History

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);
2017-09-04 15:33:59 +02:00
$c->execAsync("SELECT pg_sleep(10)");
2013-01-25 23:22:37 +01:00
$x->cancel();
2013-05-14 13:09:23 +02:00
var_dump($c === $x->connection);
2013-01-25 23:22:37 +01:00
var_dump($c->getResult());
2013-02-14 14:54:22 +01:00
printf("%s\n", $c->errorMessage);
2013-01-25 23:22:37 +01:00
?>
DONE
--EXPECTF--
Test
2013-05-14 13:09:23 +02:00
bool(true)
2016-05-17 12:13:20 +02:00
object(pq\Result)#%d (9) {
2013-01-25 23:22:37 +01:00
["status"]=>
int(7)
["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"
2016-05-17 12:13:20 +02:00
["diag"]=>
array(17) {
["severity"]=>
string(5) "ERROR"
["sqlstate"]=>
string(5) "57014"
["message_primary"]=>
string(39) "canceling statement due to user request"
["message_detail"]=>
NULL
["message_hint"]=>
NULL
["statement_position"]=>
NULL
["internal_position"]=>
NULL
["internal_query"]=>
NULL
["context"]=>
NULL
["schema_name"]=>
NULL
["table_name"]=>
NULL
["column_name"]=>
NULL
["datatype_name"]=>
NULL
["constraint_name"]=>
NULL
["source_file"]=>
string(10) "postgres.c"
["source_line"]=>
2016-05-17 16:52:04 +02:00
string(4) "%d"
2016-05-17 12:13:20 +02:00
["source_function"]=>
string(17) "ProcessInterrupts"
}
2013-01-25 23:22:37 +01:00
["numRows"]=>
int(0)
["numCols"]=>
int(0)
["affectedRows"]=>
int(0)
["fetchType"]=>
int(0)
2014-09-12 16:52:39 +02:00
["autoConvert"]=>
2014-09-17 14:13:53 +02:00
int(65535)
2013-01-25 23:22:37 +01:00
}
2013-02-14 14:54:22 +01:00
ERROR: canceling statement due to user request
2013-01-25 23:22:37 +01:00
DONE