Fixed the SQLExecDirec bug which returned SQL_SUCCESS instead of SQL_NO_DATA when...
authorAnoop Kumar <anoopk@pervasive-postgres.com>
Wed, 24 Aug 2005 06:09:52 +0000 (06:09 +0000)
committerAnoop Kumar <anoopk@pervasive-postgres.com>
Wed, 24 Aug 2005 06:09:52 +0000 (06:09 +0000)
execute.c

index 93539e78840a29cc7ea52f640e58fed8482cc4b5..9960413d0f95d5e84d5f0e5f9bb0d3488bb4396a 100644 (file)
--- a/execute.c
+++ b/execute.c
@@ -358,6 +358,15 @@ RETCODE    Exec_with_parameters_resolved(StatementClass *stmt, BOOL *exec_end)
    {
 
            EnvironmentClass *env = (EnvironmentClass *) (conn->henv);
+#ifdef USE_LIBPQ
+       if (!res->recent_processed_row_count && res->status == PGRES_COMMAND_OK && EN_is_odbc3(env))
+       {
+           if ((strnicmp(stmt->statement, "UPDATE", 6) == 0) || 
+               (strnicmp(stmt->statement, "DELETE", 6) == 0))
+               retval = SQL_NO_DATA_FOUND;
+       }
+
+#else
        const char *cmd = QR_get_command(res);
 
        if (retval == SQL_SUCCESS && cmd && EN_is_odbc3(env))
@@ -373,6 +382,7 @@ RETCODE Exec_with_parameters_resolved(StatementClass *stmt, BOOL *exec_end)
            if (0 == count)
                retval = SQL_NO_DATA;
        }
+#endif  /* USE_LIBPQ */
 
        stmt->diag_row_count = res->recent_processed_row_count;
    }