Update of /cvsroot/htoolkit/HSQL/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23609/src
Modified Files:
HSQL.hsc
Log Message:
Parse SqlTimeStamp values like SqlDateTime values, since only MySQL uses SqlTimeStamp, and it returns them on the same format as SqlDateTime.
Index: HSQL.hsc
===================================================================
RCS file: /cvsroot/htoolkit/HSQL/src/HSQL.hsc,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** HSQL.hsc 27 Apr 2004 19:27:12 -0000 1.13
--- HSQL.hsc 31 May 2004 12:30:15 -0000 1.14
***************
*** 359,363 ****
return (mkClockTime year month day hour minutes seconds (tz*3600))
! fromSqlValue SqlDateTime s = f_read getDateTime s
where
getDateTime :: ReadP ClockTime
--- 359,366 ----
return (mkClockTime year month day hour minutes seconds (tz*3600))
! -- The only driver which seems to report the type as SqlTimeStamp seems
! -- to be the MySQL driver. MySQL (at least 4.1) uses the same format for datetime and
! -- timestamp columns.
! fromSqlValue t s | t == SqlDateTime || t == SqlTimeStamp = f_read getDateTime s
where
getDateTime :: ReadP ClockTime
***************
*** 376,391 ****
return (mkClockTime year month day hour minutes seconds currTZ)
- fromSqlValue SqlTimeStamp s =
- let
- [year,month,day,hour,minutes,seconds] = parts [4,2,2,2,2,2] s
-
- parts [] xs = []
- parts (ix:ixs) xs = part ix 0 xs
- where
- part 0 n xs = n : parts ixs xs
- part k n (x:xs) = part (k-1) (n*10 + (ord x - ord '0')) xs
- in
- Just (mkClockTime year month day hour minutes seconds currTZ)
-
fromSqlValue _ _ = Nothing
--- 379,382 ----
|