r9370: * sql/db-interface.lisp: Add new db-type-has-union?
authorKevin M. Rosenberg <kevin@rosenberg.net>
Sun, 16 May 2004 08:12:44 +0000 (08:12 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Sun, 16 May 2004 08:12:44 +0000 (08:12 +0000)
        since Mysql 3.23 does not support unions.
        * sql/test-init.lisp: Don't try union tests on database
        backends which do not support it.

ChangeLog
db-mysql/mysql-sql.lisp
sql/db-interface.lisp
sql/package.lisp
tests/test-init.lisp

index 35637e538e7f1bd6b7ec242fe5842da3f868ffae..e800941eae87dd8bcbd825b44457c19122bd6cb0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 15 May 2004 Kevin Rosenberg (kevin@rosenberg.net)
        * Version 2.10.18
 15 May 2004 Kevin Rosenberg (kevin@rosenberg.net)
        * Version 2.10.18
+       * sql/db-interface.lisp: Add new db-type-has-union? 
+       since Mysql 3.23 does not support unions.
+       * sql/test-init.lisp: Don't try union tests on database
+       backends which do not support it.
        * db-oracle/*.lisp: initial port to UFFI
        * sql/objects.lisp: implement UPDATE-OBJECT-JOINS,
        implement REFRESH for SELECT.
        * db-oracle/*.lisp: initial port to UFFI
        * sql/objects.lisp: implement UPDATE-OBJECT-JOINS,
        implement REFRESH for SELECT.
index cf85c591e8645d4da4374548e73caa077995b163..08f50fb582e0d0f67ebe8de0f9018319a4c8db3c 100644 (file)
 (defmethod db-type-has-boolean-where? ((db-type (eql :mysql)))
   nil)
 
 (defmethod db-type-has-boolean-where? ((db-type (eql :mysql)))
   nil)
 
+(defmethod db-type-has-union? ((db-type (eql :mysql)))
+  (not (eql (schar mysql::*mysql-client-info* 0) #\3)))
+
 (defmethod db-type-transaction-capable? ((db-type (eql :mysql)) database)
   (let ((tuple (car (database-query "SHOW VARIABLES LIKE 'HAVE_INNODB'" database :auto nil))))
     (and tuple (string-equal "YES" (second tuple)))))
 (defmethod db-type-transaction-capable? ((db-type (eql :mysql)) database)
   (let ((tuple (car (database-query "SHOW VARIABLES LIKE 'HAVE_INNODB'" database :auto nil))))
     (and tuple (string-equal "YES" (second tuple)))))
index 84702b9c940e7170c69beb23ae01d57c8e284f5e..62436309b25e550bf877a09f493c4e65d74bafdc 100644 (file)
@@ -244,6 +244,12 @@ of TYPE_NAME (keyword) PRECISION SCALE NULLABLE."))
           t)
   (:documentation "T [default] if database-type supports boolean WHERE clause, such as 'WHERE MARRIED'."))
 
           t)
   (:documentation "T [default] if database-type supports boolean WHERE clause, such as 'WHERE MARRIED'."))
 
+(defgeneric db-type-has-union? (db-type)
+  (:method (db-type)
+          (declare (ignore db-type))
+          t)
+  (:documentation "T [default] if database-type supports boolean UNION."))
+
 (defgeneric db-backend-has-create/destroy-db? (db-type)
   (:method (db-type)
           (declare (ignore db-type))
 (defgeneric db-backend-has-create/destroy-db? (db-type)
   (:method (db-type)
           (declare (ignore db-type))
index 1a11f9493a7d57faa1faf85091856ba9858b3474..cb6c2de6ec2dc00768808cd2cc4930a241586471 100644 (file)
      
      #:db-backend-has-create/destroy-db?
      #:db-type-has-views?
      
      #:db-backend-has-create/destroy-db?
      #:db-type-has-views?
+     #:db-type-has-union?
      #:db-type-has-subqueries?
      #:db-type-has-boolean-where?
      #:db-type-transaction-capable?
      #:db-type-has-subqueries?
      #:db-type-has-boolean-where?
      #:db-type-transaction-capable?
index 7d7273f5c07460797f386372b53e63dc9c6e71c8..70d54d75f0f4ec22ef47a1f7472da32fc32fe871 100644 (file)
                (clsql-sys:in test :fdml/select/22 :fdml/query/5 
                                :fdml/query/7 :fdml/query/8))
           (push (cons test "not supported by mysql") skip-tests))
                (clsql-sys:in test :fdml/select/22 :fdml/query/5 
                                :fdml/query/7 :fdml/query/8))
           (push (cons test "not supported by mysql") skip-tests))
+         ((and (null (clsql-sys:db-type-has-union? db-underlying-type))
+               (clsql-sys:in test :fdml/query/6))
+          (push (cons test "union not supported") skip-tests))
          (t
           (push test-form test-forms)))))
       (values (nreverse test-forms) (nreverse skip-tests))))
          (t
           (push test-form test-forms)))))
       (values (nreverse test-forms) (nreverse skip-tests))))