X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-pq;a=blobdiff_plain;f=tests%2Fcancel001.phpt;h=2cc5896996ea34f494b3771db97511f119377c2a;hp=89c4931dcdbcc2692b5ca252ececd730d6e464c1;hb=6ab3ae07622e825b32ec6c9bf781def373dad616;hpb=3024b0b5a903a2bcb082b01e1787410dc9508a9d diff --git a/tests/cancel001.phpt b/tests/cancel001.phpt index 89c4931..2cc5896 100644 --- a/tests/cancel001.phpt +++ b/tests/cancel001.phpt @@ -12,23 +12,62 @@ $c = new pq\Connection(PQ_DSN); $x = new pq\Cancel($c); -$c->execAsync("SELECT pg_sleep(2)"); +$c->execAsync("SELECT pg_sleep(10)"); $x->cancel(); +var_dump($c === $x->connection); var_dump($c->getResult()); printf("%s\n", $c->errorMessage); ?> DONE --EXPECTF-- Test -object(pq\Result)#%d (7) { +bool(true) +object(pq\Result)#%d (9) { ["status"]=> int(7) ["statusMessage"]=> string(11) "FATAL_ERROR" ["errorMessage"]=> string(47) "ERROR: canceling statement due to user request" + ["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"]=> + string(4) "%d" + ["source_function"]=> + string(17) "ProcessInterrupts" + } ["numRows"]=> int(0) ["numCols"]=> @@ -37,6 +76,8 @@ object(pq\Result)#%d (7) { int(0) ["fetchType"]=> int(0) + ["autoConvert"]=> + int(65535) } ERROR: canceling statement due to user request DONE