Commit 51b55730 authored by Bruce Momjian's avatar Bruce Momjian

Fix for ODBC compile warnings.

parent 918feb61
...@@ -340,7 +340,7 @@ PGAPI_ParamOptions( ...@@ -340,7 +340,7 @@ PGAPI_ParamOptions(
mylog("%s: entering... %d %x\n", func, crow, pirow); mylog("%s: entering... %d %x\n", func, crow, pirow);
stmt->options.paramset_size = crow; stmt->options.paramset_size = crow;
stmt->options.param_processed_ptr = pirow; stmt->options.param_processed_ptr = (SQLUINTEGER *)pirow;
return SQL_SUCCESS; return SQL_SUCCESS;
} }
......
...@@ -1130,8 +1130,7 @@ CC_get_error(ConnectionClass *self, int *number, char **message) ...@@ -1130,8 +1130,7 @@ CC_get_error(ConnectionClass *self, int *number, char **message)
QResultClass * QResultClass *
CC_send_query(ConnectionClass *self, char *query, QueryInfo *qi, UDWORD flag) CC_send_query(ConnectionClass *self, char *query, QueryInfo *qi, UDWORD flag)
{ {
QResultClass *result_in = NULL, QResultClass *cmdres = NULL,
*cmdres = NULL,
*retres = NULL, *retres = NULL,
*res = NULL; *res = NULL;
BOOL clear_result_on_abort = ((flag & CLEAR_RESULT_ON_ABORT) != 0), BOOL clear_result_on_abort = ((flag & CLEAR_RESULT_ON_ABORT) != 0),
......
...@@ -107,7 +107,7 @@ char *mapFuncs[][2] = { ...@@ -107,7 +107,7 @@ char *mapFuncs[][2] = {
{"DAYNAME", "to_char($1, 'Day')" }, {"DAYNAME", "to_char($1, 'Day')" },
{"DAYOFMONTH", "cast(extract(day from $1) as integer)" }, {"DAYOFMONTH", "cast(extract(day from $1) as integer)" },
{"DAYOFWEEK", "(cast(extract(dow from $1) as integer) + 1)" }, {"DAYOFWEEK", "(cast(extract(dow from $1) as integer) + 1)" },
{"DAYOFYEAR", "cast(extract(doy from $1) as integer)" }, {"DAYOFYEAR", "cast(extract(doy from $1) as integer)" },
{"HOUR", "cast(extract(hour from $1) as integer)" }, {"HOUR", "cast(extract(hour from $1) as integer)" },
{"MINUTE", "cast(extract(minute from $1) as integer)" }, {"MINUTE", "cast(extract(minute from $1) as integer)" },
{"MONTH", "cast(extract(month from $1) as integer)" }, {"MONTH", "cast(extract(month from $1) as integer)" },
...@@ -161,7 +161,9 @@ timestamp2stime(const char *str, SIMPLE_TIME *st, BOOL *bZone, int *zone) ...@@ -161,7 +161,9 @@ timestamp2stime(const char *str, SIMPLE_TIME *st, BOOL *bZone, int *zone)
*ptr; *ptr;
int scnt, int scnt,
i; i;
#if defined(WIN32) || defined(HAVE_INT_TIMEZONE)
long timediff; long timediff;
#endif
BOOL withZone = *bZone; BOOL withZone = *bZone;
*bZone = FALSE; *bZone = FALSE;
...@@ -402,7 +404,7 @@ copy_and_convert_field(StatementClass *stmt, Int4 field_type, void *value, Int2 ...@@ -402,7 +404,7 @@ copy_and_convert_field(StatementClass *stmt, Int4 field_type, void *value, Int2
else else
{ {
stmt->errornumber = STMT_RETURN_NULL_WITHOUT_INDICATOR; stmt->errornumber = STMT_RETURN_NULL_WITHOUT_INDICATOR;
stmt->errormsg = "StrLen_or_IndPtr was a null pointer and NULL data was retrieved"; stmt->errormsg = "StrLen_or_IndPtr was a null pointer and NULL data was retrieved";
SC_log_error(func, "", stmt); SC_log_error(func, "", stmt);
return SQL_ERROR; return SQL_ERROR;
} }
...@@ -757,7 +759,7 @@ copy_and_convert_field(StatementClass *stmt, Int4 field_type, void *value, Int2 ...@@ -757,7 +759,7 @@ copy_and_convert_field(StatementClass *stmt, Int4 field_type, void *value, Int2
if (cbValueMax < 2 * (SDWORD) ucount) if (cbValueMax < 2 * (SDWORD) ucount)
result = COPY_RESULT_TRUNCATED; result = COPY_RESULT_TRUNCATED;
len = ucount * 2; len = ucount * 2;
free(str); free(str);
} }
else else
{ {
...@@ -1431,7 +1433,8 @@ copy_statement_with_parameters(StatementClass *stmt) ...@@ -1431,7 +1433,8 @@ copy_statement_with_parameters(StatementClass *stmt)
*/ */
else if (oldchar == '{') else if (oldchar == '{')
{ {
char *begin = &old_statement[opos], *end; char *begin = &old_statement[opos];
const char *end;
/* procedure calls */ /* procedure calls */
if (stmt->statement_type == STMT_TYPE_PROCCALL) if (stmt->statement_type == STMT_TYPE_PROCCALL)
...@@ -1463,8 +1466,8 @@ copy_statement_with_parameters(StatementClass *stmt) ...@@ -1463,8 +1466,8 @@ copy_statement_with_parameters(StatementClass *stmt)
proc_no_param = FALSE; proc_no_param = FALSE;
continue; continue;
} }
if (convert_escape(begin, stmt, &npos, &new_stsize, &end if (convert_escape(begin, stmt, &npos, &new_stsize, &end) !=
) != CONVERT_ESCAPE_OK) CONVERT_ESCAPE_OK)
{ {
stmt->errormsg = "ODBC escape convert error"; stmt->errormsg = "ODBC escape convert error";
stmt->errornumber = STMT_EXEC_ERROR; stmt->errornumber = STMT_EXEC_ERROR;
...@@ -1604,7 +1607,7 @@ copy_statement_with_parameters(StatementClass *stmt) ...@@ -1604,7 +1607,7 @@ copy_statement_with_parameters(StatementClass *stmt)
buffer += (bind_size * current_row); buffer += (bind_size * current_row);
else if (ctypelen = ctype_length(stmt->parameters[param_number].CType), ctypelen > 0) else if (ctypelen = ctype_length(stmt->parameters[param_number].CType), ctypelen > 0)
buffer += current_row * ctypelen; buffer += current_row * ctypelen;
else else
buffer += current_row * stmt->parameters[param_number].buflen; buffer += current_row * stmt->parameters[param_number].buflen;
} }
if (stmt->parameters[param_number].used) if (stmt->parameters[param_number].used)
...@@ -2080,7 +2083,7 @@ mapFunction(const char *func, int param_count) ...@@ -2080,7 +2083,7 @@ mapFunction(const char *func, int param_count)
if (mapFuncs[i][0][0] == '%') if (mapFuncs[i][0][0] == '%')
{ {
if (mapFuncs[i][0][1] - '0' == param_count && if (mapFuncs[i][0][1] - '0' == param_count &&
!stricmp(mapFuncs[i][0] + 2, func)) !stricmp(mapFuncs[i][0] + 2, func))
return mapFuncs[i][1]; return mapFuncs[i][1];
} }
else if (!stricmp(mapFuncs[i][0], func)) else if (!stricmp(mapFuncs[i][0], func))
...@@ -2098,7 +2101,7 @@ static int processParameters(const ConnectionClass *conn, const char *value, cha ...@@ -2098,7 +2101,7 @@ static int processParameters(const ConnectionClass *conn, const char *value, cha
* inner_convert_escape() * inner_convert_escape()
* work with embedded escapes sequences * work with embedded escapes sequences
*/ */
static static
int inner_convert_escape(const ConnectionClass *conn, const char *value, int inner_convert_escape(const ConnectionClass *conn, const char *value,
char *result, UInt4 maxLen, const char **input_resume, char *result, UInt4 maxLen, const char **input_resume,
...@@ -2111,7 +2114,7 @@ int inner_convert_escape(const ConnectionClass *conn, const char *value, ...@@ -2111,7 +2114,7 @@ int inner_convert_escape(const ConnectionClass *conn, const char *value,
const char *valptr; const char *valptr;
UInt4 vlen, prtlen, input_consumed, param_consumed, extra_len; UInt4 vlen, prtlen, input_consumed, param_consumed, extra_len;
Int4 param_pos[16][2]; Int4 param_pos[16][2];
valptr = value; valptr = value;
if (*valptr == '{') /* skip the first { */ if (*valptr == '{') /* skip the first { */
valptr++; valptr++;
...@@ -2123,7 +2126,7 @@ int inner_convert_escape(const ConnectionClass *conn, const char *value, ...@@ -2123,7 +2126,7 @@ int inner_convert_escape(const ConnectionClass *conn, const char *value,
valptr++; valptr++;
while ((*valptr != '\0') && isspace((unsigned char) *valptr)) while ((*valptr != '\0') && isspace((unsigned char) *valptr))
valptr++; valptr++;
if (end = my_strchr(conn, valptr, '}'), NULL == end) if (end = my_strchr(conn, valptr, '}'), NULL == end)
{ {
mylog("%s couldn't find the ending }\n",func); mylog("%s couldn't find the ending }\n",func);
...@@ -2135,7 +2138,7 @@ int inner_convert_escape(const ConnectionClass *conn, const char *value, ...@@ -2135,7 +2138,7 @@ int inner_convert_escape(const ConnectionClass *conn, const char *value,
valnts[vlen] = '\0'; valnts[vlen] = '\0';
*input_resume = valptr + vlen; /* resume from the last } */ *input_resume = valptr + vlen; /* resume from the last } */
mylog("%s: key='%s', val='%s'\n", func, key, valnts); mylog("%s: key='%s', val='%s'\n", func, key, valnts);
extra_len = 0; extra_len = 0;
if (isalnum(result[-1])) /* Avoid the concatenation of the function name with the previous word. Aceto */ if (isalnum(result[-1])) /* Avoid the concatenation of the function name with the previous word. Aceto */
{ {
...@@ -2172,7 +2175,7 @@ int inner_convert_escape(const ConnectionClass *conn, const char *value, ...@@ -2172,7 +2175,7 @@ int inner_convert_escape(const ConnectionClass *conn, const char *value,
{ {
/* Literal; return the escape part as-is */ /* Literal; return the escape part as-is */
strncpy(result, valnts, maxLen); strncpy(result, valnts, maxLen);
prtlen = vlen; prtlen = vlen;
} }
else if (strcmp(key, "fn") == 0) else if (strcmp(key, "fn") == 0)
{ {
...@@ -2183,7 +2186,7 @@ int inner_convert_escape(const ConnectionClass *conn, const char *value, ...@@ -2183,7 +2186,7 @@ int inner_convert_escape(const ConnectionClass *conn, const char *value,
char *funcEnd = valnts; char *funcEnd = valnts;
char svchar; char svchar;
const char *mapExpr; const char *mapExpr;
params[sizeof(params)-1] = '\0'; params[sizeof(params)-1] = '\0';
while ((*funcEnd != '\0') && (*funcEnd != '(') && while ((*funcEnd != '\0') && (*funcEnd != '(') &&
...@@ -2197,7 +2200,7 @@ int inner_convert_escape(const ConnectionClass *conn, const char *value, ...@@ -2197,7 +2200,7 @@ int inner_convert_escape(const ConnectionClass *conn, const char *value,
funcEnd++; funcEnd++;
/* /*
* We expect left parenthesis here, else return fn body as-is * We expect left parenthesis here, else return fn body as-is
* since it is one of those "function constants". * since it is one of those "function constants".
*/ */
if (*funcEnd != '(') if (*funcEnd != '(')
...@@ -2213,7 +2216,7 @@ int inner_convert_escape(const ConnectionClass *conn, const char *value, ...@@ -2213,7 +2216,7 @@ int inner_convert_escape(const ConnectionClass *conn, const char *value,
*/ */
valptr += (UInt4)(funcEnd - valnts); valptr += (UInt4)(funcEnd - valnts);
if (subret = processParameters(conn, valptr, params, sizeof(params) - 1, &input_consumed, &param_consumed, param_pos), CONVERT_ESCAPE_OK != subret) if (subret = processParameters(conn, valptr, params, sizeof(params) - 1, &input_consumed, &param_consumed, param_pos), CONVERT_ESCAPE_OK != subret)
return CONVERT_ESCAPE_ERROR; return CONVERT_ESCAPE_ERROR;
for (param_count = 0;; param_count++) for (param_count = 0;; param_count++)
...@@ -2222,9 +2225,9 @@ int inner_convert_escape(const ConnectionClass *conn, const char *value, ...@@ -2222,9 +2225,9 @@ int inner_convert_escape(const ConnectionClass *conn, const char *value,
break; break;
} }
if (param_count == 1 && if (param_count == 1 &&
param_pos[0][1] < param_pos[0][0]) param_pos[0][1] < param_pos[0][0])
param_count = 0; param_count = 0;
mapExpr = mapFunction(key, param_count); mapExpr = mapFunction(key, param_count);
if (mapExpr == NULL) if (mapExpr == NULL)
prtlen = snprintf(result, maxLen, "%s%s", key, params); prtlen = snprintf(result, maxLen, "%s%s", key, params);
...@@ -2256,7 +2259,7 @@ int inner_convert_escape(const ConnectionClass *conn, const char *value, ...@@ -2256,7 +2259,7 @@ int inner_convert_escape(const ConnectionClass *conn, const char *value,
{ {
pidx = *mapptr - '0' - 1; pidx = *mapptr - '0' - 1;
if (pidx < 0 || if (pidx < 0 ||
param_pos[pidx][0] <0) param_pos[pidx][0] <0)
{ {
qlog("%s %dth param not found for the expression %s\n", pidx + 1, mapExpr); qlog("%s %dth param not found for the expression %s\n", pidx + 1, mapExpr);
return CONVERT_ESCAPE_ERROR; return CONVERT_ESCAPE_ERROR;
...@@ -2291,7 +2294,7 @@ int inner_convert_escape(const ConnectionClass *conn, const char *value, ...@@ -2291,7 +2294,7 @@ int inner_convert_escape(const ConnectionClass *conn, const char *value,
/* Bogus key, leave untranslated */ /* Bogus key, leave untranslated */
return CONVERT_ESCAPE_ERROR; return CONVERT_ESCAPE_ERROR;
} }
if (count) if (count)
*count = prtlen + extra_len; *count = prtlen + extra_len;
if (prtlen < 0 || prtlen >= maxLen) /* buffer overflow */ if (prtlen < 0 || prtlen >= maxLen) /* buffer overflow */
...@@ -2301,12 +2304,12 @@ int inner_convert_escape(const ConnectionClass *conn, const char *value, ...@@ -2301,12 +2304,12 @@ int inner_convert_escape(const ConnectionClass *conn, const char *value,
} }
return CONVERT_ESCAPE_OK; return CONVERT_ESCAPE_OK;
} }
/* /*
* processParameters() * processParameters()
* Process function parameters and work with embedded escapes sequences. * Process function parameters and work with embedded escapes sequences.
*/ */
static static
int processParameters(const ConnectionClass *conn, const char *value, int processParameters(const ConnectionClass *conn, const char *value,
char *result, UInt4 maxLen, UInt4 *input_consumed, char *result, UInt4 maxLen, UInt4 *input_consumed,
...@@ -2321,7 +2324,7 @@ int processParameters(const ConnectionClass *conn, const char *value, ...@@ -2321,7 +2324,7 @@ int processParameters(const ConnectionClass *conn, const char *value,
#ifdef MULTIBYTE #ifdef MULTIBYTE
encoded_str encstr; encoded_str encstr;
#endif /* MULTIBYTE */ #endif /* MULTIBYTE */
buf[sizeof(buf)-1] = '\0'; buf[sizeof(buf)-1] = '\0';
innerParenthesis = 0; innerParenthesis = 0;
in_quote = in_dquote = in_escape = leadingSpace = FALSE; in_quote = in_dquote = in_escape = leadingSpace = FALSE;
...@@ -2400,7 +2403,7 @@ int processParameters(const ConnectionClass *conn, const char *value, ...@@ -2400,7 +2403,7 @@ int processParameters(const ConnectionClass *conn, const char *value,
} }
innerParenthesis++; innerParenthesis++;
break; break;
case ')': case ')':
innerParenthesis--; innerParenthesis--;
if (0 == innerParenthesis) if (0 == innerParenthesis)
...@@ -2411,18 +2414,18 @@ int processParameters(const ConnectionClass *conn, const char *value, ...@@ -2411,18 +2414,18 @@ int processParameters(const ConnectionClass *conn, const char *value,
param_pos[param_count][1] = -1; param_pos[param_count][1] = -1;
} }
break; break;
case '}': case '}':
stop = TRUE; stop = TRUE;
break; break;
case '{': case '{':
if (subret = inner_convert_escape(conn, valptr, buf, sizeof(buf) - 1, &valptr, &inner_count), CONVERT_ESCAPE_OK != subret) if (subret = inner_convert_escape(conn, valptr, buf, sizeof(buf) - 1, &valptr, &inner_count), CONVERT_ESCAPE_OK != subret)
return CONVERT_ESCAPE_ERROR; return CONVERT_ESCAPE_ERROR;
if (inner_count + count >= maxLen) if (inner_count + count >= maxLen)
return CONVERT_ESCAPE_OVERFLOW; return CONVERT_ESCAPE_OVERFLOW;
memcpy(&result[count], buf, inner_count); memcpy(&result[count], buf, inner_count);
count += inner_count; count += inner_count;
ipos = (UInt4) (valptr - value); ipos = (UInt4) (valptr - value);
continue; continue;
...@@ -2442,14 +2445,15 @@ int processParameters(const ConnectionClass *conn, const char *value, ...@@ -2442,14 +2445,15 @@ int processParameters(const ConnectionClass *conn, const char *value,
*output_count = count; *output_count = count;
return CONVERT_ESCAPE_OK; return CONVERT_ESCAPE_OK;
} }
/* /*
* convert_escape() * convert_escape()
* This function returns a pointer to static memory! * This function returns a pointer to static memory!
*/ */
int int
convert_escape(const char *value, StatementClass *stmt, int *npos, int *stsize, const char **val_resume) convert_escape(const char *value, StatementClass *stmt, int *npos, int *stsize,
const char **val_resume)
{ {
int ret, pos = *npos; int ret, pos = *npos;
UInt4 count; UInt4 count;
......
...@@ -641,7 +641,7 @@ makeConnectString(char *connect_string, const ConnInfo *ci, UWORD len) ...@@ -641,7 +641,7 @@ makeConnectString(char *connect_string, const ConnInfo *ci, UWORD len)
flag |= BIT_TRUEISMINUS1; flag |= BIT_TRUEISMINUS1;
sprintf(&connect_string[hlen], sprintf(&connect_string[hlen],
";A6=%s;A7=%d;A8=%d;B0=%d;B1=%d;C2=%s;CX=%02x%x", ";A6=%s;A7=%d;A8=%d;B0=%d;B1=%d;C2=%s;CX=%02x%lx",
encoded_conn_settings, encoded_conn_settings,
ci->drivers.fetch_max, ci->drivers.fetch_max,
ci->drivers.socket_buffersize, ci->drivers.socket_buffersize,
...@@ -662,7 +662,7 @@ unfoldCXAttribute(ConnInfo *ci, const char *value) ...@@ -662,7 +662,7 @@ unfoldCXAttribute(ConnInfo *ci, const char *value)
if (strlen(value) < 2) if (strlen(value) < 2)
{ {
count = 3; count = 3;
sscanf(value, "%x", &flag); sscanf(value, "%lx", &flag);
} }
else else
{ {
...@@ -670,7 +670,7 @@ unfoldCXAttribute(ConnInfo *ci, const char *value) ...@@ -670,7 +670,7 @@ unfoldCXAttribute(ConnInfo *ci, const char *value)
memcpy(cnt, value, 2); memcpy(cnt, value, 2);
cnt[2] = '\0'; cnt[2] = '\0';
sscanf(cnt, "%x", &count); sscanf(cnt, "%x", &count);
sscanf(value + 2, "%x", &flag); sscanf(value + 2, "%lx", &flag);
} }
ci->disallow_premature = (char)((flag & BIT_DISALLOWPREMATURE) != 0); ci->disallow_premature = (char)((flag & BIT_DISALLOWPREMATURE) != 0);
ci->updatable_cursors = (char)((flag & BIT_UPDATABLECURSORS) != 0); ci->updatable_cursors = (char)((flag & BIT_UPDATABLECURSORS) != 0);
......
...@@ -94,9 +94,8 @@ PGAPI_StmtError( HSTMT hstmt, ...@@ -94,9 +94,8 @@ PGAPI_StmtError( HSTMT hstmt,
StatementClass *stmt = (StatementClass *) hstmt; StatementClass *stmt = (StatementClass *) hstmt;
char *msg; char *msg;
int status; int status;
BOOL once_again = FALSE, BOOL partial_ok = ((flag & PODBC_ALLOW_PARTIAL_EXTRACT) != 0),
partial_ok = (flag & PODBC_ALLOW_PARTIAL_EXTRACT != 0), clear_str = ((flag & PODBC_ERROR_CLEAR) != 0);
clear_str = (flag & PODBC_ERROR_CLEAR != 0);
SWORD msglen, stapos, wrtlen, pcblen; SWORD msglen, stapos, wrtlen, pcblen;
mylog("**** PGAPI_StmtError: hstmt=%u <%d>\n", hstmt, cbErrorMsgMax); mylog("**** PGAPI_StmtError: hstmt=%u <%d>\n", hstmt, cbErrorMsgMax);
......
...@@ -3983,7 +3983,7 @@ PGAPI_TablePrivileges( ...@@ -3983,7 +3983,7 @@ PGAPI_TablePrivileges(
char *grolist, *uid, *delm; char *grolist, *uid, *delm;
snprintf(proc_query, sizeof(proc_query) - 1, "select grolist from pg_group where groname = '%s'", user); snprintf(proc_query, sizeof(proc_query) - 1, "select grolist from pg_group where groname = '%s'", user);
if (gres = CC_send_query(conn, proc_query, NULL, CLEAR_RESULT_ON_ABORT)) if ((gres = CC_send_query(conn, proc_query, NULL, CLEAR_RESULT_ON_ABORT)))
{ {
grolist = QR_get_value_backend_row(gres, 0, 0); grolist = QR_get_value_backend_row(gres, 0, 0);
if (grolist && grolist[0] == '{') if (grolist && grolist[0] == '{')
......
...@@ -228,8 +228,8 @@ pg_CS_stat(int stat,unsigned int character,int characterset_code) ...@@ -228,8 +228,8 @@ pg_CS_stat(int stat,unsigned int character,int characterset_code)
character > 0xa0) character > 0xa0)
stat = 3; stat = 3;
else if (stat == 3 || else if (stat == 3 ||
stat < 2 && (stat < 2 &&
character > 0xa0) character > 0xa0))
stat = 2; stat = 2;
else if (stat == 2) else if (stat == 2)
stat = 1; stat = 1;
......
...@@ -86,4 +86,7 @@ void encoded_str_constr(encoded_str *encstr, int ccsc, const char *str); ...@@ -86,4 +86,7 @@ void encoded_str_constr(encoded_str *encstr, int ccsc, const char *str);
#define make_encoded_str(encstr, conn, str) encoded_str_constr(encstr, conn->ccsc, str) #define make_encoded_str(encstr, conn, str) encoded_str_constr(encstr, conn->ccsc, str)
extern int encoded_nextchar(encoded_str *encstr); extern int encoded_nextchar(encoded_str *encstr);
extern int encoded_byte_check(encoded_str *encstr, int abspos); extern int encoded_byte_check(encoded_str *encstr, int abspos);
/* This doesn't seem to be called by anyone, bjm 2002-03-24 */
extern int pg_ismb(int characterset_code);
#define check_client_encoding(X) pg_CS_name(pg_CS_code(X)) #define check_client_encoding(X) pg_CS_name(pg_CS_code(X))
...@@ -234,7 +234,9 @@ pgtype_to_sqltype(StatementClass *stmt, Int4 type) ...@@ -234,7 +234,9 @@ pgtype_to_sqltype(StatementClass *stmt, Int4 type)
{ {
ConnectionClass *conn = SC_get_conn(stmt); ConnectionClass *conn = SC_get_conn(stmt);
ConnInfo *ci = &(conn->connInfo); ConnInfo *ci = &(conn->connInfo);
#if (ODBCVER >= 0x0300)
EnvironmentClass *env = (EnvironmentClass *) (conn->henv); EnvironmentClass *env = (EnvironmentClass *) (conn->henv);
#endif
switch (type) switch (type)
{ {
...@@ -342,7 +344,9 @@ pgtype_to_ctype(StatementClass *stmt, Int4 type) ...@@ -342,7 +344,9 @@ pgtype_to_ctype(StatementClass *stmt, Int4 type)
{ {
ConnectionClass *conn = SC_get_conn(stmt); ConnectionClass *conn = SC_get_conn(stmt);
ConnInfo *ci = &(conn->connInfo); ConnInfo *ci = &(conn->connInfo);
#if (ODBCVER >= 0x0300)
EnvironmentClass *env = (EnvironmentClass *) (conn->henv); EnvironmentClass *env = (EnvironmentClass *) (conn->henv);
#endif
switch (type) switch (type)
{ {
......
...@@ -731,10 +731,10 @@ QR_read_tuple(QResultClass *self, char binary) ...@@ -731,10 +731,10 @@ QR_read_tuple(QResultClass *self, char binary)
if (this_keyset) if (this_keyset)
{ {
if (this_tuplefield[num_fields - 2].value) if (this_tuplefield[num_fields - 2].value)
sscanf(this_tuplefield[num_fields - 2].value, "(%u,%hu)", sscanf(this_tuplefield[num_fields - 2].value, "(%lu,%hu)",
&this_keyset->blocknum, &this_keyset->offset); &this_keyset->blocknum, &this_keyset->offset);
if (this_tuplefield[num_fields - 1].value) if (this_tuplefield[num_fields - 1].value)
sscanf(this_tuplefield[num_fields - 1].value, "%u", sscanf(this_tuplefield[num_fields - 1].value, "%lu",
&this_keyset->oid); &this_keyset->oid);
} }
self->currTuple++; self->currTuple++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment