From: Kevin M. Rosenberg Date: Tue, 20 Apr 2004 23:37:56 +0000 (+0000) Subject: r9115: new deb package X-Git-Tag: v3.8.6~598 X-Git-Url: http://git.kpe.io/?p=clsql.git;a=commitdiff_plain;h=3ec4277531c7c19b1cffade823d3e2e3f928ceb3 r9115: new deb package --- diff --git a/ChangeLog b/ChangeLog index f3816fe..a6d4a4a 100644 --- 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] diff --git a/base/classes.lisp b/base/classes.lisp index 32f48a7..7281f55 100644 --- a/base/classes.lisp +++ b/base/classes.lisp @@ -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) diff --git a/base/db-interface.lisp b/base/db-interface.lisp index d874a7f..3bf550c 100644 --- a/base/db-interface.lisp +++ b/base/db-interface.lisp @@ -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) diff --git a/base/package.lisp b/base/package.lisp index 0301230..7f57eab 100644 --- a/base/package.lisp +++ b/base/package.lisp @@ -45,7 +45,8 @@ #:database-probe #:database-list #:database-describe-table - + #:database-underlying-type + #:database-list-tables #:database-list-attributes #:database-attribute-type diff --git a/db-mysql/mysql-sql.lisp b/db-mysql/mysql-sql.lisp index 7cc6f50..4654492 100644 --- a/db-mysql/mysql-sql.lisp +++ b/db-mysql/mysql-sql.lisp @@ -421,7 +421,7 @@ ;;; 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) diff --git a/db-odbc/odbc-sql.lisp b/db-odbc/odbc-sql.lisp index 0da1a04..51d366b 100644 --- a/db-odbc/odbc-sql.lisp +++ b/db-odbc/odbc-sql.lisp @@ -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)) diff --git a/debian/changelog b/debian/changelog index 0d02d59..e5364d5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Tue, 20 Apr 2004 09:40:20 -0600 + -- Kevin M. Rosenberg Tue, 20 Apr 2004 17:37:40 -0600 cl-sql (2.8.2-1) unstable; urgency=low diff --git a/sql/table.lisp b/sql/table.lisp index 6491fad..dd5ccb9 100644 --- a/sql/table.lisp +++ b/sql/table.lisp @@ -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) ""