diff options
| author | Hiroshi Inoue <inoue@tpf.co.jp> | 2002-03-08 08:52:55 +0000 |
|---|---|---|
| committer | Hiroshi Inoue <inoue@tpf.co.jp> | 2002-03-08 08:52:55 +0000 |
| commit | 4b47467a6b0d86162dd8814b8ab923aba982fb34 (patch) | |
| tree | 85fea3bf0475716f35d440468eda620769081bac /src/interfaces/odbc/options.c | |
| parent | 21f8aa396fa833ac95cff4e85c5281fd24fd1632 (diff) | |
| download | postgresql-4b47467a6b0d86162dd8814b8ab923aba982fb34.tar.gz | |
1) Implement SQLParamOptions().
2) Handle Multiple results and implement SQLMoreResult().
3) Improve multibyte handling thanks to Eiji Tokuya.
4) Add new options.
LF <-> CR/LF converion.
TRUE is -1 (for VB).
5) Introduce unicode(UCS-2) support.
6) Reduce the length of connection strings.
7) Improve SQLError, SQLGetDiagRec(ODBC 3.0).
8) Implement SQLTablePrivileges().
9) Miscellaneous changes for ODBC 3.0 support.
Diffstat (limited to 'src/interfaces/odbc/options.c')
| -rw-r--r-- | src/interfaces/odbc/options.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/src/interfaces/odbc/options.c b/src/interfaces/odbc/options.c index 80ec7dac68..d58f84916f 100644 --- a/src/interfaces/odbc/options.c +++ b/src/interfaces/odbc/options.c @@ -342,12 +342,13 @@ PGAPI_SetConnectOption( break; case SQL_AUTOCOMMIT: - if (vParam == SQL_AUTOCOMMIT_ON && CC_is_in_autocommit(conn)) + if (vParam == SQL_AUTOCOMMIT_ON && CC_is_in_trans(conn)) break; - else if (vParam == SQL_AUTOCOMMIT_OFF && !CC_is_in_autocommit(conn)) + else if (vParam == SQL_AUTOCOMMIT_OFF && !CC_is_in_trans(conn)) break; if (CC_is_in_trans(conn)) CC_commit(conn); + mylog("PGAPI_SetConnectOption: AUTOCOMMIT: transact_status=%d, vparam=%d\n", conn->transact_status, vParam); switch (vParam) @@ -401,8 +402,21 @@ PGAPI_SetConnectOption( sprintf(option, "fOption=%d, vParam=%ld", fOption, vParam); if (fOption == 30002 && vParam) { - if (strcmp((char *) vParam, "Microsoft Jet") == 0) + int cmp; +#ifdef UNICODE_SUPPORT + char *asPara; + if (conn->unicode) + { + asPara = ucs2_to_utf8((SQLWCHAR *) vParam, -1, NULL); + cmp = strcmp(asPara, "Microsoft Jet"); + free(asPara); + } + else +#endif /* UNICODE_SUPPORT */ + cmp = strncmp((char *) vParam, "Microsoft Jet", 13); + if (0 == cmp) { + mylog("Microsoft Jet !!!!\n"); conn->errornumber = 0; conn->ms_jet = 1; return SQL_SUCCESS; @@ -456,7 +470,7 @@ PGAPI_GetConnectOption( case SQL_CURRENT_QUALIFIER: /* don't use qualifiers */ if (pvParam) - strcpy(pvParam, ""); + ((char *) pvParam)[0] = ((char *) pvParam)[1] = '\0'; break; @@ -557,7 +571,7 @@ PGAPI_GetStmtOption( case SQL_GET_BOOKMARK: case SQL_ROW_NUMBER: - res = stmt->result; + res = SC_get_Curres(stmt); if (stmt->manual_result || !ci->drivers.use_declarefetch) { |
