]> granicus.if.org Git - php/commitdiff
Make exec() return FALSE on error as do other drivers.
authorIlia Alshanetsky <iliaa@php.net>
Tue, 28 Jun 2005 14:54:44 +0000 (14:54 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 28 Jun 2005 14:54:44 +0000 (14:54 +0000)
ext/pdo_pgsql/pgsql_driver.c

index 9137d193a8877660474896465848abdb306b4cb7..0e17aaf7a773fb7a135aaf3eefcc88a716f47def 100644 (file)
@@ -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);