Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions dlg_specific.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,16 +301,22 @@ makeConnectString(char *connect_string, const ConnInfo *ci, UWORD len)
char xaOptStr[16];
#endif
ssize_t hlen, nlen, olen;
/*BOOL abbrev = (len <= 400);*/
BOOL abbrev = (len < 1024) || 0 < ci->force_abbrev_connstr;
BOOL abbrev;
UInt4 flag;

if (len > MAX_CONNECT_STRING) {
len = MAX_CONNECT_STRING;
}

/*abbrev = (len <= 400);*/
abbrev = (len < 1024) || 0 < ci->force_abbrev_connstr;

MYLOG(0, "%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 */
nlen = MAX_CONNECT_STRING;
nlen = len;
olen = snprintf(connect_string, nlen, "%s=%s;DATABASE=%s;SERVER=%s;PORT=%s;UID=%s;PWD=%s",
got_dsn ? "DSN" : "DRIVER",
got_dsn ? ci->dsn : ci->drivername,
Expand All @@ -327,7 +333,7 @@ MYLOG(DETAIL_LOG_LEVEL, "force_abbrev=%d abbrev=%d\n", ci->force_abbrev_connstr,

/* extra info */
hlen = strlen(connect_string);
nlen = MAX_CONNECT_STRING - hlen;
nlen = len - hlen;
MYLOG(DETAIL_LOG_LEVEL, "hlen=" FORMAT_SSIZE_T "\n", hlen);
if (!abbrev)
{
Expand Down Expand Up @@ -474,7 +480,7 @@ MYLOG(DETAIL_LOG_LEVEL, "hlen=" FORMAT_SSIZE_T "\n", hlen);
ABBR_SSLMODE "=%s", abbrev_sslmode(ci->sslmode, abbrevmode, sizeof(abbrevmode)));
}
hlen = strlen(connect_string);
nlen = MAX_CONNECT_STRING - hlen;
nlen = len - hlen;
olen = snprintf(&connect_string[hlen], nlen, ";"
"%s" /* ABBR_CONNSETTINGS */
ABBR_FETCH "=%d;"
Expand Down Expand Up @@ -505,7 +511,7 @@ MYLOG(DETAIL_LOG_LEVEL, "hlen=" FORMAT_SSIZE_T "\n", hlen);
if (olen < nlen || ci->rollback_on_error >= 0)
{
hlen = strlen(connect_string);
nlen = MAX_CONNECT_STRING - hlen;
nlen = len - hlen;
/*
* The PROTOCOL setting must be placed after CX flag
* so that this option can override the CX setting.
Expand All @@ -525,7 +531,7 @@ MYLOG(DETAIL_LOG_LEVEL, "hlen=" FORMAT_SSIZE_T "\n", hlen);
if (0 != flag)
{
hlen = strlen(connect_string);
nlen = MAX_CONNECT_STRING - hlen;
nlen = len - hlen;
olen = snprintf(&connect_string[hlen], nlen, ";"
INI_EXTRAOPTIONS "=%x;",
flag);
Expand Down