X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=db-odbc%2Fodbc-dbi.lisp;h=90cea24f1e8049c863ed0e883c6033322ea1f4cb;hp=319a8cc1ccea95dc97dfd0cc2974e29d69f4bee7;hb=8b84dd8066b5792cdc5b9570a60fb72c278da677;hpb=93eb4aa202e6a122f11f37ea45a7a9ced104712a diff --git a/db-odbc/odbc-dbi.lisp b/db-odbc/odbc-dbi.lisp index 319a8cc..90cea24 100644 --- a/db-odbc/odbc-dbi.lisp +++ b/db-odbc/odbc-dbi.lisp @@ -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 @@ -468,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)))