Skip to content

Commit c53c8f2

Browse files
authored
Fix GetDescRec on big-endian architectures (#130)
IRDGetField is treating its arguments as SQLINTEGER, but we were passing SQLSMALLINT to it. Fixes the 2nd half of #51.
1 parent 3f261a4 commit c53c8f2

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pgapi30.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2116,8 +2116,7 @@ PGAPI_GetDescRec(SQLHDESC DescriptorHandle,
21162116
{
21172117
RETCODE ret = SQL_SUCCESS;
21182118
DescriptorClass *desc = (DescriptorClass *) DescriptorHandle;
2119-
SQLSMALLINT strlen, typ, subtyp, prec, scal, null;
2120-
SQLLEN len;
2119+
SQLINTEGER strlen, typ, subtyp, len, prec, scal, null;
21212120

21222121
MYLOG(0, "entering h=%p(%d) rec=" FORMAT_SMALLI " name=%p blen=" FORMAT_SMALLI "\n", DescriptorHandle, DC_get_desc_type(desc), RecNumber, Name, BufferLength);
21232122
MYLOG(0, "str=%p type=%p sub=%p len=%p prec=%p scale=%p null=%p\n", StringLength, Type, SubType, Length, Precision, Scale, Nullable);
@@ -2409,4 +2408,4 @@ PGAPI_BulkOperations(HSTMT hstmt, SQLSMALLINT operationX)
24092408
ret = bulk_ope_callback(SQL_SUCCESS, &s);
24102409
}
24112410
return ret;
2412-
}
2411+
}

0 commit comments

Comments
 (0)