From: Hiroshi Inoue Date: Sun, 3 Apr 2016 04:57:12 +0000 (+0900) Subject: The third stricmp() in writeDriverCommoninfo() is useless, because the second one... X-Git-Tag: REL-09_05_0200~3 X-Git-Url: http://git.postgresql.org/gitweb/static/%7B%7Bpgdulink%28?a=commitdiff_plain;h=a66f1ed823a00354f5b8bea16beccb4b1ea7a8d8;p=psqlodbc.git The third stricmp() in writeDriverCommoninfo() is useless, because the second one causes the function to return. SC_get_errormsg() definition is repeated twice in succession. In info.c:SQLGetInfo(), "len = 0" is unnecessary because len is assigned at the end of the function. In execute.c:PGAPI_ExecDirect(), flag doesn't need to be set as its value doesn't change. PODBC_PER_STATEMENT_ROLLBACK is not used. [patch by Tsunakawa, Takayuki] --- diff --git a/dlg_specific.c b/dlg_specific.c index 93f7d92..28ebf54 100644 --- a/dlg_specific.c +++ b/dlg_specific.c @@ -1086,15 +1086,6 @@ writeDriverCommoninfo(const char *fileName, const char *sectionName, sprintf(tmp, "%d", comval->unique_index); if (!SQLWritePrivateProfileString(sectionName, INI_UNIQUEINDEX, tmp, fileName)) errc--; - /* - * Never update the onlyread from this module. - */ - if (stricmp(ODBCINST_INI, fileName) == 0) - { - sprintf(tmp, "%d", comval->onlyread); - SQLWritePrivateProfileString(sectionName, INI_READONLY, tmp, - fileName); - } sprintf(tmp, "%d", comval->use_declarefetch); if (!SQLWritePrivateProfileString(sectionName, INI_USEDECLAREFETCH, tmp, fileName)) diff --git a/execute.c b/execute.c index d310ed2..c8a70ad 100644 --- a/execute.c +++ b/execute.c @@ -193,7 +193,6 @@ inolog("a2\n"); mylog("%s: calling PGAPI_Execute...\n", func); - flag = SC_is_with_hold(stmt) ? PODBC_WITH_HOLD : 0; result = PGAPI_Execute(hstmt, flag); mylog("%s: returned %hd from PGAPI_Execute\n", func, result); diff --git a/info.c b/info.c index a73232f..21ff187 100644 --- a/info.c +++ b/info.c @@ -817,14 +817,12 @@ mylog("CONVERT_FUNCTIONS=" FORMAT_ULEN "\n", value); value = SQL_BS_SELECT_EXPLICIT | SQL_BS_ROW_COUNT_EXPLICIT; break; case SQL_CATALOG_NAME: - len = 0; if (CurrCat(conn)) p = "Y"; else p = "N"; break; case SQL_COLLATION_SEQ: - len = 0; p = ""; break; case SQL_CREATE_ASSERTION: @@ -872,7 +870,6 @@ mylog("CONVERT_FUNCTIONS=" FORMAT_ULEN "\n", value); value = SQL_DI_CREATE_INDEX | SQL_DI_DROP_INDEX; break; case SQL_DESCRIBE_PARAMETER: - len = 0; p = "N"; break; case SQL_DROP_ASSERTION: @@ -928,7 +925,6 @@ mylog("CONVERT_FUNCTIONS=" FORMAT_ULEN "\n", value); value = NAMEDATALEN_V73 - 1; break; case SQL_MAX_ROW_SIZE_INCLUDES_LONG: - len = 0; p = "Y"; break; case SQL_PARAM_ARRAY_ROW_COUNTS: diff --git a/pgapifunc.h b/pgapifunc.h index bd38e95..82b7613 100644 --- a/pgapifunc.h +++ b/pgapifunc.h @@ -22,7 +22,6 @@ extern "C" { #define PODBC_INHERIT_CONNECT_OPTIONS (1L << 1) /* Internal flags for PGAPI_Exec... functions */ #define PODBC_WITH_HOLD 1L -#define PODBC_PER_STATEMENT_ROLLBACK (1L << 1) /* Flags for the error handling */ #define PODBC_ALLOW_PARTIAL_EXTRACT 1L #define PODBC_ERROR_CLEAR (1L << 1) diff --git a/statement.h b/statement.h index 09dc0e6..24d6335 100644 --- a/statement.h +++ b/statement.h @@ -325,7 +325,6 @@ void SC_set_Result(StatementClass *self, QResultClass *res); #define SC_get_errornumber(a) (a->__error_number) #define SC_set_errornumber(a, n) (a->__error_number = n) #define SC_get_errormsg(a) (a->__error_message) -#define SC_get_errormsg(a) (a->__error_message) #define SC_is_prepare_statement(a) (0 != (a->prepare & PREPARE_STATEMENT)) #define SC_get_prepare_method(a) (a->prepare & (~PREPARE_STATEMENT))