Fix SQLRowCount [Anoop Kumar]
authorDave Page <dpage@pgadmin.org>
Fri, 12 Aug 2005 09:47:55 +0000 (09:47 +0000)
committerDave Page <dpage@pgadmin.org>
Fri, 12 Aug 2005 09:47:55 +0000 (09:47 +0000)
connection.c
results.c

index 8712a207cfe05e353cea8d7b0d91f10b82572a20..d5d1d901dbcd0bf3ef55a86d4e79fe64955fa710 100644 (file)
@@ -3189,7 +3189,11 @@ LIBPQ_execute_query(ConnectionClass *self,char *query)
        trim(cmdbuffer); /* get rid of trailing space */
        ptr = strrchr(cmdbuffer, ' ');
        if (ptr)
-           qres->recent_processed_row_count = atoi(ptr + 1);
+#ifdef USE_LIBPQ\r
+           qres->recent_processed_row_count = atoi(PQcmdTuples(pgres));\r
+#else\r
+           qres->recent_processed_row_count = atoi(ptr + 1);\r
+#endif /* USE_LIBPQ */
        else
            qres->recent_processed_row_count = -1;
    }
index c1920f26e8ce2c88b97131063dfdb973810e82c1..f28deac3ea452eb80d1a5b68836a8605e1d2e41c 100644 (file)
--- a/results.c
+++ b/results.c
@@ -54,14 +54,15 @@ PGAPI_RowCount(
        SC_log_error(func, "", NULL);
        return SQL_INVALID_HANDLE;
    }
-   ci = &(SC_get_conn(stmt)->connInfo);
+   ci = &(SC_get_conn(stmt)->connInfo);\r
+#ifndef USE_LIBPQ
    if (stmt->manual_result)
    {
        if (pcrow)
            *pcrow = -1;
        return SQL_SUCCESS;
    }
-
+#endif /* USE_LIBPQ */
    res = SC_get_Curres(stmt);
    if (res && pcrow)
    {