aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/odbc/results.c
diff options
context:
space:
mode:
authorHiroshi Inoue <inoue@tpf.co.jp>2002-03-11 10:25:57 +0000
committerHiroshi Inoue <inoue@tpf.co.jp>2002-03-11 10:25:57 +0000
commitdadb718b103d6675399547d3f6c12d0726f9537e (patch)
tree52a79b9c8affb5d5c4b7591516d470367483f60a /src/interfaces/odbc/results.c
parentd0d3ab532509c11c6f21ce189ad1ba44437baa62 (diff)
downloadpostgresql-dadb718b103d6675399547d3f6c12d0726f9537e.tar.gz
postgresql-dadb718b103d6675399547d3f6c12d0726f9537e.zip
Bug fixes for the 2002-03-08 change.
1) Put back the error message for SQLError(). 2) Change Disallow premature to handle the SELECTed result. 3) Put back the behavior of AUTUCOMMIT mode change. 4) Fix SQLColumns for ODBC3.0. 5) Improve the handling of variable bookmark in ODBC3.0. 6) Enable Recognize Unique Index Button.
Diffstat (limited to 'src/interfaces/odbc/results.c')
-rw-r--r--src/interfaces/odbc/results.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/src/interfaces/odbc/results.c b/src/interfaces/odbc/results.c
index e43c0e3db45..13f223b7205 100644
--- a/src/interfaces/odbc/results.c
+++ b/src/interfaces/odbc/results.c
@@ -189,6 +189,7 @@ PGAPI_DescribeCol(
/* gets all the information about a specific column */
StatementClass *stmt = (StatementClass *) hstmt;
+ ConnectionClass *conn;
QResultClass *res;
char *col_name = NULL;
Int4 fieldtype = 0;
@@ -200,7 +201,7 @@ PGAPI_DescribeCol(
int len = 0;
RETCODE result;
- mylog("%s: entering...\n", func);
+ mylog("%s: entering.%d..\n", func, icol);
if (!stmt)
{
@@ -208,14 +209,16 @@ PGAPI_DescribeCol(
return SQL_INVALID_HANDLE;
}
- ci = &(SC_get_conn(stmt)->connInfo);
+ conn = SC_get_conn(stmt);
+ ci = &(conn->connInfo);
SC_clear_error(stmt);
#if (ODBCVER >= 0x0300)
if (0 == icol) /* bookmark column */
{
- SQLSMALLINT fType = SQL_INTEGER;
+ SQLSMALLINT fType = stmt->options.use_bookmarks == SQL_UB_VARIABLE ? SQL_BINARY : SQL_INTEGER;
+
if (szColName && cbColNameMax > 0)
*szColName = '\0';
if (pcbColName)
@@ -440,7 +443,7 @@ PGAPI_ColAttributes(
break;
case SQL_DESC_TYPE:
if (pfDesc)
- *pfDesc = SQL_INTEGER;
+ *pfDesc = stmt->options.use_bookmarks == SQL_UB_VARIABLE ? SQL_BINARY : SQL_INTEGER;
break;
}
return SQL_SUCCESS;
@@ -813,12 +816,19 @@ PGAPI_GetData(
}
/* Make sure it is the bookmark data type */
- if (fCType != SQL_C_BOOKMARK)
+ switch (fCType)
{
- stmt->errormsg = "Column 0 is not of type SQL_C_BOOKMARK";
- stmt->errornumber = STMT_PROGRAM_TYPE_OUT_OF_RANGE;
- SC_log_error(func, "", stmt);
- return SQL_ERROR;
+ case SQL_C_BOOKMARK:
+#if (ODBCVER >= 0x0300)
+ case SQL_C_VARBOOKMARK:
+#endif /* ODBCVER */
+ break;
+ default:
+ stmt->errormsg = "Column 0 is not of type SQL_C_BOOKMARK";
+inolog("Column 0 is type %d not of type SQL_C_BOOKMARK", fCType);
+ stmt->errornumber = STMT_PROGRAM_TYPE_OUT_OF_RANGE;
+ SC_log_error(func, "", stmt);
+ return SQL_ERROR;
}
get_bookmark = TRUE;