aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/odbc/statement.c
diff options
context:
space:
mode:
authorHiroshi Inoue <inoue@tpf.co.jp>2001-06-22 05:59:43 +0000
committerHiroshi Inoue <inoue@tpf.co.jp>2001-06-22 05:59:43 +0000
commita8dbe428de8f8c11a047c441c9f1b5b5433b0115 (patch)
tree6940c6aa8c0a5be92a116264a7d5ff67954a80b5 /src/interfaces/odbc/statement.c
parentd8d9ed931e8a2370d3995c40af2eb3bda18aecb0 (diff)
downloadpostgresql-a8dbe428de8f8c11a047c441c9f1b5b5433b0115.tar.gz
postgresql-a8dbe428de8f8c11a047c441c9f1b5b5433b0115.zip
Change SQLPrimaryKeys() so that it detects the primary key
other than tablename_pkey.
Diffstat (limited to 'src/interfaces/odbc/statement.c')
-rw-r--r--src/interfaces/odbc/statement.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/interfaces/odbc/statement.c b/src/interfaces/odbc/statement.c
index fd77eee6d6c..473d5709880 100644
--- a/src/interfaces/odbc/statement.c
+++ b/src/interfaces/odbc/statement.c
@@ -153,6 +153,7 @@ SQLFreeStmt(HSTMT hstmt,
SC_log_error(func, "", NULL);
return SQL_INVALID_HANDLE;
}
+ SC_clear_error(stmt);
if (fOption == SQL_DROP)
{
@@ -299,6 +300,7 @@ char
SC_Destructor(StatementClass *self)
{
mylog("SC_Destructor: self=%u, self->result=%u, self->hdbc=%u\n", self, self->result, self->hdbc);
+ SC_clear_error(self);
if (STMT_EXECUTING == self->status)
{
self->errornumber = STMT_SEQUENCE_ERROR;
@@ -438,6 +440,7 @@ SC_recycle_statement(StatementClass *self)
mylog("recycle statement: self= %u\n", self);
+ SC_clear_error(self);
/* This would not happen */
if (self->status == STMT_EXECUTING)
{
@@ -446,10 +449,6 @@ SC_recycle_statement(StatementClass *self)
return FALSE;
}
- self->errormsg = NULL;
- self->errornumber = 0;
- self->errormsg_created = FALSE;
-
switch (self->status)
{
case STMT_ALLOCATED:
@@ -836,7 +835,10 @@ SC_fetch(StatementClass *self)
case COPY_RESULT_TRUNCATED:
self->errornumber = STMT_TRUNCATED;
- self->errormsg = "The buffer was too small for the result.";
+ self->errormsg = "Fetched item was truncated.";
+ qlog("The %dth item was truncated\n", lf + 1);
+ qlog("The buffer size = %d", self->bindings[lf].buflen);
+ qlog(" and the value is '%s'\n", value);
result = SQL_SUCCESS_WITH_INFO;
break;