Adding a test that is just micro-seconds for sqlserver, marking usec ones as skip.
authorNathan Bird <nathan@acceleration.net>
Wed, 3 Feb 2010 15:48:33 +0000 (10:48 -0500)
committerNathan Bird <nathan@acceleration.net>
Wed, 3 Feb 2010 15:48:33 +0000 (10:48 -0500)
tests/test-init.lisp
tests/test-time.lisp

index a7f8a84c476b64f7023d16b5f255cf806d8aab6c..8ce12ed654669429407a30489f7e992304e77c04 100644 (file)
           (push (cons test "Postgres specific test.")
                 skip-tests))
          ((and (member *test-database-underlying-type* '(:mysql))
+               (clsql-sys:in test :time/cross-platform/msec
+                            :time/cross-platform/usec/no-tz :time/cross-platform/usec/tz))
+          (push (cons test "MySQL doesn't support fractional seconds on timestamp columns (http://forge.mysql.com/worklog/task.php?id=946).")
+                skip-tests))
+         ((and (member *test-database-underlying-type* '(:mssql))
                (clsql-sys:in test :time/cross-platform/usec/no-tz :time/cross-platform/usec/tz))
-          (push (cons test "MySQL does not support fractional seconds on timestamp columns (http://forge.mysql.com/worklog/task.php?id=946).")
+          (push (cons test "MSSQL doesn't support micro-seconds on datetime columns.")
                 skip-tests))
-
           (t
            (push test-form test-forms)))))
       (values (nreverse test-forms) (nreverse skip-tests))))
index 174ab75041811060e9d6861e1394980d931109e2..39cc93061bfe5e59520480a82f6bb3022e0e3c23 100644 (file)
          )))
   #.(format-time nil (parse-timestring "2008-09-09T14:37:29-04:00") :format :iso))
 
+;;;This test gets at the databases that only support miliseconds,
+;;; not microseconds.
+(deftest :time/cross-platform/msec
+    (with-dataset *cross-platform-datetest*
+      (let ((time (parse-timestring "2008-09-09T14:37:29.423")))
+       (clsql-sys:insert-records :into [datetest]
+                                 :attributes '([testtime])
+                                 :values (list time))
+       (let ((testtime
+              (first (clsql:select [testtime]
+                                   :from [datetest] :flatp T
+                                   :where [= [testtime] time] ))))
+         (format-time nil (parse-timestring testtime) :format :iso)
+         )))
+  #.(format-time nil (parse-timestring "2008-09-09T14:37:29.423") :format :iso))
+
 (deftest :time/cross-platform/usec/no-tz
     (with-dataset *cross-platform-datetest*
       (let ((time (parse-timestring "2008-09-09T14:37:29.000213")))