change to error result in SQLStatistics

From: "Scot Loach" <sloach(at)sandvine(dot)com>
To: <pgsql-odbc(at)postgresql(dot)org>
Subject: change to error result in SQLStatistics
Date: 2004-10-05 03:19:05
Message-ID: A8535F8D62F3644997E91F4F66E341FC1BB32A@exchange.sandvine.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

info.c version 1.106 changes the semantics of PGAPI_Statistics. If a table name is passed in and the table does not exist, the function previously returned SQL_ERROR, it now returns SQL_SUCCESS.

The diff & comments from this checkin are pasted at the bottom of this message. The comments don't seem to indicate that this result of the change was intentional. However I'm not exactly sure what the correct behavior is according to the spec.

Suggestions? Leave it as is or return it to its previous behavior?

scot.

@@ -2624,24 +2638,26 @@ PGAPI_Statistics(
result = PGAPI_Fetch(hcol_stmt);
}

- if (result != SQL_NO_DATA_FOUND || total_columns == 0)
+ PGAPI_FreeStmt(hcol_stmt, SQL_DROP);
+ hcol_stmt = NULL;
+ if (result != SQL_NO_DATA_FOUND)
{
- SC_full_error_copy(stmt, col_stmt); /* "Couldn't get column
- * names in
- * SQLStatistics."; */
- PGAPI_FreeStmt(hcol_stmt, SQL_DROP);
- goto SEEYA;
-
+ SC_full_error_copy(stmt, col_stmt);
+ goto cleanup;
+ }
+ if (total_columns == 0)
+ {
+ /* Couldn't get column names in SQLStatistics.; */
+ ret = SQL_SUCCESS;
+ goto cleanup;
}
-
- PGAPI_FreeStmt(hcol_stmt, SQL_DROP);

/* get a list of indexes on this table */
result = PGAPI_AllocStmt(stmt->hdbc, &hindx_stmt);
if ((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO))
{
SC_set_error(stmt, STMT_NO_MEMORY_ERROR, "PGAPI_AllocStmt failed in SQLStatistics for indices.");
- goto SEEYA;
+ goto cleanup;

}
indx_stmt = (StatementClass *) hindx_stmt;

1) Correct the handling of SQL_C_ULONG (for *nix).
2) Prevent plan deallocation errors when the transaction
is in abort status.
3) Avoid a connection failure when notice message arrives.
4) Improve the handling of mutex(critical section).
5) Correct the cursor open check.
6) Change the Unicode driver to set the NULL terminator
of SQL_C_WCHAR type data properly.
7) Add some m(re)alloc error check.
8) Add proper cleanup steps for some functions.
9) Return proper min & max scale for timestamp data type.
10) Return proper scale for timestamp data fields.
11) Fix the bug that .009 numeric generates .9 output. (George A.J)

Browse pgsql-odbc by date

  From Date Subject
Next Message Philippe Lang 2004-10-05 06:45:10 Re: Executing SP in VB6
Previous Message Iain 2004-10-05 02:07:14 Re: Executing SP in VB6