r9090: properly check for errors
authorKevin M. Rosenberg <kevin@rosenberg.net>
Mon, 19 Apr 2004 09:08:19 +0000 (09:08 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Mon, 19 Apr 2004 09:08:19 +0000 (09:08 +0000)
db-odbc/odbc-api.lisp
db-odbc/odbc-dbi.lisp

index c032fd3ce6fd7ee6c9295444d1b1afc9be4756c6..0f27b5767ee3087ec26101ac78bc34e84fdf823c 100644 (file)
@@ -947,26 +947,27 @@ as possible second argument) to the desired representation of date/time/timestam
     (unwind-protect
         (with-foreign-objects ((dsn-len :short)
                                (desc-len :short))
-          (with-error-handling (:henv henv)
-            (let ((res
-                   (SQLDataSources henv $SQL_FETCH_FIRST dsn
-                                   (1+ $SQL_MAX_DSN_LENGTH)
-                                   dsn-len desc 256 desc-len)))
-              (when (or (eql res $SQL_SUCCESS)
-                        (eql res $SQL_SUCCESS_WITH_INFO))
-                (push (convert-from-foreign-string dsn) results))
-
-              (do ((res (SQLDataSources henv $SQL_FETCH_NEXT dsn
+          (let ((res (with-error-handling (:henv henv)
+                       (SQLDataSources henv $SQL_FETCH_FIRST dsn
+                                       (1+ $SQL_MAX_DSN_LENGTH)
+                                       dsn-len desc 256 desc-len))))
+            (when (or (eql res $SQL_SUCCESS)
+                      (eql res $SQL_SUCCESS_WITH_INFO))
+              (push (convert-from-foreign-string dsn) results))
+            
+            (do ((res (with-error-handling (:henv henv)
+                        (SQLDataSources henv $SQL_FETCH_NEXT dsn
                                         (1+ $SQL_MAX_DSN_LENGTH)
-                                        dsn-len desc 256 desc-len)
+                                        dsn-len desc 256 desc-len))
+                      (with-error-handling (:henv henv)
                         (SQLDataSources henv $SQL_FETCH_NEXT dsn
                                         (1+ $SQL_MAX_DSN_LENGTH)
-                                        dsn-len desc 256 desc-len)))
-                  ((not (or (eql res $SQL_SUCCESS)
-                            (eql res $SQL_SUCCESS_WITH_INFO))))
-                (push (convert-from-foreign-string dsn) results)))))
+                                        dsn-len desc 256 desc-len))))
+                ((not (or (eql res $SQL_SUCCESS)
+                          (eql res $SQL_SUCCESS_WITH_INFO))))
+              (push (convert-from-foreign-string dsn) results))))
       (progn
        (free-foreign-object dsn)
        (free-foreign-object desc)))
     (nreverse results)))
-               
+
index 8aa0b07c6faefae5ea4772b167f8f1c9cf039850..ff96c213b3ba113e635b4befd9bef4099a7037ca 100644 (file)
@@ -435,7 +435,7 @@ This makes the functions db-execute-command and db-query thread safe."
         (dotimes (col-nr count)
           (let ((data-ptr (aref column-data-ptrs col-nr))
                 (out-len-ptr (aref column-out-len-ptrs col-nr)))
-           ;; free-statment unbind frees theses
+           ;; free-statment :unbind frees these
            #+ignore (when data-ptr (uffi:free-foreign-object data-ptr))
            #+ignore (when out-len-ptr (uffi:free-foreign-object out-len-ptr)))))
       (cond ((null hstmt)