Skip to content

Commit 5ac1e3b

Browse files
committed
fix test.
1 parent d2b54ea commit 5ac1e3b

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

ext/pgsql/tests/pg_pipeline_sync.phpt

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,37 +47,47 @@ if (!pg_enter_pipeline_mode($db)) {
4747
}
4848

4949
if (!pg_send_query_params($db, "select $1 as index, now() + ($1||' day')::interval as time", array(1))) {
50-
die('pg_send_query_params{}');
50+
die('pg_send_query_params failed');
5151
}
5252

5353
if (!pg_pipeline_sync($db)) {
54-
die('pg_pipeline_sync{}');
54+
die('pg_pipeline_sync failed');
5555
}
5656

5757
if (pg_pipeline_status($db) !== PGSQL_PIPELINE_ON) {
58-
die('pg_pipeline_status{}');
58+
die('pg_pipeline_status failed');
5959
}
6060

6161
if (!($result = pg_get_result($db))) {
62-
die('pg_get_result()');
62+
die('pg_get_result');
63+
}
64+
65+
if (pg_result_status($result) !== PGSQL_TUPLES_OK) {
66+
die('pg_result_status failed');
6367
}
6468

6569
if (pg_num_rows($result) == -1) {
66-
die('pg_num_rows()');
70+
die('pg_num_rows failed');
6771
}
6872

6973
if (!pg_fetch_row($result, null)) {
70-
die('pg_fetch_row()');
74+
die('pg_fetch_row failed');
7175
}
7276

7377
pg_free_result($result);
74-
while (pg_connection_busy($db)) {
75-
nb_flush($db, $db_socket);
76-
nb_consume($db, $db_socket);
78+
79+
if (pg_get_result($db) !== false) {
80+
die('pg_get_result failed');
81+
}
82+
83+
if (($result = pg_get_result($db)) !== false) {
84+
if (pg_result_status($result) !== PGSQL_PIPELINE_SYNC) {
85+
die('pg_result_status failed');
86+
}
7787
}
7888

7989
if (!pg_exit_pipeline_mode($db)) {
80-
die('pg_exit_pipeline_mode{}');
90+
die('pg_exit_pipeline_mode failed');
8191
}
8292

8393
echo "OK";

0 commit comments

Comments
 (0)