summaryrefslogtreecommitdiff
path: root/src/test/examples/testlibpq.c
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2018-07-01 14:06:40 +0200
committerPeter Eisentraut <peter_e@gmx.net>2018-07-01 14:09:22 +0200
commit2a4dca949109dae3b95c5f4d55462fd4e6673310 (patch)
tree8cc8eb2048183777186d5285e3811938735c0615 /src/test/examples/testlibpq.c
parentf61a25727cd9246d749825cdaafa821b7ddbad7c (diff)
Fix libpq example programs
When these programs call pg_catalog.set_config, they need to check for PGRES_TUPLES_OK instead of PGRES_COMMAND_OK. Fix for 5770172cb0c9df9e6ce27c507b449557e5b45124. Reported-by: Ideriha, Takeshi <ideriha.takeshi@jp.fujitsu.com>
Diffstat (limited to 'src/test/examples/testlibpq.c')
-rw-r--r--src/test/examples/testlibpq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/examples/testlibpq.c b/src/test/examples/testlibpq.c
index 92a05e53093..d9c6c4587d4 100644
--- a/src/test/examples/testlibpq.c
+++ b/src/test/examples/testlibpq.c
@@ -51,7 +51,7 @@ main(int argc, char **argv)
/* Set always-secure search path, so malicous users can't take control. */
res = PQexec(conn,
"SELECT pg_catalog.set_config('search_path', '', false)");
- if (PQresultStatus(res) != PGRES_COMMAND_OK)
+ if (PQresultStatus(res) != PGRES_TUPLES_OK)
{
fprintf(stderr, "SET failed: %s", PQerrorMessage(conn));
PQclear(res);