r9331: * db-odbc/odbc-api.lisp: work around return-type bug [spr28889] in
authorKevin M. Rosenberg <kevin@rosenberg.net>
Thu, 13 May 2004 04:38:52 +0000 (04:38 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Thu, 13 May 2004 04:38:52 +0000 (04:38 +0000)
        Allegro 7.0beta AMD64

ChangeLog
db-odbc/odbc-api.lisp
db-odbc/odbc-ff-interface.lisp
tests/test-basic.lisp

index 4b7ffc52f7f529aaf844b19aab15c3eeae0a090d..41b691525cb32023c4cc3a9cf5855452cf4a639e 100644 (file)
--- 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.
index a320d7e3f561543d87314f5469b698de2de48dbe..66c9936b041193327782a1bc31f0f9ffcb8700e0 100644 (file)
@@ -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 ()
index 6df89376f55fb384164b157c7a9eaccfeb5088d7..4fbb8356dc6884378e460ba4e889845e29892a61 100644 (file)
      (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
      )
index b0f40a5acb24e253e4941bf9daeac9c18ac702f4..35b39213e22d4c2d8111c0c93340f31688c07dcb 100644 (file)
@@ -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))))