commit c53c8f2212b8cf746289a4712596aa488ceb91b6
Author: Christoph Berg <myon@debian.org>
Date:   Mon Jun 16 20:06:49 2025 +0200

    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.

diff --git a/pgapi30.c b/pgapi30.c
index 8f061d0..ca437c9 100644
--- a/pgapi30.c
+++ b/pgapi30.c
@@ -2116,8 +2116,7 @@ PGAPI_GetDescRec(SQLHDESC DescriptorHandle,
 {
 	RETCODE		ret = SQL_SUCCESS;
 	DescriptorClass *desc = (DescriptorClass *) DescriptorHandle;
-	SQLSMALLINT strlen, typ, subtyp, prec, scal, null;
-	SQLLEN len;
+	SQLINTEGER strlen, typ, subtyp, len, prec, scal, null;
 
 	MYLOG(0, "entering h=%p(%d) rec=" FORMAT_SMALLI " name=%p blen=" FORMAT_SMALLI "\n", DescriptorHandle, DC_get_desc_type(desc), RecNumber, Name, BufferLength);
 	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)
 		ret = bulk_ope_callback(SQL_SUCCESS, &s);
 	}
 	return ret;
-}
\ No newline at end of file
+}
