From: Kevin M. Rosenberg Date: Thu, 13 May 2004 04:38:52 +0000 (+0000) Subject: r9331: * db-odbc/odbc-api.lisp: work around return-type bug [spr28889] in X-Git-Tag: v3.8.6~473 X-Git-Url: http://git.kpe.io/?p=clsql.git;a=commitdiff_plain;h=6684280691d01cc6d761f24288f9ea80d77bca29 r9331: * db-odbc/odbc-api.lisp: work around return-type bug [spr28889] in Allegro 7.0beta AMD64 --- diff --git a/ChangeLog b/ChangeLog index 4b7ffc5..41b6915 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,6 @@ 11 May 2004 Kevin Rosenberg (kevin@rosenberg.net) + * db-odbc/odbc-api.lisp: work around return-type bug [spr28889] in + Allegro 7.0beta AMD64 * db-odbc/*.lisp: Add a layer of indirection to foreign-type of ODBC longs since this type can vary on 64-bit platforms depending upon the compilation options of unixODBC. diff --git a/db-odbc/odbc-api.lisp b/db-odbc/odbc-api.lisp index a320d7e..66c9936 100644 --- a/db-odbc/odbc-api.lisp +++ b/db-odbc/odbc-api.lisp @@ -128,7 +128,20 @@ as possible second argument) to the desired representation of date/time/timestam 'clsql-base:clsql-odbc-error :odbc-message error-message :sql-state sql-state))) + (#.$SQL_NO_DATA_FOUND + (progn ,result-code ,@body)) + ;; work-around for Allegro 7.0beta AMD64 which + ;; has for negative numbers (otherwise + (multiple-value-bind (error-message sql-state) + (handle-error (or ,henv +null-handle-ptr+) + (or ,hdbc +null-handle-ptr+) + (or ,hstmt +null-handle-ptr+)) + (error + 'clsql-base:clsql-odbc-error + :odbc-message error-message + :sql-state sql-state)) + #+ignore (progn ,result-code ,@body)))))) (defun %new-environment-handle () diff --git a/db-odbc/odbc-ff-interface.lisp b/db-odbc/odbc-ff-interface.lisp index 6df8937..4fbb835 100644 --- a/db-odbc/odbc-ff-interface.lisp +++ b/db-odbc/odbc-ff-interface.lisp @@ -152,7 +152,7 @@ (cbColNameMax :short) ; SWORD cbColNameMax (*pcbColName (* :short)) ; SWORD FAR *pcbColName (*pfSqlType (* :short)) ; SWORD FAR *pfSqlType - (*pcbColDef (* :unsigned-int)) ; UDWORD FAR *pcbColDef + (*pcbColDef (* #.$ODBC-ULONG-TYPE)) ; UDWORD FAR *pcbColDef (*pibScale (* :short)) ; SWORD FAR *pibScale (*pfNullable (* :short)) ; SWORD FAR *pfNullable ) diff --git a/tests/test-basic.lisp b/tests/test-basic.lisp index b0f40a5..35b3921 100644 --- a/tests/test-basic.lisp +++ b/tests/test-basic.lisp @@ -47,8 +47,9 @@ (typep float 'double-float) (if (and (eq :odbc *test-database-type*) (eq :postgresql *test-database-underlying-type*)) - ;; ODBC/Postgresql returns bigints as strings - (stringp bigint) + ;; ODBC/Postgresql may return returns bigints as strings or integer + ;; depending upon the platform + t (integerp bigint)) (stringp str)) results))))