r9115: new deb package
authorKevin M. Rosenberg <kevin@rosenberg.net>
Tue, 20 Apr 2004 23:37:56 +0000 (23:37 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Tue, 20 Apr 2004 23:37:56 +0000 (23:37 +0000)
ChangeLog
base/classes.lisp
base/db-interface.lisp
base/package.lisp
db-mysql/mysql-sql.lisp
db-odbc/odbc-sql.lisp
debian/changelog
sql/table.lisp

index f3816fe19a8193b332d0312839654537094f2636..a6d4a4a6a716016f2c41c7b200e9d93e2f2e143b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,7 +8,15 @@
        * db-aodbc/aodbc-sql.lisp: Filter driver manager
        "information_schema" tables from LIST-TABLES
        * tests/test-basic.lisp: Remove table after testing
-
+       * tests/test-fddl.lisp: Test LIST-TABLE-INDEXES
+       * base/db-interface.lisp: Add DATABASE-UNDERLYING-TYPE
+       which gets the underlying type of database -- required
+       when dealing with ODBC databases and want to query
+       database capabilities. Added DB-USE-COLUMN-ON-DROP-TABLES?
+       as first database-backend specific feature. Is T on
+       :mysql, NIL on other backends. Change DROP-TABLE to
+       query this.
+       
 19 Apr 2004 Kevin Rosenberg (kevin@rosenberg.net)
        * Version 2.8.2: Build changes for FreeBSD [Slawek Zak]
 
index 32f48a7e4d07c3fc844a3f7c8b295a36ddaf6683..7281f552b430458f73a31fa7c8b122b7477bdb54 100644 (file)
@@ -26,8 +26,8 @@
    (connection-spec :initform nil :initarg :connection-spec
                     :reader connection-spec
                    :documentation "Require to use connection pool")
-   (database-type :initarg :database-type :reader database-type 
-                 :initform :unknown)
+   (database-type :initarg :database-type :initform :unknown
+                 :reader database-type)
    (state :initform :closed :reader database-state)
    (command-recording-stream :accessor command-recording-stream :initform nil)
    (result-recording-stream :accessor result-recording-stream :initform nil)
index d874a7f67dfa15249b46bd7eae2e1368d061ea70..3bf550c7f4a7e1568caebacc18fdcf5f5303395a 100644 (file)
@@ -206,12 +206,17 @@ the given lisp type and parameters."))
 
 ;;; Database backend capabilities
 
-(defgeneric db-use-column-on-drop-index? (database)
+(defgeneric database-underlying-type (database)
   (:method (database)
-          (declare (ignore database))
+    (database-type database))
+  (:documentation "Returns the type of the underlying database. For ODBC, needs to query ODBC driver."))
+
+(defgeneric db-use-column-on-drop-index? (db-type)
+  (:method (db-type)
+          (declare (ignore db-type))
           ;; Standard SQL does not use column name on DROP INDEX
           nil)
-  (:documentation "NIL [default] lif database does not use column name on DROP INDEX."))
+  (:documentation "NIL [default] lif database-type does not use column name on DROP INDEX."))
 
 
 ;;; Large objects support (Marc Battyani)
index 0301230f7cbbecc2b6798659939be3689adfea31..7f57eabdccbd5ef7e68901ccd83c2309c19488dd 100644 (file)
@@ -45,7 +45,8 @@
      #:database-probe
      #:database-list
      #:database-describe-table
-     
+     #:database-underlying-type
+
      #:database-list-tables
      #:database-list-attributes
      #:database-attribute-type
index 7cc6f50ba53d126b0a6af193125221fcb1e354b4..46544926debd64b7dd30c94214362f89ad1ab054 100644 (file)
 
 ;;; Database capabilities
 
-(defmethod db-use-column-on-drop-index? ((database mysql-database))
+(defmethod db-use-column-on-drop-index? ((db-type (eql :mysql)))
   t)
 
 (when (clsql-base-sys:database-type-library-loaded :mysql)
index 0da1a04d4dd0c9143055ce613f116b87be05b3a4..51d366b9360ccd2de9eab7e3b1ed4119127e152c 100644 (file)
@@ -60,6 +60,9 @@
             :errno nil
             :error "Connection failed")))))
 
+(defmethod database-underlying-type ((database odbc-database))
+  (odbc-db-type database))
+
 (defun store-type-of-connected-database (db)
   (let* ((odbc-conn (database-odbc-conn db))
         (server-name (odbc-dbi::get-odbc-info odbc-conn odbc::$SQL_SERVER_NAME))
index 0d02d5934382c658956524aaccafb373fae841b9..e5364d5ea0c1630a26b503e67f1d5e8030f400df 100644 (file)
@@ -1,8 +1,8 @@
-cl-sql (2.8.3-1) unstable; urgency=low
+cl-sql (2.9.0-1) unstable; urgency=low
 
   * New upstream
 
- -- Kevin M. Rosenberg <kmr@debian.org>  Tue, 20 Apr 2004 09:40:20 -0600
+ -- Kevin M. Rosenberg <kmr@debian.org>  Tue, 20 Apr 2004 17:37:40 -0600
 
 cl-sql (2.8.2-1) unstable; urgency=low
 
index 6491fade2719c1e510fe235eed0189c5f6baea79..dd5ccb95726549bb1c60adc8faf27e7e6fbdde2c 100644 (file)
@@ -173,7 +173,7 @@ specification of a table to drop the index from."
        (unless (index-exists-p index-name :database database)
          (return-from drop-index)))
       (:error t))
-    (unless (db-use-column-on-drop-index? database)
+    (unless (db-use-column-on-drop-index? (database-underlying-type database))
       (setq on nil))
     (execute-command (format nil "DROP INDEX ~A~A" index-name
                              (if (null on) ""