diff options
Diffstat (limited to 'src/interfaces/odbc/environ.c')
| -rw-r--r-- | src/interfaces/odbc/environ.c | 64 |
1 files changed, 37 insertions, 27 deletions
diff --git a/src/interfaces/odbc/environ.c b/src/interfaces/odbc/environ.c index b7d808476fe..3ca80810be0 100644 --- a/src/interfaces/odbc/environ.c +++ b/src/interfaces/odbc/environ.c @@ -1,17 +1,17 @@ -
-/* Module: environ.c
- *
- * Description: This module contains routines related to
- * the environment, such as storing connection handles,
- * and returning errors.
- *
- * Classes: EnvironmentClass (Functions prefix: "EN_")
- *
- * API functions: SQLAllocEnv, SQLFreeEnv, SQLError
- *
- * Comments: See "notice.txt" for copyright and license information.
- *
- */
+ +/* Module: environ.c + * + * Description: This module contains routines related to + * the environment, such as storing connection handles, + * and returning errors. + * + * Classes: EnvironmentClass (Functions prefix: "EN_") + * + * API functions: SQLAllocEnv, SQLFreeEnv, SQLError + * + * Comments: See "notice.txt" for copyright and license information. + * + */ #include "environ.h" #include "connection.h" @@ -113,6 +113,10 @@ int status; strcpy(szSqlState, "08S01"); // communication link failure break; + case STMT_CREATE_TABLE_ERROR: + strcpy(szSqlState, "S0001"); + // table already exists + break; case STMT_STATUS_ERROR: case STMT_SEQUENCE_ERROR: strcpy(szSqlState, "S1010"); @@ -159,6 +163,12 @@ int status; case STMT_OPTION_VALUE_CHANGED: strcpy(szSqlState, "01S02"); break; + case STMT_INVALID_CURSOR_NAME: + strcpy(szSqlState, "34000"); + break; + case STMT_NO_CURSOR_NAME: + strcpy(szSqlState, "S1015"); + break; default: strcpy(szSqlState, "S1000"); // also a general error @@ -213,10 +223,10 @@ int status; case CONN_OPENDB_ERROR: strcpy(szSqlState, "08001"); // unable to connect to data source - break;
- case CONN_INVALID_AUTHENTICATION:
- case CONN_AUTH_TYPE_UNSUPPORTED:
- strcpy(szSqlState, "28000");
+ break; + case CONN_INVALID_AUTHENTICATION: + case CONN_AUTH_TYPE_UNSUPPORTED: + strcpy(szSqlState, "28000"); break; case CONN_STMT_ALLOC_ERROR: strcpy(szSqlState, "S1001"); @@ -339,7 +349,7 @@ EnvironmentClass *rv; rv->errormsg = 0; rv->errornumber = 0; } -
+ return rv; } @@ -356,7 +366,7 @@ char rv = 1; // the source--they should not be freed /* Free any connections belonging to this environment */ - for (lf = 0; lf < MAX_CONNECTIONS; lf++) {
+ for (lf = 0; lf < MAX_CONNECTIONS; lf++) { if (conns[lf] && conns[lf]->henv == self) rv = rv && CC_Destructor(conns[lf]); } @@ -383,16 +393,16 @@ char EN_add_connection(EnvironmentClass *self, ConnectionClass *conn) { int i; -
-mylog("EN_add_connection: self = %u, conn = %u\n", self, conn);
+ +mylog("EN_add_connection: self = %u, conn = %u\n", self, conn); for (i = 0; i < MAX_CONNECTIONS; i++) { - if ( ! conns[i]) {
+ if ( ! conns[i]) { conn->henv = self; - conns[i] = conn;
-
- mylog(" added at i =%d, conn->henv = %u, conns[i]->henv = %u\n",
- i, conn->henv, conns[i]->henv);
+ conns[i] = conn; + + mylog(" added at i =%d, conn->henv = %u, conns[i]->henv = %u\n", + i, conn->henv, conns[i]->henv); return TRUE; } |
