use md5sum-string instead of md5sum-sequence to adjust to upstream changes
[clsql.git] / db-odbc / odbc-dbi.lisp
index 3abce4aa8015e0a564574cb8381b22d4d19e00b7..90cea24f1e8049c863ed0e883c6033322ea1f4cb 100644 (file)
@@ -207,22 +207,28 @@ the query against." ))
              (coerce (column-names query) 'list))))
       (db-close-query query))))
 
-(defun list-table-indexes (table &key db unique hstmt)
+(defun list-table-indexes (table &key db unique hstmt
+                            &aux (table
+                                     (princ-to-string
+                                      (clsql-sys::unescaped-database-identifier table))))
   (declare (ignore hstmt))
   (let ((query (get-free-query db)))
     (unwind-protect
-        (progn
-          (with-slots (hstmt) query
-            (unless hstmt
-              (setf hstmt (%new-statement-handle (hdbc db))))
-            (%table-statistics table hstmt :unique unique)
-            (%initialize-query query nil nil)
-            (values
-             (db-fetch-query-results query)
-             (coerce (column-names query) 'list))))
+         (progn
+           (with-slots (hstmt) query
+             (unless hstmt
+               (setf hstmt (%new-statement-handle (hdbc db))))
+             (%table-statistics table hstmt :unique unique)
+             (%initialize-query query nil nil)
+             (values
+              (db-fetch-query-results query)
+              (coerce (column-names query) 'list))))
       (db-close-query query))))
 
-(defun list-all-table-columns (table &key db hstmt)
+(defun list-all-table-columns (table &key db hstmt
+                                &aux (table
+                                         (princ-to-string
+                                          (clsql-sys::unescaped-database-identifier table))))
   (declare (ignore hstmt))
   (db-describe-columns db nil nil table nil))   ;; use nil rather than "" for unspecified values
 
@@ -328,7 +334,7 @@ the query against." ))
                             (cond ((< 0 precision (query-width query))
                                    (read-data data-ptr c-type sql-type out-len-ptr result-type))
                                   ((zerop (get-cast-long out-len-ptr))
-                              nil)
+                                   nil)
                                   (t
                                    (read-data-in-chunks hstmt j data-ptr c-type sql-type
                                                         out-len-ptr result-type))))))))
@@ -450,6 +456,7 @@ This makes the functions db-execute-command and db-query thread safe."
           ;; get column information
           (initialize-column col-nr))))
 
+    ;; TODO: move this into the above loop
     (setf computed-result-types (make-array column-count))
     (dotimes (i column-count)
       (setf (aref computed-result-types i)
@@ -467,7 +474,7 @@ This makes the functions db-execute-command and db-query thread safe."
                  (#.odbc::$SQL_C_TYPE_TIMESTAMP :time)
                  (#.odbc::$SQL_C_CHAR ;; TODO: Read this as rational instead of double
                    (or (case (aref column-sql-types i)
-                         (#.odbc::$SQL_NUMERIC :double))
+                         ((#.odbc::$SQL_NUMERIC #.odbc::$SQL_DECIMAL) :double))
                        T))
 
                  (t t)))