From e7be9779ba98b14d4c694acf87c83122780cfa67 Mon Sep 17 00:00:00 2001 From: Hiroshi Inoue Date: Sun, 28 Oct 2018 12:45:56 +0900 Subject: [PATCH] Add an alias DX of *Database* keyword for connection strings to aviod the use of "database" keyword which has a special meaning in some apps or middlewares.. --- dlg_specific.c | 6 ++++-- dlg_specific.h | 1 + info.c | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dlg_specific.c b/dlg_specific.c index bbff91f..8c5d895 100644 --- a/dlg_specific.c +++ b/dlg_specific.c @@ -292,6 +292,8 @@ makeConnectString(char *connect_string, const ConnInfo *ci, UWORD len) BOOL abbrev = (len < 1024) || 0 < ci->force_abbrev_connstr; UInt4 flag; +mylog("%s row_versioning=%s\n", __FUNCTION__, ci->row_versioning); + MYLOG(DETAIL_LOG_LEVEL, "force_abbrev=%d abbrev=%d\n", ci->force_abbrev_connstr, abbrev); encode(ci->password, encoded_item, sizeof(encoded_item)); /* fundamental info */ @@ -587,7 +589,7 @@ copyConnAttributes(ConnInfo *ci, const char *attribute, const char *value) STRCPY_FIXED(ci->drivername, value); else if (stricmp(attribute, INI_KDESC) == 0) STRCPY_FIXED(ci->desc, value); - else if (stricmp(attribute, INI_DATABASE) == 0) + else if (stricmp(attribute, INI_DATABASE) == 0 || stricmp(attribute, ABBR_DATABASE) == 0) STRCPY_FIXED(ci->database, value); else if (stricmp(attribute, INI_SERVER) == 0 || stricmp(attribute, SPEC_SERVER) == 0) STRCPY_FIXED(ci->server, value); @@ -1184,7 +1186,7 @@ writeDSNinfo(const ConnInfo *ci) ODBC_INI); SQLWritePrivateProfileString(DSN, - INI_DATABASE, + ABBR_DATABASE, ci->database, ODBC_INI); diff --git a/dlg_specific.h b/dlg_specific.h index 993b89f..9f779d9 100644 --- a/dlg_specific.h +++ b/dlg_specific.h @@ -51,6 +51,7 @@ extern "C" { #define INI_PORT "Port" /* Port on which the * Postmaster is listening */ #define INI_DATABASE "Database" /* Database Name */ +#define ABBR_DATABASE "DX" /* Database Name */ #define INI_UID "UID" /* Default User Name */ #define INI_USERNAME "Username" /* Default User Name */ #define INI_PASSWORD "Password" /* Default Password */ diff --git a/info.c b/info.c index e5ff2b5..84b0f2a 100644 --- a/info.c +++ b/info.c @@ -2275,7 +2275,7 @@ PGAPI_Columns(HSTMT hstmt, BOOL setIdentity = FALSE; int table_info = 0; - MYLOG(0, "entering...stmt=%p scnm=%p len=%d\n", stmt, szTableOwner, cbTableOwner); + MYLOG(0, "entering...stmt=%p scnm=%p len=%d columnOpt=%x\n", stmt, szTableOwner, cbTableOwner, flag); if (result = SC_initialize_and_recycle(stmt), SQL_SUCCESS != result) return result; -- 2.39.5