Merged in longchar-typespecifier-fix branch
[clsql.git] / sql / generic-odbc.lisp
index 766606035a3c2cc2f64e6e5d3f194becce3ff28e..4995c25ff420a51112e5c553fcc6cec3e43f1545 100644 (file)
   (declare (ignore args database))
   "DATETIME")
 
+(defmethod database-get-type-specifier ((type (eql 'date)) args database
+                                        (db-type (eql :mssql)))
+  (declare (ignore args database))
+  "SMALLDATETIME")
+
 (defmethod database-get-type-specifier ((type (eql 'boolean)) args database
                                         (db-type (eql :mssql)))
   (declare (ignore args database))
@@ -245,8 +250,9 @@ on schema since that's what tends to be exposed. Some DBs like mssql
   (%database-list-* database "VIEW" owner))
 
 
-(defmethod database-list-attributes ((table string) (database generic-odbc-database)
-                                     &key (owner nil))
+(defmethod database-list-attributes ((table %database-identifier) (database generic-odbc-database)
+                                     &key (owner nil)
+                                     &aux (table (unescaped-database-identifier table)))
   (declare (ignore owner))
   (multiple-value-bind (rows col-names)
       (funcall (list-all-table-columns-fn database) table
@@ -256,8 +262,11 @@ on schema since that's what tends to be exposed. Some DBs like mssql
     (loop for row in rows
         collect (fourth row))))
 
-(defmethod database-attribute-type ((attribute string) (table string) (database generic-odbc-database)
-                                    &key (owner nil))
+(defmethod database-attribute-type ((attribute %database-identifier) (table %database-identifier)
+                                    (database generic-odbc-database)
+                                    &key (owner nil)
+                                    &aux (table (unescaped-database-identifier table))
+                                    (attribute (unescaped-database-identifier attribute)))
   (declare (ignore owner))
   (multiple-value-bind (rows col-names)
       (funcall (list-all-table-columns-fn database) table