r9446: * db-mysql/mysql-objects.lisp: New file
authorKevin M. Rosenberg <kevin@rosenberg.net>
Sun, 23 May 2004 06:35:34 +0000 (06:35 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Sun, 23 May 2004 06:35:34 +0000 (06:35 +0000)
        * sql/objects.lisp: Move MySQL specific code to mysql-objects.lisp

ChangeLog
clsql-mysql.asd
db-mysql/mysql-objects.lisp [new file with mode: 0644]
sql/objects.lisp

index 7cc79dedb1857b8302fdd2a4c13fbcb1c720bdae..c3143fc69a89462683f295243a7abd559e37f687 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,11 +3,14 @@
        * sql/classes.lisp: honor case of string tables when outputting queries 
        * sql/objects.lisp: Add database type to default database-get-type-specifier method
        * sql/sql.lisp:  Add database type to default database-abort-transaction method
+       * db-mysql/mysql-objects.lisp: New file
+       * sql/objects.lisp: Move MySQL specific code to mysql-objects.lisp
        * sql/utils.lisp: Add GETENV function which will be used to get ORACLE_HOME
        from environment
        * test/test-fdml.lisp: String table names are now case sensitive, so convert to
        default db case for FDML/SELECT/25
 
+>>>>>>> .r9445
 22 May 2004 Kevin Rosenberg
        * Version 2.10.20 released: Oracle backend now fails 6 out of 200 tests
        * TODO: Added 2 variances from CommonSQL. Add tests for owner phrases
index b20b4a0f1d7555a867461a663697530d91c74d9e..fe661dc84972765f4951491e4272db5a09538259 100644 (file)
@@ -90,4 +90,5 @@
             (:file "mysql-loader" :depends-on ("mysql-package" "mysql"))
             (:file "mysql-client-info" :depends-on ("mysql-loader"))
             (:file "mysql-api" :depends-on ("mysql-client-info"))
-            (:file "mysql-sql" :depends-on ("mysql-api"))))))
+            (:file "mysql-sql" :depends-on ("mysql-api"))
+            (:file "mysql-objects" :depends-on ("mysql-sql"))))))
diff --git a/db-mysql/mysql-objects.lisp b/db-mysql/mysql-objects.lisp
new file mode 100644 (file)
index 0000000..ae24cac
--- /dev/null
@@ -0,0 +1,28 @@
+;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*-
+;;;; *************************************************************************
+;;;; FILE IDENTIFICATION
+;;;;
+;;;; Name:     mysql-objects.lisp
+;;;; Purpose:  CLSQL Object layer for MySQL
+;;;; Created:  May 2004
+;;;;
+;;;; $Id: mysql-sql.lisp 9403 2004-05-19 23:46:45Z kevin $
+;;;;
+;;;; CLSQL users are granted the rights to distribute and use this software
+;;;; as governed by the terms of the Lisp Lesser GNU Public License
+;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
+;;;; *************************************************************************
+
+(in-package #:clsql-mysql)
+
+(defmethod database-get-type-specifier ((type (eql 'wall-time)) args (database mysql-database))
+  (declare (ignore args))
+  "DATETIME")
+
+(defmethod database-output-sql-as-type ((type (eql 'boolean)) val (database mysql-database))
+  (if val 1 0))
+
+(defmethod read-sql-value (val (type (eql 'boolean)) (database mysql-database))
+  (etypecase val
+    (string (if (string= "0" val) nil t))
+    (integer (if (zerop val) nil t))))
index b90a6d1b80a8bcaeb91c930e2b266c23dd3050dd..2111b7aa4c6097ca42942e7019721e0d79b1e2fe 100644 (file)
@@ -560,8 +560,6 @@ strings."
   (case (database-underlying-type database)
     ((:postgresql :postgresql-socket)
      "TIMESTAMP WITHOUT TIME ZONE")
-    (:mysql
-     "DATETIME")
     (t "TIMESTAMP")))
 
 (defmethod database-get-type-specifier ((type (eql 'duration)) args database)
@@ -637,11 +635,8 @@ strings."
     (prin1-to-string val)))
 
 (defmethod database-output-sql-as-type ((type (eql 'boolean)) val database)
-  (case (database-underlying-type database)
-    (:mysql
-     (if val 1 0))
-    (t
-     (if val "t" "f"))))
+  (declare (ignore database))
+  (if val "t" "f"))
 
 (defmethod database-output-sql-as-type ((type (eql 'string)) val database)
   (declare (ignore database))
@@ -717,10 +712,6 @@ strings."
 
 (defmethod read-sql-value (val (type (eql 'boolean)) database)
   (case (database-underlying-type database)
-    (:mysql
-     (etypecase val
-       (string (if (string= "0" val) nil t))
-       (integer (if (zerop val) nil t))))
     (:postgresql
      (if (eq :odbc (database-type database))
         (if (string= "0" val) nil t)