X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;ds=sidebyside;f=db-mysql%2Fmysql-sql.lisp;h=873ab5eaca579369afc1f451e0da066c8ea8b8a1;hb=cc92d162f24648d65ad872098353305a5baf91d7;hp=7cc6f50ba53d126b0a6af193125221fcb1e354b4;hpb=a4097e19c5157e87b9991549bc44f3ef598aeb90;p=clsql.git diff --git a/db-mysql/mysql-sql.lisp b/db-mysql/mysql-sql.lisp index 7cc6f50..873ab5e 100644 --- a/db-mysql/mysql-sql.lisp +++ b/db-mysql/mysql-sql.lisp @@ -261,7 +261,7 @@ (declare (ignore owner)) (remove-if #'(lambda (s) (and (>= (length s) 11) - (string= (subseq s 0 11) "_clsql_seq_"))) + (string= (subseq s 0 11) "_CLSQL_SEQ_"))) (mapcar #'car (database-query "SHOW TABLES" database nil)))) ;; MySQL 4.1 does not support views @@ -318,11 +318,11 @@ ;;; Sequence functions (defun %sequence-name-to-table (sequence-name) - (concatenate 'string "_clsql_seq_" (sql-escape sequence-name))) + (concatenate 'string "_CLSQL_SEQ_" (sql-escape sequence-name))) (defun %table-name-to-sequence-name (table-name) (and (>= (length table-name) 11) - (string= (subseq table-name 0 11) "_clsql_seq_") + (string= (subseq table-name 0 11) "_CLSQL_SEQ_") (subseq table-name 11))) (defmethod database-create-sequence (sequence-name @@ -421,9 +421,25 @@ ;;; Database capabilities -(defmethod db-use-column-on-drop-index? ((database mysql-database)) +(defmethod db-type-use-column-on-drop-index? ((db-type (eql :mysql))) t) +(defmethod db-type-has-views? ((db-type (eql :mysql))) + ;; MySQL 4.1 will apparently have views, need to check *mysql-client-info* + nil) + +(defmethod db-type-has-subqueries? ((db-type (eql :mysql))) + ;; MySQL 4.1 will apparently have subqueries, need to check *mysql-client-info* + nil) + +(defmethod db-type-has-boolean-where? ((db-type (eql :mysql))) + nil) + +(defmethod db-type-transaction-capable? ((db-type (eql :mysql)) database) + (let ((has-innodb (caar (database-query "SHOW VARIABLES LIKE 'HAVE_INNODB'" database :auto)))) + (and has-innodb (string-equal "YES" has-innodb)))) + + (when (clsql-base-sys:database-type-library-loaded :mysql) (clsql-base-sys:initialize-database-type :database-type :mysql))