X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-pq;a=blobdiff_plain;f=tests%2Fcancel001.phpt;h=4ca9664aa8a390a7592982b27f35a9a323f23d46;hp=f763847d1651424adb4b31c486efc703a1ea5c2c;hb=HEAD;hpb=dde388e274286b4200689bf21f061a974e8bd847 diff --git a/tests/cancel001.phpt b/tests/cancel001.phpt index f763847..4ca9664 100644 --- a/tests/cancel001.phpt +++ b/tests/cancel001.phpt @@ -9,10 +9,15 @@ echo "Test\n"; include "_setup.inc"; $c = new pq\Connection(PQ_DSN); +try { + $c->exec("SET lc_messages TO 'C'"); +} catch (pq\Exception $e) { + // no not fail if we are not superuser +} $x = new pq\Cancel($c); -$c->execAsync("SELECT pg_sleep(2)"); +$c->execAsync("SELECT pg_sleep(10)"); $x->cancel(); @@ -24,13 +29,50 @@ DONE --EXPECTF-- Test bool(true) -object(pq\Result)#%d (8) { +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"]=> @@ -40,7 +82,7 @@ object(pq\Result)#%d (8) { ["fetchType"]=> int(0) ["autoConvert"]=> - int(255) + int(65535) } ERROR: canceling statement due to user request DONE