From 8c0dc5e88757f20799395c37f9c7f3159a8e428b Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Tue, 28 Jun 2005 14:54:44 +0000 Subject: [PATCH] Make exec() return FALSE on error as do other drivers. --- ext/pdo_pgsql/pgsql_driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/pdo_pgsql/pgsql_driver.c b/ext/pdo_pgsql/pgsql_driver.c index 9137d193a8..0e17aaf7a7 100644 --- a/ext/pdo_pgsql/pgsql_driver.c +++ b/ext/pdo_pgsql/pgsql_driver.c @@ -156,7 +156,7 @@ static long pgsql_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len TSRM if (!(res = PQexec(H->server, sql))) { /* fatal error */ pdo_pgsql_error(dbh, PGRES_FATAL_ERROR, NULL); - return 0; + return -1; } else { ExecStatusType qs = PQresultStatus(res); if (qs != PGRES_COMMAND_OK && qs != PGRES_TUPLES_OK) { @@ -167,7 +167,7 @@ static long pgsql_handle_doer(pdo_dbh_t *dbh, const char *sql, long sql_len TSRM pdo_pgsql_error(dbh, qs, NULL); #endif PQclear(res); - return 0; + return -1; } H->pgoid = PQoidValue(res); PQclear(res); -- 2.50.1