cancel any active async query on persistent connection retirement
[m6w6/ext-pq] / tests / async004.phpt
1 --TEST--
2 async exec params
3 --SKIPIF--
4 <?php include "_skipif.inc"; ?>
5 --FILE--
6 <?php
7 echo "Test\n";
8
9 include "_setup.inc";
10
11 $c = new pq\Connection(PQ_DSN);
12 $t = new pq\Types($c);
13 $c->execParamsAsync("SELECT \$1,\$2::int4", array(1,2), array($t["int4"]->oid), function ($res) {
14 var_dump($res);
15 });
16 do {
17 while ($c->busy) {
18 $r = array($c->socket);
19 $w = $e = null;
20 if (stream_select($r, $w, $e, null)) {
21 $c->poll();
22 }
23 }
24 } while ($c->getResult());
25
26 ?>
27 DONE
28 --EXPECTF--
29 Test
30 object(pq\Result)#%d (6) {
31 ["status"]=>
32 int(2)
33 ["errorMessage"]=>
34 string(0) ""
35 ["numRows"]=>
36 int(1)
37 ["numCols"]=>
38 int(2)
39 ["affectedRows"]=>
40 int(1)
41 ["fetchType"]=>
42 int(0)
43 }
44 DONE