travis: PHP-7.2+ debug builds require valgrind headers for PCRE
[m6w6/ext-pq] / tests / async003.phpt
1 --TEST--
2 async exec
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 $c->execAsync("SELECT 1+2+3; SELECT 2,3,4", function ($res) {
13 var_dump($res);
14 });
15 do {
16 while ($c->busy) {
17 $r = array($c->socket);
18 $w = $e = null;
19 if (stream_select($r, $w, $e, 1, 1000)) {
20 $c->poll();
21 }
22 }
23 } while ($c->getResult());
24
25 ?>
26 DONE
27 --EXPECTF--
28 Test
29 object(pq\Result)#%d (9) {
30 ["status"]=>
31 int(2)
32 ["statusMessage"]=>
33 string(9) "TUPLES_OK"
34 ["errorMessage"]=>
35 string(0) ""
36 ["diag"]=>
37 array(17) {
38 ["severity"]=>
39 NULL
40 ["sqlstate"]=>
41 NULL
42 ["message_primary"]=>
43 NULL
44 ["message_detail"]=>
45 NULL
46 ["message_hint"]=>
47 NULL
48 ["statement_position"]=>
49 NULL
50 ["internal_position"]=>
51 NULL
52 ["internal_query"]=>
53 NULL
54 ["context"]=>
55 NULL
56 ["schema_name"]=>
57 NULL
58 ["table_name"]=>
59 NULL
60 ["column_name"]=>
61 NULL
62 ["datatype_name"]=>
63 NULL
64 ["constraint_name"]=>
65 NULL
66 ["source_file"]=>
67 NULL
68 ["source_line"]=>
69 NULL
70 ["source_function"]=>
71 NULL
72 }
73 ["numRows"]=>
74 int(1)
75 ["numCols"]=>
76 int(1)
77 ["affectedRows"]=>
78 int(%d)
79 ["fetchType"]=>
80 int(0)
81 ["autoConvert"]=>
82 int(65535)
83 }
84 object(pq\Result)#%d (9) {
85 ["status"]=>
86 int(2)
87 ["statusMessage"]=>
88 string(9) "TUPLES_OK"
89 ["errorMessage"]=>
90 string(0) ""
91 ["diag"]=>
92 array(17) {
93 ["severity"]=>
94 NULL
95 ["sqlstate"]=>
96 NULL
97 ["message_primary"]=>
98 NULL
99 ["message_detail"]=>
100 NULL
101 ["message_hint"]=>
102 NULL
103 ["statement_position"]=>
104 NULL
105 ["internal_position"]=>
106 NULL
107 ["internal_query"]=>
108 NULL
109 ["context"]=>
110 NULL
111 ["schema_name"]=>
112 NULL
113 ["table_name"]=>
114 NULL
115 ["column_name"]=>
116 NULL
117 ["datatype_name"]=>
118 NULL
119 ["constraint_name"]=>
120 NULL
121 ["source_file"]=>
122 NULL
123 ["source_line"]=>
124 NULL
125 ["source_function"]=>
126 NULL
127 }
128 ["numRows"]=>
129 int(1)
130 ["numCols"]=>
131 int(3)
132 ["affectedRows"]=>
133 int(%d)
134 ["fetchType"]=>
135 int(0)
136 ["autoConvert"]=>
137 int(65535)
138 }
139 DONE