diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2018-07-01 14:06:40 +0200 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2018-07-01 14:09:16 +0200 |
commit | d5ad0e19d16b66f18b5be87d30dacc8204c238ce (patch) | |
tree | eb3de629f9e59fcc14ab28da01204a82d37b3e4f /src/test/examples/testlo.c | |
parent | c91ac358b190cf51ec0334215987f6633f289544 (diff) | |
download | postgresql-d5ad0e19d16b66f18b5be87d30dacc8204c238ce.tar.gz postgresql-d5ad0e19d16b66f18b5be87d30dacc8204c238ce.zip |
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/testlo.c')
-rw-r--r-- | src/test/examples/testlo.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/examples/testlo.c b/src/test/examples/testlo.c index 8a65f897cd7..cba115a3abf 100644 --- a/src/test/examples/testlo.c +++ b/src/test/examples/testlo.c @@ -235,7 +235,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); |