update travis/pecl
[m6w6/ext-pq] / tests / async006.phpt
1 --TEST--
2 async unbuffered exec
3 --SKIPIF--
4 <?php
5 include "_skipif.inc";
6 defined("pq\\Result::SINGLE_TUPLE") or die("skip need pq\\Result::SINGLE_TUPLE");
7 ?>
8 --FILE--
9 <?php
10 echo "Test\n";
11
12 include "_setup.inc";
13
14 $c = new pq\Connection(PQ_DSN);
15 $c->unbuffered = true;
16 $c->execAsync("SELECT a FROM generate_series(1,3) a", function ($res) {
17 var_dump($res);
18 });
19 do {
20 while ($c->busy) {
21 $r = array($c->socket);
22 $w = $e = null;
23 if (stream_select($r, $w, $e, null)) {
24 $c->poll();
25 }
26 }
27 } while ($c->getResult());
28
29 ?>
30 DONE
31 --EXPECTF--
32 Test
33 object(pq\Result)#%d (9) {
34 ["status"]=>
35 int(9)
36 ["statusMessage"]=>
37 string(12) "SINGLE_TUPLE"
38 ["errorMessage"]=>
39 string(0) ""
40 ["diag"]=>
41 array(17) {
42 ["severity"]=>
43 NULL
44 ["sqlstate"]=>
45 NULL
46 ["message_primary"]=>
47 NULL
48 ["message_detail"]=>
49 NULL
50 ["message_hint"]=>
51 NULL
52 ["statement_position"]=>
53 NULL
54 ["internal_position"]=>
55 NULL
56 ["internal_query"]=>
57 NULL
58 ["context"]=>
59 NULL
60 ["schema_name"]=>
61 NULL
62 ["table_name"]=>
63 NULL
64 ["column_name"]=>
65 NULL
66 ["datatype_name"]=>
67 NULL
68 ["constraint_name"]=>
69 NULL
70 ["source_file"]=>
71 NULL
72 ["source_line"]=>
73 NULL
74 ["source_function"]=>
75 NULL
76 }
77 ["numRows"]=>
78 int(1)
79 ["numCols"]=>
80 int(1)
81 ["affectedRows"]=>
82 int(0)
83 ["fetchType"]=>
84 int(0)
85 ["autoConvert"]=>
86 int(65535)
87 }
88 object(pq\Result)#%d (9) {
89 ["status"]=>
90 int(9)
91 ["statusMessage"]=>
92 string(12) "SINGLE_TUPLE"
93 ["errorMessage"]=>
94 string(0) ""
95 ["diag"]=>
96 array(17) {
97 ["severity"]=>
98 NULL
99 ["sqlstate"]=>
100 NULL
101 ["message_primary"]=>
102 NULL
103 ["message_detail"]=>
104 NULL
105 ["message_hint"]=>
106 NULL
107 ["statement_position"]=>
108 NULL
109 ["internal_position"]=>
110 NULL
111 ["internal_query"]=>
112 NULL
113 ["context"]=>
114 NULL
115 ["schema_name"]=>
116 NULL
117 ["table_name"]=>
118 NULL
119 ["column_name"]=>
120 NULL
121 ["datatype_name"]=>
122 NULL
123 ["constraint_name"]=>
124 NULL
125 ["source_file"]=>
126 NULL
127 ["source_line"]=>
128 NULL
129 ["source_function"]=>
130 NULL
131 }
132 ["numRows"]=>
133 int(1)
134 ["numCols"]=>
135 int(1)
136 ["affectedRows"]=>
137 int(0)
138 ["fetchType"]=>
139 int(0)
140 ["autoConvert"]=>
141 int(65535)
142 }
143 object(pq\Result)#%d (9) {
144 ["status"]=>
145 int(9)
146 ["statusMessage"]=>
147 string(12) "SINGLE_TUPLE"
148 ["errorMessage"]=>
149 string(0) ""
150 ["diag"]=>
151 array(17) {
152 ["severity"]=>
153 NULL
154 ["sqlstate"]=>
155 NULL
156 ["message_primary"]=>
157 NULL
158 ["message_detail"]=>
159 NULL
160 ["message_hint"]=>
161 NULL
162 ["statement_position"]=>
163 NULL
164 ["internal_position"]=>
165 NULL
166 ["internal_query"]=>
167 NULL
168 ["context"]=>
169 NULL
170 ["schema_name"]=>
171 NULL
172 ["table_name"]=>
173 NULL
174 ["column_name"]=>
175 NULL
176 ["datatype_name"]=>
177 NULL
178 ["constraint_name"]=>
179 NULL
180 ["source_file"]=>
181 NULL
182 ["source_line"]=>
183 NULL
184 ["source_function"]=>
185 NULL
186 }
187 ["numRows"]=>
188 int(1)
189 ["numCols"]=>
190 int(1)
191 ["affectedRows"]=>
192 int(0)
193 ["fetchType"]=>
194 int(0)
195 ["autoConvert"]=>
196 int(65535)
197 }
198 object(pq\Result)#%d (9) {
199 ["status"]=>
200 int(2)
201 ["statusMessage"]=>
202 string(9) "TUPLES_OK"
203 ["errorMessage"]=>
204 string(0) ""
205 ["diag"]=>
206 array(17) {
207 ["severity"]=>
208 NULL
209 ["sqlstate"]=>
210 NULL
211 ["message_primary"]=>
212 NULL
213 ["message_detail"]=>
214 NULL
215 ["message_hint"]=>
216 NULL
217 ["statement_position"]=>
218 NULL
219 ["internal_position"]=>
220 NULL
221 ["internal_query"]=>
222 NULL
223 ["context"]=>
224 NULL
225 ["schema_name"]=>
226 NULL
227 ["table_name"]=>
228 NULL
229 ["column_name"]=>
230 NULL
231 ["datatype_name"]=>
232 NULL
233 ["constraint_name"]=>
234 NULL
235 ["source_file"]=>
236 NULL
237 ["source_line"]=>
238 NULL
239 ["source_function"]=>
240 NULL
241 }
242 ["numRows"]=>
243 int(0)
244 ["numCols"]=>
245 int(1)
246 ["affectedRows"]=>
247 int(3)
248 ["fetchType"]=>
249 int(0)
250 ["autoConvert"]=>
251 int(65535)
252 }
253 DONE