diff options
author | Hiroshi Inoue | 2002-04-10 08:18:54 +0000 |
---|---|---|
committer | Hiroshi Inoue | 2002-04-10 08:18:54 +0000 |
commit | 73991c2f9fbfa4a7ae323c23cd99d3488f3251ce (patch) | |
tree | daffaf6ef8499429bf3bac9015fd4b2ea7aa9eaf | |
parent | 968281d80fb88719ea916f6d79c3991f79be5336 (diff) |
Prevent an infinite loop of error reporting.
-rw-r--r-- | src/interfaces/odbc/connection.c | 5 | ||||
-rw-r--r-- | src/interfaces/odbc/descriptor.h | 2 | ||||
-rw-r--r-- | src/interfaces/odbc/info.c | 13 | ||||
-rw-r--r-- | src/interfaces/odbc/psqlodbc.h | 1 | ||||
-rw-r--r-- | src/interfaces/odbc/statement.c | 1 |
5 files changed, 19 insertions, 3 deletions
diff --git a/src/interfaces/odbc/connection.c b/src/interfaces/odbc/connection.c index 7cee671e2b..b0dd575fb9 100644 --- a/src/interfaces/odbc/connection.c +++ b/src/interfaces/odbc/connection.c @@ -610,7 +610,7 @@ CC_connect(ConnectionClass *self, char do_password) int areq = -1; int beresp; static char msgbuffer[ERROR_MSG_LENGTH]; - char salt[5]; + char salt[5], notice[512]; static char *func = "CC_connect"; #ifdef MULTIBYTE @@ -893,6 +893,9 @@ another_version_retry: case 'Z': /* Backend is ready for new query (6.4) */ ReadyForQuery = TRUE; break; + case 'N': /* Notices may come */ + while (SOCK_get_string(sock, notice, sizeof(notice) - 1)) ; + break; default: self->errormsg = "Unexpected protocol character during authentication"; self->errornumber = CONN_INVALID_AUTHENTICATION; diff --git a/src/interfaces/odbc/descriptor.h b/src/interfaces/odbc/descriptor.h index 05e8175fd5..79231ab948 100644 --- a/src/interfaces/odbc/descriptor.h +++ b/src/interfaces/odbc/descriptor.h @@ -17,7 +17,7 @@ typedef struct { COL_INFO *col_info; /* cached SQLColumns info for this table */ - char schema[MAX_TABLE_LEN + 1]; + char schema[MAX_SCHEMA_LEN + 1]; char name[MAX_TABLE_LEN + 1]; char alias[MAX_TABLE_LEN + 1]; } TABLE_INFO; diff --git a/src/interfaces/odbc/info.c b/src/interfaces/odbc/info.c index 2dce375f78..07f4237284 100644 --- a/src/interfaces/odbc/info.c +++ b/src/interfaces/odbc/info.c @@ -342,6 +342,8 @@ PGAPI_GetInfo( case SQL_MAX_OWNER_NAME_LEN: /* ODBC 1.0 */ len = 2; value = 0; + if (conn->schema_support) + value = MAX_SCHEMA_LEN; break; case SQL_MAX_PROCEDURE_NAME_LEN: /* ODBC 1.0 */ @@ -484,12 +486,21 @@ PGAPI_GetInfo( break; case SQL_OWNER_TERM: /* ODBC 1.0 */ - p = "owner"; + if (conn->schema_support) + p = "schema"; + else + p = "owner"; break; case SQL_OWNER_USAGE: /* ODBC 2.0 */ len = 4; value = 0; + if (conn->schema_support) + value = SQL_OU_DML_STATEMENTS + | SQL_OU_TABLE_DEFINITION + | SQL_OU_INDEX_DEFINITION + | SQL_OU_PRIVILEGE_DEFINITION + ; break; case SQL_POS_OPERATIONS: /* ODBC 2.0 */ diff --git a/src/interfaces/odbc/psqlodbc.h b/src/interfaces/odbc/psqlodbc.h index 9f83a2801e..ad16a14849 100644 --- a/src/interfaces/odbc/psqlodbc.h +++ b/src/interfaces/odbc/psqlodbc.h @@ -124,6 +124,7 @@ typedef UInt4 Oid; #define BYTELEN 8 #define VARHDRSZ sizeof(Int4) +#define MAX_SCHEMA_LEN 32 #define MAX_TABLE_LEN 32 #define MAX_COLUMN_LEN 32 #define MAX_CURSOR_LEN 32 diff --git a/src/interfaces/odbc/statement.c b/src/interfaces/odbc/statement.c index 6bdac48087..cf3db03ead 100644 --- a/src/interfaces/odbc/statement.c +++ b/src/interfaces/odbc/statement.c @@ -301,6 +301,7 @@ SC_Constructor(void) rv->inaccurate_result = FALSE; rv->miscinfo = 0; rv->updatable = FALSE; + rv->error_recsize = -1; } return rv; } |