From: Frederik E. <fre...@a5...> - 2006-08-17 00:17:07
|
Hi, in HSQL/Database/HSQL.hsc instance SqlBind ClockTime where ... all of the 'fromSqlValue' functions convert with respect to the local timezone, while 'toSqlValue' converts with respect to UTC. Thus the values being written are not the same, it would seem, as those being read. Certainly that is the case for me. If the three appearances of currTZ within the body of that instance (and not elsewhere) are changed to 0, it should fix the problem (but I haven't tested). Also, I don't understand why a custom function 'mkClockTime' has been written in that module (it calls 'mktime' via FFI), rather than calling the standard library function toClockTime which seems to do the same thing. Frederik On Thu, Aug 10, 2006 at 04:19:36PM +0100, Frederik Eaton wrote: > In HSQL, why are 'datetime' columns interpreted as being in the local > timezone? >=20 > I would think that UTC would be more useful. If the local timezone is > used, then it makes it more difficult to move a server between > timezones, or to have multiple servers in multiple timezones. >=20 > Frederik >=20 > On Sat, Aug 05, 2006 at 06:59:21PM +0100, Frederik Eaton wrote: > > Thanks! > >=20 > > On Sat, Aug 05, 2006 at 05:27:04PM +0200, Bjorn Bringert wrote: > > > On Aug 5, 2006, at 3:34 PM, Frederik Eaton wrote: > > >=20 > > > >On Sat, Aug 05, 2006 at 11:15:19AM +0200, Bjorn Bringert wrote: > > > >>On Jul 31, 2006, at 12:55 PM, Frederik Eaton wrote: > > > >> > > > >>>Hi, > > > >>> > > > >>>I'm attaching another HSQL patch. > > > >>> > > > >>>It allows users to specify a port number with the server name in= the > > > >>>MySQL client. > > > >>> > > > >>>Frederik > > > >> > > > >>Hi Frederik, > > > >> > > > >>the patch doesn't apply cleanly against the current CVS version. = Is > > > >>there any chance you could make a patch against the CVS version > > > >>instead? > > > > > > > >It's a very simple modification, can't you just copy and paste fro= m > > > >the patch? > > >=20 > > > It appears to have been a simple whitespace mismatch problem (tabs = in the original HSQL source). I=20 > > > have committed your patch to CVS. > > >=20 > > > Thanks! > > >=20 > > > /Bj=F6rn > > >=20 > > >=20 > > >=20 > >=20 > > --=20 > > http://ofb.net/~frederik/ > >=20 >=20 > --=20 > http://ofb.net/~frederik/ >=20 --=20 http://ofb.net/~frederik/ |
From: Frederik E. <fre...@a5...> - 2006-08-17 00:49:32
Attachments:
hsql-patch-2
hsql-Makefile
|
I'm attaching a patch which I've tested. I'm also attaching a Makefile derived from Bulat's IIRC, it might be good to include it in those directories which contain a .cabal file. Thanks, Frederik On Thu, Aug 17, 2006 at 01:17:11AM +0100, Frederik Eaton wrote: > Hi, in >=20 > HSQL/Database/HSQL.hsc >=20 > instance SqlBind ClockTime where > ... >=20 > all of the 'fromSqlValue' functions convert with respect to the local > timezone, while 'toSqlValue' converts with respect to UTC. Thus the > values being written are not the same, it would seem, as those being > read. Certainly that is the case for me. >=20 > If the three appearances of currTZ within the body of that instance > (and not elsewhere) are changed to 0, it should fix the problem (but I > haven't tested). >=20 > Also, I don't understand why a custom function 'mkClockTime' has been > written in that module (it calls 'mktime' via FFI), rather than > calling the standard library function toClockTime which seems to do > the same thing. >=20 > Frederik >=20 > On Thu, Aug 10, 2006 at 04:19:36PM +0100, Frederik Eaton wrote: > > In HSQL, why are 'datetime' columns interpreted as being in the local > > timezone? > >=20 > > I would think that UTC would be more useful. If the local timezone is > > used, then it makes it more difficult to move a server between > > timezones, or to have multiple servers in multiple timezones. > >=20 > > Frederik > >=20 > > On Sat, Aug 05, 2006 at 06:59:21PM +0100, Frederik Eaton wrote: > > > Thanks! > > >=20 > > > On Sat, Aug 05, 2006 at 05:27:04PM +0200, Bjorn Bringert wrote: > > > > On Aug 5, 2006, at 3:34 PM, Frederik Eaton wrote: > > > >=20 > > > > >On Sat, Aug 05, 2006 at 11:15:19AM +0200, Bjorn Bringert wrote: > > > > >>On Jul 31, 2006, at 12:55 PM, Frederik Eaton wrote: > > > > >> > > > > >>>Hi, > > > > >>> > > > > >>>I'm attaching another HSQL patch. > > > > >>> > > > > >>>It allows users to specify a port number with the server name = in the > > > > >>>MySQL client. > > > > >>> > > > > >>>Frederik > > > > >> > > > > >>Hi Frederik, > > > > >> > > > > >>the patch doesn't apply cleanly against the current CVS version= . Is > > > > >>there any chance you could make a patch against the CVS version > > > > >>instead? > > > > > > > > > >It's a very simple modification, can't you just copy and paste f= rom > > > > >the patch? > > > >=20 > > > > It appears to have been a simple whitespace mismatch problem (tab= s in the original HSQL source). I=20 > > > > have committed your patch to CVS. > > > >=20 > > > > Thanks! > > > >=20 > > > > /Bj=F6rn --=20 http://ofb.net/~frederik/ |
From: Frederik E. <fre...@a5...> - 2006-08-17 21:10:50
Attachments:
hsql-patch-2b
|
Hi, Oops, sorry, there was a bug. Here's a more-tested patch. Stay tuned! (if you've already applied the last one, change HSQL.hsc's ctMonth =3D toEnum $ mon, to ctMonth =3D toEnum $ (mon-1), ) Frederik On Thu, Aug 17, 2006 at 01:49:40AM +0100, Frederik Eaton wrote: > I'm attaching a patch which I've tested. >=20 > I'm also attaching a Makefile derived from Bulat's IIRC, it might be > good to include it in those directories which contain a .cabal file. >=20 > Thanks, >=20 > Frederik >=20 > On Thu, Aug 17, 2006 at 01:17:11AM +0100, Frederik Eaton wrote: > > Hi, in > >=20 > > HSQL/Database/HSQL.hsc > >=20 > > instance SqlBind ClockTime where > > ... > >=20 > > all of the 'fromSqlValue' functions convert with respect to the local > > timezone, while 'toSqlValue' converts with respect to UTC. Thus the > > values being written are not the same, it would seem, as those being > > read. Certainly that is the case for me. > >=20 > > If the three appearances of currTZ within the body of that instance > > (and not elsewhere) are changed to 0, it should fix the problem (but = I > > haven't tested). > >=20 > > Also, I don't understand why a custom function 'mkClockTime' has been > > written in that module (it calls 'mktime' via FFI), rather than > > calling the standard library function toClockTime which seems to do > > the same thing. > >=20 > > Frederik > >=20 > > On Thu, Aug 10, 2006 at 04:19:36PM +0100, Frederik Eaton wrote: > > > In HSQL, why are 'datetime' columns interpreted as being in the loc= al > > > timezone? > > >=20 > > > I would think that UTC would be more useful. If the local timezone = is > > > used, then it makes it more difficult to move a server between > > > timezones, or to have multiple servers in multiple timezones. > > >=20 > > > Frederik > > >=20 > > > On Sat, Aug 05, 2006 at 06:59:21PM +0100, Frederik Eaton wrote: > > > > Thanks! > > > >=20 > > > > On Sat, Aug 05, 2006 at 05:27:04PM +0200, Bjorn Bringert wrote: > > > > > On Aug 5, 2006, at 3:34 PM, Frederik Eaton wrote: > > > > >=20 > > > > > >On Sat, Aug 05, 2006 at 11:15:19AM +0200, Bjorn Bringert wrote= : > > > > > >>On Jul 31, 2006, at 12:55 PM, Frederik Eaton wrote: > > > > > >> > > > > > >>>Hi, > > > > > >>> > > > > > >>>I'm attaching another HSQL patch. > > > > > >>> > > > > > >>>It allows users to specify a port number with the server nam= e in the > > > > > >>>MySQL client. > > > > > >>> > > > > > >>>Frederik > > > > > >> > > > > > >>Hi Frederik, > > > > > >> > > > > > >>the patch doesn't apply cleanly against the current CVS versi= on. Is > > > > > >>there any chance you could make a patch against the CVS versi= on > > > > > >>instead? > > > > > > > > > > > >It's a very simple modification, can't you just copy and paste= from > > > > > >the patch? > > > > >=20 > > > > > It appears to have been a simple whitespace mismatch problem (t= abs in the original HSQL source). I=20 > > > > > have committed your patch to CVS. > > > > >=20 > > > > > Thanks! > > > > >=20 > > > > > /Bj=F6rn >=20 > --=20 > http://ofb.net/~frederik/ > diff -ur HSQL-1.7-modified/HSQL/Database/HSQL.hsc HSQL-1.7-modified-2/H= SQL/Database/HSQL.hsc > --- HSQL-1.7-modified/HSQL/Database/HSQL.hsc 2005-12-15 20:57:18.000000= 000 +0000 > +++ HSQL-1.7-modified-2/HSQL/Database/HSQL.hsc 2006-08-17 01:43:19.0000= 00000 +0100 > @@ -304,28 +304,17 @@ > =20 > toSqlValue d =3D show d > =20 > -mkClockTime :: Int -> Int -> Int -> Int -> Int -> Int -> Int -> ClockT= ime > mkClockTime year mon mday hour min sec tz =3D > - unsafePerformIO $ do > - allocaBytes (#const sizeof(struct tm)) $ \ p_tm -> do > - (#poke struct tm,tm_sec ) p_tm (fromIntegral sec :: CInt) > - (#poke struct tm,tm_min ) p_tm (fromIntegral min :: CInt) > - (#poke struct tm,tm_hour ) p_tm (fromIntegral hour :: CInt) > - (#poke struct tm,tm_mday ) p_tm (fromIntegral mday :: CInt) > - (#poke struct tm,tm_mon ) p_tm (fromIntegral (mon-1) :: CInt) > - (#poke struct tm,tm_year ) p_tm (fromIntegral (year-1900) :: CInt) > - (#poke struct tm,tm_isdst) p_tm (-1 :: CInt) > - t <- mktime p_tm > -#if __GLASGOW_HASKELL__ >=3D 603 > - return (TOD (fromIntegral (fromEnum t) + fromIntegral (tz-currTZ)) = 0) > -#else > - return (TOD (fromIntegral t + fromIntegral (tz-currTZ)) 0) > -#endif > -foreign import ccall unsafe mktime :: Ptr () -> IO CTime > - > -{-# NOINLINE currTZ #-} > -currTZ :: Int > -currTZ =3D ctTZ (unsafePerformIO (getClockTime >>=3D toCalendarTime)) = -- Hack > + toClockTime $ CalendarTime { > + ctYear =3D year, > + ctMonth =3D toEnum $ mon, > + ctDay =3D mday, > + ctHour =3D hour, > + ctMin =3D min, > + ctSec =3D sec, > + ctPicosec =3D 0, > + ctTZ =3D tz > + } > =20 > parseTZ :: ReadP Int > parseTZ =3D (char '+' >> readDecP) `mplus` (char '-' >> fmap negate r= eadDecP) > @@ -373,14 +362,14 @@ > getTime :: ReadP ClockTime > getTime =3D do > (hour, minutes, seconds) <- readHMS > - return (mkClockTime 1970 1 1 hour minutes seconds currTZ) > + return (mkClockTime 1970 1 1 hour minutes seconds 0) > =20 > fromSqlValue SqlDate s =3D f_read getDate s > where > getDate :: ReadP ClockTime > getDate =3D do > (year, month, day) <- readYMD > - return (mkClockTime year month day 0 0 0 currTZ) > + return (mkClockTime year month day 0 0 0 0) > =20 > fromSqlValue SqlDateTimeTZ s =3D f_read getDateTimeTZ s > where > @@ -400,7 +389,7 @@ > getDateTime :: ReadP ClockTime > getDateTime =3D do > (year, month, day, hour, minutes, seconds) <- readDateTime > - return (mkClockTime year month day hour minutes seconds currTZ) > + return (mkClockTime year month day hour minutes seconds 0) > =20 > fromSqlValue _ _ =3D Nothing > =20 > # This Makefile is mostly a wrapper around Setup.hs for people who > # just want to type make. >=20 > CAS=3Drunhaskell Setup.lhs > CONFOPTS ?=3D --user --prefix=3D${HOME} > INSTOPTS ?=3D --user >=20 > all: build >=20 > configure: .setup-config > .setup-config: HSQL.cabal > ${CAS} configure ${CONFOPTS} >=20 > build: configure > ${CAS} build >=20 > install: build > ${CAS} install ${INSTOPTS} >=20 > uninstall: unregister > unregister: configure > ${CAS} unregister >=20 > clean: > -runhaskell Setup.hs clean > -rm -rf dist > -rm -f .setup-config >=20 > .PHONY: all configure build install uninstall unregister clean --=20 http://ofb.net/~frederik/ |
From: <bri...@cs...> - 2006-08-25 09:18:46
|
Sorry for the delay, I've been on vacation. The timezone patch has been=20 committed. I haven't added the Makefile, since I think that some cabal=20 tools that will come with GHC 6.6 could make it obsolete. /Bj=F6rn Frederik Eaton wrote: > Hi, >=20 > Oops, sorry, there was a bug. Here's a more-tested patch. Stay tuned! >=20 > (if you've already applied the last one, change HSQL.hsc's >=20 > ctMonth =3D toEnum $ mon, >=20 > to >=20 > ctMonth =3D toEnum $ (mon-1), >=20 > ) >=20 > Frederik >=20 > On Thu, Aug 17, 2006 at 01:49:40AM +0100, Frederik Eaton wrote: >=20 >>I'm attaching a patch which I've tested. >> >>I'm also attaching a Makefile derived from Bulat's IIRC, it might be >>good to include it in those directories which contain a .cabal file. >> >>Thanks, >> >>Frederik >> >>On Thu, Aug 17, 2006 at 01:17:11AM +0100, Frederik Eaton wrote: >> >>>Hi, in >>> >>>HSQL/Database/HSQL.hsc >>> >>>instance SqlBind ClockTime where >>>... >>> >>>all of the 'fromSqlValue' functions convert with respect to the local >>>timezone, while 'toSqlValue' converts with respect to UTC. Thus the >>>values being written are not the same, it would seem, as those being >>>read. Certainly that is the case for me. >>> >>>If the three appearances of currTZ within the body of that instance >>>(and not elsewhere) are changed to 0, it should fix the problem (but I >>>haven't tested). >>> >>>Also, I don't understand why a custom function 'mkClockTime' has been >>>written in that module (it calls 'mktime' via FFI), rather than >>>calling the standard library function toClockTime which seems to do >>>the same thing. >>> >>>Frederik >>> >>>On Thu, Aug 10, 2006 at 04:19:36PM +0100, Frederik Eaton wrote: >>> >>>>In HSQL, why are 'datetime' columns interpreted as being in the local >>>>timezone? >>>> >>>>I would think that UTC would be more useful. If the local timezone is >>>>used, then it makes it more difficult to move a server between >>>>timezones, or to have multiple servers in multiple timezones. >>>> >>>>Frederik >>>> >>>>On Sat, Aug 05, 2006 at 06:59:21PM +0100, Frederik Eaton wrote: >>>> >>>>>Thanks! >>>>> >>>>>On Sat, Aug 05, 2006 at 05:27:04PM +0200, Bjorn Bringert wrote: >>>>> >>>>>>On Aug 5, 2006, at 3:34 PM, Frederik Eaton wrote: >>>>>> >>>>>> >>>>>>>On Sat, Aug 05, 2006 at 11:15:19AM +0200, Bjorn Bringert wrote: >>>>>>> >>>>>>>>On Jul 31, 2006, at 12:55 PM, Frederik Eaton wrote: >>>>>>>> >>>>>>>> >>>>>>>>>Hi, >>>>>>>>> >>>>>>>>>I'm attaching another HSQL patch. >>>>>>>>> >>>>>>>>>It allows users to specify a port number with the server name in= the >>>>>>>>>MySQL client. >>>>>>>>> >>>>>>>>>Frederik >>>>>>>> >>>>>>>>Hi Frederik, >>>>>>>> >>>>>>>>the patch doesn't apply cleanly against the current CVS version. = Is >>>>>>>>there any chance you could make a patch against the CVS version >>>>>>>>instead? >>>>>>> >>>>>>>It's a very simple modification, can't you just copy and paste fro= m >>>>>>>the patch? >>>>>> >>>>>>It appears to have been a simple whitespace mismatch problem (tabs = in the original HSQL source). I=20 >>>>>>have committed your patch to CVS. >>>>>> >>>>>>Thanks! >>>>>> >>>>>>/Bj=F6rn >> >>--=20 >>http://ofb.net/~frederik/ >=20 >=20 >>diff -ur HSQL-1.7-modified/HSQL/Database/HSQL.hsc HSQL-1.7-modified-2/H= SQL/Database/HSQL.hsc >>--- HSQL-1.7-modified/HSQL/Database/HSQL.hsc 2005-12-15 20:57:18.000000= 000 +0000 >>+++ HSQL-1.7-modified-2/HSQL/Database/HSQL.hsc 2006-08-17 01:43:19.0000= 00000 +0100 >>@@ -304,28 +304,17 @@ >>=20 >> toSqlValue d =3D show d >>=20 >>-mkClockTime :: Int -> Int -> Int -> Int -> Int -> Int -> Int -> ClockT= ime >> mkClockTime year mon mday hour min sec tz =3D >>- unsafePerformIO $ do >>- allocaBytes (#const sizeof(struct tm)) $ \ p_tm -> do >>- (#poke struct tm,tm_sec ) p_tm (fromIntegral sec :: CInt) >>- (#poke struct tm,tm_min ) p_tm (fromIntegral min :: CInt) >>- (#poke struct tm,tm_hour ) p_tm (fromIntegral hour :: CInt) >>- (#poke struct tm,tm_mday ) p_tm (fromIntegral mday :: CInt) >>- (#poke struct tm,tm_mon ) p_tm (fromIntegral (mon-1) :: CInt) >>- (#poke struct tm,tm_year ) p_tm (fromIntegral (year-1900) :: CInt) >>- (#poke struct tm,tm_isdst) p_tm (-1 :: CInt) >>- t <- mktime p_tm >>-#if __GLASGOW_HASKELL__ >=3D 603 >>- return (TOD (fromIntegral (fromEnum t) + fromIntegral (tz-currTZ)) = 0) >>-#else >>- return (TOD (fromIntegral t + fromIntegral (tz-currTZ)) 0) >>-#endif >>-foreign import ccall unsafe mktime :: Ptr () -> IO CTime >>- >>-{-# NOINLINE currTZ #-} >>-currTZ :: Int >>-currTZ =3D ctTZ (unsafePerformIO (getClockTime >>=3D toCalendarTime)) = -- Hack >>+ toClockTime $ CalendarTime { >>+ ctYear =3D year, >>+ ctMonth =3D toEnum $ mon, >>+ ctDay =3D mday, >>+ ctHour =3D hour, >>+ ctMin =3D min, >>+ ctSec =3D sec, >>+ ctPicosec =3D 0, >>+ ctTZ =3D tz >>+ } >>=20 >> parseTZ :: ReadP Int >> parseTZ =3D (char '+' >> readDecP) `mplus` (char '-' >> fmap negate r= eadDecP) >>@@ -373,14 +362,14 @@ >> getTime :: ReadP ClockTime >> getTime =3D do >> (hour, minutes, seconds) <- readHMS >>- return (mkClockTime 1970 1 1 hour minutes seconds currTZ) >>+ return (mkClockTime 1970 1 1 hour minutes seconds 0) >>=20 >> fromSqlValue SqlDate s =3D f_read getDate s >> where >> getDate :: ReadP ClockTime >> getDate =3D do >> (year, month, day) <- readYMD >>- return (mkClockTime year month day 0 0 0 currTZ) >>+ return (mkClockTime year month day 0 0 0 0) >>=20 >> fromSqlValue SqlDateTimeTZ s =3D f_read getDateTimeTZ s >> where >>@@ -400,7 +389,7 @@ >> getDateTime :: ReadP ClockTime >> getDateTime =3D do >> (year, month, day, hour, minutes, seconds) <- readDateTime >>- return (mkClockTime year month day hour minutes seconds currTZ) >>+ return (mkClockTime year month day hour minutes seconds 0) >>=20 >> fromSqlValue _ _ =3D Nothing >>=20 >=20 >=20 >># This Makefile is mostly a wrapper around Setup.hs for people who >># just want to type make. >> >>CAS=3Drunhaskell Setup.lhs >>CONFOPTS ?=3D --user --prefix=3D${HOME} >>INSTOPTS ?=3D --user >> >>all: build >> >>configure: .setup-config >>.setup-config: HSQL.cabal >> ${CAS} configure ${CONFOPTS} >> >>build: configure >> ${CAS} build >> >>install: build >> ${CAS} install ${INSTOPTS} >> >>uninstall: unregister >>unregister: configure >> ${CAS} unregister >> >>clean: >> -runhaskell Setup.hs clean >> -rm -rf dist >> -rm -f .setup-config >> >>.PHONY: all configure build install uninstall unregister clean >=20 >=20 >=20 >=20 > -----------------------------------------------------------------------= - >=20 > diff -ur HSQL-1.7-modified/HSQL/Database/HSQL.hsc HSQL-1.7-modified-2/H= SQL/Database/HSQL.hsc > --- HSQL-1.7-modified/HSQL/Database/HSQL.hsc 2005-12-15 20:57:18.000000= 000 +0000 > +++ HSQL-1.7-modified-2/HSQL/Database/HSQL.hsc 2006-08-17 22:04:23.0000= 00000 +0100 > @@ -304,28 +304,17 @@ > =20 > toSqlValue d =3D show d > =20 > -mkClockTime :: Int -> Int -> Int -> Int -> Int -> Int -> Int -> ClockT= ime > mkClockTime year mon mday hour min sec tz =3D > - unsafePerformIO $ do > - allocaBytes (#const sizeof(struct tm)) $ \ p_tm -> do > - (#poke struct tm,tm_sec ) p_tm (fromIntegral sec :: CInt) > - (#poke struct tm,tm_min ) p_tm (fromIntegral min :: CInt) > - (#poke struct tm,tm_hour ) p_tm (fromIntegral hour :: CInt) > - (#poke struct tm,tm_mday ) p_tm (fromIntegral mday :: CInt) > - (#poke struct tm,tm_mon ) p_tm (fromIntegral (mon-1) :: CInt) > - (#poke struct tm,tm_year ) p_tm (fromIntegral (year-1900) :: CInt) > - (#poke struct tm,tm_isdst) p_tm (-1 :: CInt) > - t <- mktime p_tm > -#if __GLASGOW_HASKELL__ >=3D 603 > - return (TOD (fromIntegral (fromEnum t) + fromIntegral (tz-currTZ)) = 0) > -#else > - return (TOD (fromIntegral t + fromIntegral (tz-currTZ)) 0) > -#endif > -foreign import ccall unsafe mktime :: Ptr () -> IO CTime > - > -{-# NOINLINE currTZ #-} > -currTZ :: Int > -currTZ =3D ctTZ (unsafePerformIO (getClockTime >>=3D toCalendarTime)) = -- Hack > + toClockTime $ CalendarTime { > + ctYear =3D year, > + ctMonth =3D toEnum $ (mon-1), > + ctDay =3D mday, > + ctHour =3D hour, > + ctMin =3D min, > + ctSec =3D sec, > + ctPicosec =3D 0, > + ctTZ =3D tz > + } > =20 > parseTZ :: ReadP Int > parseTZ =3D (char '+' >> readDecP) `mplus` (char '-' >> fmap negate r= eadDecP) > @@ -373,14 +362,14 @@ > getTime :: ReadP ClockTime > getTime =3D do > (hour, minutes, seconds) <- readHMS > - return (mkClockTime 1970 1 1 hour minutes seconds currTZ) > + return (mkClockTime 1970 1 1 hour minutes seconds 0) > =20 > fromSqlValue SqlDate s =3D f_read getDate s > where > getDate :: ReadP ClockTime > getDate =3D do > (year, month, day) <- readYMD > - return (mkClockTime year month day 0 0 0 currTZ) > + return (mkClockTime year month day 0 0 0 0) > =20 > fromSqlValue SqlDateTimeTZ s =3D f_read getDateTimeTZ s > where > @@ -400,7 +389,7 @@ > getDateTime :: ReadP ClockTime > getDateTime =3D do > (year, month, day, hour, minutes, seconds) <- readDateTime > - return (mkClockTime year month day hour minutes seconds currTZ) > + return (mkClockTime year month day hour minutes seconds 0) > =20 > fromSqlValue _ _ =3D Nothing > =20 >=20 >=20 > -----------------------------------------------------------------------= - >=20 > -----------------------------------------------------------------------= -- > Using Tomcat but need to do more? Need to support web services, securit= y? > Get stuff done quickly with pre-integrated technology to make your job = easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geron= imo > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat= =3D121642 >=20 >=20 > -----------------------------------------------------------------------= - >=20 > _______________________________________________ > htoolkit-users mailing list > hto...@li... > https://lists.sourceforge.net/lists/listinfo/htoolkit-users |
From: Frederik E. <fre...@a5...> - 2006-08-25 15:05:27
|
On Fri, Aug 25, 2006 at 11:20:55AM +0200, Bj=F6rn Bringert wrote: > Sorry for the delay, I've been on vacation. The timezone patch has been= committed.=20 Thanks. > I haven't added the Makefile, since I think that some cabal tools > that will come with GHC 6.6 could make it obsolete. I haven't heard of these, but I doubt that anything is going to be incompatible with the use of a makefile. The Makefile just runs the commands that you ask people to run, except that it figures out when 'runhaskell Setup.lhs configure' isn't necessary - and of course, it's much more concise to use. But you know better than I do. Frederik > Frederik Eaton wrote: > >Hi, > >Oops, sorry, there was a bug. Here's a more-tested patch. Stay tuned! > >(if you've already applied the last one, change HSQL.hsc's > > ctMonth =3D toEnum $ mon, > >to > > ctMonth =3D toEnum $ (mon-1), > >) > >Frederik > >On Thu, Aug 17, 2006 at 01:49:40AM +0100, Frederik Eaton wrote: > >>I'm attaching a patch which I've tested. > >> > >>I'm also attaching a Makefile derived from Bulat's IIRC, it might be > >>good to include it in those directories which contain a .cabal file. > >> > >>Thanks, > >> > >>Frederik > >> > >>On Thu, Aug 17, 2006 at 01:17:11AM +0100, Frederik Eaton wrote: > >> > >>>Hi, in > >>> > >>>HSQL/Database/HSQL.hsc > >>> > >>>instance SqlBind ClockTime where > >>>... > >>> > >>>all of the 'fromSqlValue' functions convert with respect to the loca= l > >>>timezone, while 'toSqlValue' converts with respect to UTC. Thus the > >>>values being written are not the same, it would seem, as those being > >>>read. Certainly that is the case for me. > >>> > >>>If the three appearances of currTZ within the body of that instance > >>>(and not elsewhere) are changed to 0, it should fix the problem (but= I > >>>haven't tested). > >>> > >>>Also, I don't understand why a custom function 'mkClockTime' has bee= n > >>>written in that module (it calls 'mktime' via FFI), rather than > >>>calling the standard library function toClockTime which seems to do > >>>the same thing. > >>> > >>>Frederik > >>> > >>>On Thu, Aug 10, 2006 at 04:19:36PM +0100, Frederik Eaton wrote: > >>> > >>>>In HSQL, why are 'datetime' columns interpreted as being in the loc= al > >>>>timezone? > >>>> > >>>>I would think that UTC would be more useful. If the local timezone = is > >>>>used, then it makes it more difficult to move a server between > >>>>timezones, or to have multiple servers in multiple timezones. > >>>> > >>>>Frederik > >>>> > >>>>On Sat, Aug 05, 2006 at 06:59:21PM +0100, Frederik Eaton wrote: > >>>> > >>>>>Thanks! > >>>>> > >>>>>On Sat, Aug 05, 2006 at 05:27:04PM +0200, Bjorn Bringert wrote: > >>>>> > >>>>>>On Aug 5, 2006, at 3:34 PM, Frederik Eaton wrote: > >>>>>> > >>>>>> > >>>>>>>On Sat, Aug 05, 2006 at 11:15:19AM +0200, Bjorn Bringert wrote: > >>>>>>> > >>>>>>>>On Jul 31, 2006, at 12:55 PM, Frederik Eaton wrote: > >>>>>>>> > >>>>>>>> > >>>>>>>>>Hi, > >>>>>>>>> > >>>>>>>>>I'm attaching another HSQL patch. > >>>>>>>>> > >>>>>>>>>It allows users to specify a port number with the server name = in the > >>>>>>>>>MySQL client. > >>>>>>>>> > >>>>>>>>>Frederik > >>>>>>>> > >>>>>>>>Hi Frederik, > >>>>>>>> > >>>>>>>>the patch doesn't apply cleanly against the current CVS version= . Is > >>>>>>>>there any chance you could make a patch against the CVS version > >>>>>>>>instead? > >>>>>>> > >>>>>>>It's a very simple modification, can't you just copy and paste f= rom > >>>>>>>the patch? > >>>>>> > >>>>>>It appears to have been a simple whitespace mismatch problem (tab= s in the original HSQL=20 > >>>>>>source). I have committed your patch to CVS. > >>>>>> > >>>>>>Thanks! > >>>>>> > >>>>>>/Bj=F6rn > >> > >>--=20 > >>http://ofb.net/~frederik/ > >>diff -ur HSQL-1.7-modified/HSQL/Database/HSQL.hsc HSQL-1.7-modified-2= /HSQL/Database/HSQL.hsc > >>--- HSQL-1.7-modified/HSQL/Database/HSQL.hsc 2005-12-15 20:57:18.0000= 00000 +0000 > >>+++ HSQL-1.7-modified-2/HSQL/Database/HSQL.hsc 2006-08-17 01:43:19.00= 0000000 +0100 > >>@@ -304,28 +304,17 @@ > >> toSqlValue d =3D show d > >>-mkClockTime :: Int -> Int -> Int -> Int -> Int -> Int -> Int -> Cloc= kTime > >>mkClockTime year mon mday hour min sec tz =3D > >>- unsafePerformIO $ do > >>- allocaBytes (#const sizeof(struct tm)) $ \ p_tm -> do > >>- (#poke struct tm,tm_sec ) p_tm (fromIntegral sec :: CInt) > >>- (#poke struct tm,tm_min ) p_tm (fromIntegral min :: CInt) > >>- (#poke struct tm,tm_hour ) p_tm (fromIntegral hour :: CInt) > >>- (#poke struct tm,tm_mday ) p_tm (fromIntegral mday :: CInt) > >>- (#poke struct tm,tm_mon ) p_tm (fromIntegral (mon-1) :: CInt) > >>- (#poke struct tm,tm_year ) p_tm (fromIntegral (year-1900) :: CInt= ) > >>- (#poke struct tm,tm_isdst) p_tm (-1 :: CInt) > >>- t <- mktime p_tm > >>-#if __GLASGOW_HASKELL__ >=3D 603 > >>- return (TOD (fromIntegral (fromEnum t) + fromIntegral (tz-currTZ)= ) 0) > >>-#else > >>- return (TOD (fromIntegral t + fromIntegral (tz-currTZ)) 0) > >>-#endif > >>-foreign import ccall unsafe mktime :: Ptr () -> IO CTime > >>- > >>-{-# NOINLINE currTZ #-} > >>-currTZ :: Int > >>-currTZ =3D ctTZ (unsafePerformIO (getClockTime >>=3D toCalendarTime)= ) -- Hack > >>+ toClockTime $ CalendarTime { > >>+ ctYear =3D year, > >>+ ctMonth =3D toEnum $ mon, > >>+ ctDay =3D mday, > >>+ ctHour =3D hour, > >>+ ctMin =3D min, > >>+ ctSec =3D sec, > >>+ ctPicosec =3D 0, > >>+ ctTZ =3D tz > >>+ } > >>parseTZ :: ReadP Int > >>parseTZ =3D (char '+' >> readDecP) `mplus` (char '-' >> fmap negate = readDecP) > >>@@ -373,14 +362,14 @@ > >> getTime :: ReadP ClockTime > >> getTime =3D do > >> (hour, minutes, seconds) <- readHMS > >>- return (mkClockTime 1970 1 1 hour minutes seconds currTZ) > >>+ return (mkClockTime 1970 1 1 hour minutes seconds 0) > >> fromSqlValue SqlDate s =3D f_read getDate s > >> where > >> getDate :: ReadP ClockTime > >> getDate =3D do > >> (year, month, day) <- readYMD > >>- return (mkClockTime year month day 0 0 0 currTZ) > >>+ return (mkClockTime year month day 0 0 0 0) > >> fromSqlValue SqlDateTimeTZ s =3D f_read getDateTimeTZ s > >> where > >>@@ -400,7 +389,7 @@ > >> getDateTime :: ReadP ClockTime > >> getDateTime =3D do > >> (year, month, day, hour, minutes, seconds) <- readDateTime > >>- return (mkClockTime year month day hour minutes seconds currTZ) > >>+ return (mkClockTime year month day hour minutes seconds 0) > >> fromSqlValue _ _ =3D Nothing > >># This Makefile is mostly a wrapper around Setup.hs for people who > >># just want to type make. > >> > >>CAS=3Drunhaskell Setup.lhs > >>CONFOPTS ?=3D --user --prefix=3D${HOME} > >>INSTOPTS ?=3D --user > >> > >>all: build > >> > >>configure: .setup-config > >>.setup-config: HSQL.cabal > >> ${CAS} configure ${CONFOPTS} > >> > >>build: configure > >> ${CAS} build > >> > >>install: build > >> ${CAS} install ${INSTOPTS} > >> > >>uninstall: unregister > >>unregister: configure > >> ${CAS} unregister > >> > >>clean: > >> -runhaskell Setup.hs clean > >> -rm -rf dist > >> -rm -f .setup-config > >> > >>.PHONY: all configure build install uninstall unregister clean > >----------------------------------------------------------------------= -- > >diff -ur HSQL-1.7-modified/HSQL/Database/HSQL.hsc HSQL-1.7-modified-2/= HSQL/Database/HSQL.hsc > >--- HSQL-1.7-modified/HSQL/Database/HSQL.hsc 2005-12-15 20:57:18.00000= 0000 +0000 > >+++ HSQL-1.7-modified-2/HSQL/Database/HSQL.hsc 2006-08-17 22:04:23.000= 000000 +0100 > >@@ -304,28 +304,17 @@ > > toSqlValue d =3D show d > > -mkClockTime :: Int -> Int -> Int -> Int -> Int -> Int -> Int -> Cloc= kTime > > mkClockTime year mon mday hour min sec tz =3D > >- unsafePerformIO $ do > >- allocaBytes (#const sizeof(struct tm)) $ \ p_tm -> do > >- (#poke struct tm,tm_sec ) p_tm (fromIntegral sec :: CInt) > >- (#poke struct tm,tm_min ) p_tm (fromIntegral min :: CInt) > >- (#poke struct tm,tm_hour ) p_tm (fromIntegral hour :: CInt) > >- (#poke struct tm,tm_mday ) p_tm (fromIntegral mday :: CInt) > >- (#poke struct tm,tm_mon ) p_tm (fromIntegral (mon-1) :: CInt) > >- (#poke struct tm,tm_year ) p_tm (fromIntegral (year-1900) :: CInt) > >- (#poke struct tm,tm_isdst) p_tm (-1 :: CInt) > >- t <- mktime p_tm > >-#if __GLASGOW_HASKELL__ >=3D 603 > >- return (TOD (fromIntegral (fromEnum t) + fromIntegral (tz-currTZ))= 0) > >-#else > >- return (TOD (fromIntegral t + fromIntegral (tz-currTZ)) 0) > >-#endif > >-foreign import ccall unsafe mktime :: Ptr () -> IO CTime > >- > >-{-# NOINLINE currTZ #-} > >-currTZ :: Int > >-currTZ =3D ctTZ (unsafePerformIO (getClockTime >>=3D toCalendarTime))= -- Hack > >+ toClockTime $ CalendarTime { > >+ ctYear =3D year, > >+ ctMonth =3D toEnum $ (mon-1), > >+ ctDay =3D mday, > >+ ctHour =3D hour, > >+ ctMin =3D min, > >+ ctSec =3D sec, > >+ ctPicosec =3D 0, > >+ ctTZ =3D tz > >+ } > > parseTZ :: ReadP Int > > parseTZ =3D (char '+' >> readDecP) `mplus` (char '-' >> fmap negate = readDecP) > >@@ -373,14 +362,14 @@ > > getTime :: ReadP ClockTime > > getTime =3D do > > (hour, minutes, seconds) <- readHMS > >- return (mkClockTime 1970 1 1 hour minutes seconds currTZ) > >+ return (mkClockTime 1970 1 1 hour minutes seconds 0) > > fromSqlValue SqlDate s =3D f_read getDate s > > where > > getDate :: ReadP ClockTime > > getDate =3D do > > (year, month, day) <- readYMD > >- return (mkClockTime year month day 0 0 0 currTZ) > >+ return (mkClockTime year month day 0 0 0 0) > > fromSqlValue SqlDateTimeTZ s =3D f_read getDateTimeTZ s > > where > >@@ -400,7 +389,7 @@ > > getDateTime :: ReadP ClockTime > > getDateTime =3D do > > (year, month, day, hour, minutes, seconds) <- readDateTime > >- return (mkClockTime year month day hour minutes seconds currTZ) > >+ return (mkClockTime year month day hour minutes seconds 0) > > fromSqlValue _ _ =3D Nothing > > ---------------------------------------------------------------------= --- > >----------------------------------------------------------------------= --- > >Using Tomcat but need to do more? Need to support web services, securi= ty? > >Get stuff done quickly with pre-integrated technology to make your job= easier > >Download IBM WebSphere Application Server v.1.0.1 based on Apache Gero= nimo > >http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&da= t=3D121642 > >----------------------------------------------------------------------= -- > >_______________________________________________ > >htoolkit-users mailing list > >hto...@li... > >https://lists.sourceforge.net/lists/listinfo/htoolkit-users >=20 --=20 http://ofb.net/~frederik/ |
From: Frederik E. <fre...@a5...> - 2007-03-03 17:35:13
|
Hi Bjorn, The sourceforge page for HSQL shows a most recent release date of December 15, 2005 - over a year ago, presumably not including the timezone patch which I think fixes a rather serious bug, which caused a lot of problems for me when I tried to use HSQL for my master's project. Perhaps it might be helpful to other users if the fix were made available to them as well? Thanks, Frederik On Fri, Aug 25, 2006 at 11:20:55AM +0200, Björn Bringert wrote: > Sorry for the delay, I've been on vacation. The timezone patch has been > committed. I haven't added the Makefile, since I think that some cabal > tools that will come with GHC 6.6 could make it obsolete. > > /Björn > > Frederik Eaton wrote: > > Hi, > > > > Oops, sorry, there was a bug. Here's a more-tested patch. Stay tuned! > > > > (if you've already applied the last one, change HSQL.hsc's > > > > ctMonth = toEnum $ mon, > > > > to > > > > ctMonth = toEnum $ (mon-1), > > > > ) > > > > Frederik > > > > On Thu, Aug 17, 2006 at 01:49:40AM +0100, Frederik Eaton wrote: > > > >>I'm attaching a patch which I've tested. > >> > >>I'm also attaching a Makefile derived from Bulat's IIRC, it might be > >>good to include it in those directories which contain a .cabal file. > >> > >>Thanks, > >> > >>Frederik > >> > >>On Thu, Aug 17, 2006 at 01:17:11AM +0100, Frederik Eaton wrote: > >> > >>>Hi, in > >>> > >>>HSQL/Database/HSQL.hsc > >>> > >>>instance SqlBind ClockTime where > >>>... > >>> > >>>all of the 'fromSqlValue' functions convert with respect to the local > >>>timezone, while 'toSqlValue' converts with respect to UTC. Thus the > >>>values being written are not the same, it would seem, as those being > >>>read. Certainly that is the case for me. > >>> > >>>If the three appearances of currTZ within the body of that instance > >>>(and not elsewhere) are changed to 0, it should fix the problem (but I > >>>haven't tested). > >>> > >>>Also, I don't understand why a custom function 'mkClockTime' has been > >>>written in that module (it calls 'mktime' via FFI), rather than > >>>calling the standard library function toClockTime which seems to do > >>>the same thing. > >>> > >>>Frederik > >>> > >>>On Thu, Aug 10, 2006 at 04:19:36PM +0100, Frederik Eaton wrote: > >>> > >>>>In HSQL, why are 'datetime' columns interpreted as being in the local > >>>>timezone? > >>>> > >>>>I would think that UTC would be more useful. If the local timezone is > >>>>used, then it makes it more difficult to move a server between > >>>>timezones, or to have multiple servers in multiple timezones. > >>>> > >>>>Frederik > >>>> > >>>>On Sat, Aug 05, 2006 at 06:59:21PM +0100, Frederik Eaton wrote: > >>>> > >>>>>Thanks! > >>>>> > >>>>>On Sat, Aug 05, 2006 at 05:27:04PM +0200, Bjorn Bringert wrote: > >>>>> > >>>>>>On Aug 5, 2006, at 3:34 PM, Frederik Eaton wrote: > >>>>>> > >>>>>> > >>>>>>>On Sat, Aug 05, 2006 at 11:15:19AM +0200, Bjorn Bringert wrote: > >>>>>>> > >>>>>>>>On Jul 31, 2006, at 12:55 PM, Frederik Eaton wrote: > >>>>>>>> > >>>>>>>> > >>>>>>>>>Hi, > >>>>>>>>> > >>>>>>>>>I'm attaching another HSQL patch. > >>>>>>>>> > >>>>>>>>>It allows users to specify a port number with the server name in the > >>>>>>>>>MySQL client. > >>>>>>>>> > >>>>>>>>>Frederik > >>>>>>>> > >>>>>>>>Hi Frederik, > >>>>>>>> > >>>>>>>>the patch doesn't apply cleanly against the current CVS version. Is > >>>>>>>>there any chance you could make a patch against the CVS version > >>>>>>>>instead? > >>>>>>> > >>>>>>>It's a very simple modification, can't you just copy and paste from > >>>>>>>the patch? > >>>>>> > >>>>>>It appears to have been a simple whitespace mismatch problem (tabs in the original HSQL source). I > >>>>>>have committed your patch to CVS. > >>>>>> > >>>>>>Thanks! > >>>>>> > >>>>>>/Björn > >> > >>-- > >>http://ofb.net/~frederik/ > > > > > >>diff -ur HSQL-1.7-modified/HSQL/Database/HSQL.hsc HSQL-1.7-modified-2/HSQL/Database/HSQL.hsc > >>--- HSQL-1.7-modified/HSQL/Database/HSQL.hsc 2005-12-15 20:57:18.000000000 +0000 > >>+++ HSQL-1.7-modified-2/HSQL/Database/HSQL.hsc 2006-08-17 01:43:19.000000000 +0100 > >>@@ -304,28 +304,17 @@ > >> > >> toSqlValue d = show d > >> > >>-mkClockTime :: Int -> Int -> Int -> Int -> Int -> Int -> Int -> ClockTime > >> mkClockTime year mon mday hour min sec tz = > >>- unsafePerformIO $ do > >>- allocaBytes (#const sizeof(struct tm)) $ \ p_tm -> do > >>- (#poke struct tm,tm_sec ) p_tm (fromIntegral sec :: CInt) > >>- (#poke struct tm,tm_min ) p_tm (fromIntegral min :: CInt) > >>- (#poke struct tm,tm_hour ) p_tm (fromIntegral hour :: CInt) > >>- (#poke struct tm,tm_mday ) p_tm (fromIntegral mday :: CInt) > >>- (#poke struct tm,tm_mon ) p_tm (fromIntegral (mon-1) :: CInt) > >>- (#poke struct tm,tm_year ) p_tm (fromIntegral (year-1900) :: CInt) > >>- (#poke struct tm,tm_isdst) p_tm (-1 :: CInt) > >>- t <- mktime p_tm > >>-#if __GLASGOW_HASKELL__ >= 603 > >>- return (TOD (fromIntegral (fromEnum t) + fromIntegral (tz-currTZ)) 0) > >>-#else > >>- return (TOD (fromIntegral t + fromIntegral (tz-currTZ)) 0) > >>-#endif > >>-foreign import ccall unsafe mktime :: Ptr () -> IO CTime > >>- > >>-{-# NOINLINE currTZ #-} > >>-currTZ :: Int > >>-currTZ = ctTZ (unsafePerformIO (getClockTime >>= toCalendarTime)) -- Hack > >>+ toClockTime $ CalendarTime { > >>+ ctYear = year, > >>+ ctMonth = toEnum $ mon, > >>+ ctDay = mday, > >>+ ctHour = hour, > >>+ ctMin = min, > >>+ ctSec = sec, > >>+ ctPicosec = 0, > >>+ ctTZ = tz > >>+ } > >> > >> parseTZ :: ReadP Int > >> parseTZ = (char '+' >> readDecP) `mplus` (char '-' >> fmap negate readDecP) > >>@@ -373,14 +362,14 @@ > >> getTime :: ReadP ClockTime > >> getTime = do > >> (hour, minutes, seconds) <- readHMS > >>- return (mkClockTime 1970 1 1 hour minutes seconds currTZ) > >>+ return (mkClockTime 1970 1 1 hour minutes seconds 0) > >> > >> fromSqlValue SqlDate s = f_read getDate s > >> where > >> getDate :: ReadP ClockTime > >> getDate = do > >> (year, month, day) <- readYMD > >>- return (mkClockTime year month day 0 0 0 currTZ) > >>+ return (mkClockTime year month day 0 0 0 0) > >> > >> fromSqlValue SqlDateTimeTZ s = f_read getDateTimeTZ s > >> where > >>@@ -400,7 +389,7 @@ > >> getDateTime :: ReadP ClockTime > >> getDateTime = do > >> (year, month, day, hour, minutes, seconds) <- readDateTime > >>- return (mkClockTime year month day hour minutes seconds currTZ) > >>+ return (mkClockTime year month day hour minutes seconds 0) > >> > >> fromSqlValue _ _ = Nothing > >> > > > > > >># This Makefile is mostly a wrapper around Setup.hs for people who > >># just want to type make. > >> > >>CAS=runhaskell Setup.lhs > >>CONFOPTS ?= --user --prefix=${HOME} > >>INSTOPTS ?= --user > >> > >>all: build > >> > >>configure: .setup-config > >>.setup-config: HSQL.cabal > >> ${CAS} configure ${CONFOPTS} > >> > >>build: configure > >> ${CAS} build > >> > >>install: build > >> ${CAS} install ${INSTOPTS} > >> > >>uninstall: unregister > >>unregister: configure > >> ${CAS} unregister > >> > >>clean: > >> -runhaskell Setup.hs clean > >> -rm -rf dist > >> -rm -f .setup-config > >> > >>.PHONY: all configure build install uninstall unregister clean > > > > > > > > > > ------------------------------------------------------------------------ > > > > diff -ur HSQL-1.7-modified/HSQL/Database/HSQL.hsc HSQL-1.7-modified-2/HSQL/Database/HSQL.hsc > > --- HSQL-1.7-modified/HSQL/Database/HSQL.hsc 2005-12-15 20:57:18.000000000 +0000 > > +++ HSQL-1.7-modified-2/HSQL/Database/HSQL.hsc 2006-08-17 22:04:23.000000000 +0100 > > @@ -304,28 +304,17 @@ > > > > toSqlValue d = show d > > > > -mkClockTime :: Int -> Int -> Int -> Int -> Int -> Int -> Int -> ClockTime > > mkClockTime year mon mday hour min sec tz = > > - unsafePerformIO $ do > > - allocaBytes (#const sizeof(struct tm)) $ \ p_tm -> do > > - (#poke struct tm,tm_sec ) p_tm (fromIntegral sec :: CInt) > > - (#poke struct tm,tm_min ) p_tm (fromIntegral min :: CInt) > > - (#poke struct tm,tm_hour ) p_tm (fromIntegral hour :: CInt) > > - (#poke struct tm,tm_mday ) p_tm (fromIntegral mday :: CInt) > > - (#poke struct tm,tm_mon ) p_tm (fromIntegral (mon-1) :: CInt) > > - (#poke struct tm,tm_year ) p_tm (fromIntegral (year-1900) :: CInt) > > - (#poke struct tm,tm_isdst) p_tm (-1 :: CInt) > > - t <- mktime p_tm > > -#if __GLASGOW_HASKELL__ >= 603 > > - return (TOD (fromIntegral (fromEnum t) + fromIntegral (tz-currTZ)) 0) > > -#else > > - return (TOD (fromIntegral t + fromIntegral (tz-currTZ)) 0) > > -#endif > > -foreign import ccall unsafe mktime :: Ptr () -> IO CTime > > - > > -{-# NOINLINE currTZ #-} > > -currTZ :: Int > > -currTZ = ctTZ (unsafePerformIO (getClockTime >>= toCalendarTime)) -- Hack > > + toClockTime $ CalendarTime { > > + ctYear = year, > > + ctMonth = toEnum $ (mon-1), > > + ctDay = mday, > > + ctHour = hour, > > + ctMin = min, > > + ctSec = sec, > > + ctPicosec = 0, > > + ctTZ = tz > > + } > > > > parseTZ :: ReadP Int > > parseTZ = (char '+' >> readDecP) `mplus` (char '-' >> fmap negate readDecP) > > @@ -373,14 +362,14 @@ > > getTime :: ReadP ClockTime > > getTime = do > > (hour, minutes, seconds) <- readHMS > > - return (mkClockTime 1970 1 1 hour minutes seconds currTZ) > > + return (mkClockTime 1970 1 1 hour minutes seconds 0) > > > > fromSqlValue SqlDate s = f_read getDate s > > where > > getDate :: ReadP ClockTime > > getDate = do > > (year, month, day) <- readYMD > > - return (mkClockTime year month day 0 0 0 currTZ) > > + return (mkClockTime year month day 0 0 0 0) > > > > fromSqlValue SqlDateTimeTZ s = f_read getDateTimeTZ s > > where > > @@ -400,7 +389,7 @@ > > getDateTime :: ReadP ClockTime > > getDateTime = do > > (year, month, day, hour, minutes, seconds) <- readDateTime > > - return (mkClockTime year month day hour minutes seconds currTZ) > > + return (mkClockTime year month day hour minutes seconds 0) > > > > fromSqlValue _ _ = Nothing > > > > > > > > ------------------------------------------------------------------------ > > > > ------------------------------------------------------------------------- > > Using Tomcat but need to do more? Need to support web services, security? > > Get stuff done quickly with pre-integrated technology to make your job easier > > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > > > > > > ------------------------------------------------------------------------ > > > > _______________________________________________ > > htoolkit-users mailing list > > hto...@li... > > https://lists.sourceforge.net/lists/listinfo/htoolkit-users > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > htoolkit-users mailing list > hto...@li... > https://lists.sourceforge.net/lists/listinfo/htoolkit-users > -- http://ofb.net/~frederik/ |
From: <bri...@cs...> - 2007-03-25 16:55:26
|
I found this very old mail in my inbox, sorry for not responding sooner. Yeah, a new HSQL release would be a good idea, IMO. Krasimir is the maintainer, so it's really up to him. /Björn Frederik Eaton wrote: > Hi Bjorn, > > The sourceforge page for HSQL shows a most recent release date of > December 15, 2005 - over a year ago, presumably not including the > timezone patch which I think fixes a rather serious bug, which caused > a lot of problems for me when I tried to use HSQL for my master's > project. Perhaps it might be helpful to other users if the fix were > made available to them as well? > > Thanks, > > Frederik > > On Fri, Aug 25, 2006 at 11:20:55AM +0200, Björn Bringert wrote: >> Sorry for the delay, I've been on vacation. The timezone patch has been >> committed. I haven't added the Makefile, since I think that some cabal >> tools that will come with GHC 6.6 could make it obsolete. >> >> /Björn >> >> Frederik Eaton wrote: >>> Hi, >>> >>> Oops, sorry, there was a bug. Here's a more-tested patch. Stay tuned! >>> >>> (if you've already applied the last one, change HSQL.hsc's >>> >>> ctMonth = toEnum $ mon, >>> >>> to >>> >>> ctMonth = toEnum $ (mon-1), >>> >>> ) >>> >>> Frederik >>> >>> On Thu, Aug 17, 2006 at 01:49:40AM +0100, Frederik Eaton wrote: >>> >>>> I'm attaching a patch which I've tested. >>>> >>>> I'm also attaching a Makefile derived from Bulat's IIRC, it might be >>>> good to include it in those directories which contain a .cabal file. >>>> >>>> Thanks, >>>> >>>> Frederik >>>> >>>> On Thu, Aug 17, 2006 at 01:17:11AM +0100, Frederik Eaton wrote: >>>> >>>>> Hi, in >>>>> >>>>> HSQL/Database/HSQL.hsc >>>>> >>>>> instance SqlBind ClockTime where >>>>> ... >>>>> >>>>> all of the 'fromSqlValue' functions convert with respect to the local >>>>> timezone, while 'toSqlValue' converts with respect to UTC. Thus the >>>>> values being written are not the same, it would seem, as those being >>>>> read. Certainly that is the case for me. >>>>> >>>>> If the three appearances of currTZ within the body of that instance >>>>> (and not elsewhere) are changed to 0, it should fix the problem (but I >>>>> haven't tested). >>>>> >>>>> Also, I don't understand why a custom function 'mkClockTime' has been >>>>> written in that module (it calls 'mktime' via FFI), rather than >>>>> calling the standard library function toClockTime which seems to do >>>>> the same thing. >>>>> >>>>> Frederik >>>>> >>>>> On Thu, Aug 10, 2006 at 04:19:36PM +0100, Frederik Eaton wrote: >>>>> >>>>>> In HSQL, why are 'datetime' columns interpreted as being in the local >>>>>> timezone? >>>>>> >>>>>> I would think that UTC would be more useful. If the local timezone is >>>>>> used, then it makes it more difficult to move a server between >>>>>> timezones, or to have multiple servers in multiple timezones. >>>>>> >>>>>> Frederik >>>>>> >>>>>> On Sat, Aug 05, 2006 at 06:59:21PM +0100, Frederik Eaton wrote: >>>>>> >>>>>>> Thanks! >>>>>>> >>>>>>> On Sat, Aug 05, 2006 at 05:27:04PM +0200, Bjorn Bringert wrote: >>>>>>> >>>>>>>> On Aug 5, 2006, at 3:34 PM, Frederik Eaton wrote: >>>>>>>> >>>>>>>> >>>>>>>>> On Sat, Aug 05, 2006 at 11:15:19AM +0200, Bjorn Bringert wrote: >>>>>>>>> >>>>>>>>>> On Jul 31, 2006, at 12:55 PM, Frederik Eaton wrote: >>>>>>>>>> >>>>>>>>>> >>>>>>>>>>> Hi, >>>>>>>>>>> >>>>>>>>>>> I'm attaching another HSQL patch. >>>>>>>>>>> >>>>>>>>>>> It allows users to specify a port number with the server name in the >>>>>>>>>>> MySQL client. >>>>>>>>>>> >>>>>>>>>>> Frederik >>>>>>>>>> Hi Frederik, >>>>>>>>>> >>>>>>>>>> the patch doesn't apply cleanly against the current CVS version. Is >>>>>>>>>> there any chance you could make a patch against the CVS version >>>>>>>>>> instead? >>>>>>>>> It's a very simple modification, can't you just copy and paste from >>>>>>>>> the patch? >>>>>>>> It appears to have been a simple whitespace mismatch problem (tabs in the original HSQL source). I >>>>>>>> have committed your patch to CVS. >>>>>>>> >>>>>>>> Thanks! >>>>>>>> >>>>>>>> /Björn >>>> -- >>>> http://ofb.net/~frederik/ >>> >>>> diff -ur HSQL-1.7-modified/HSQL/Database/HSQL.hsc HSQL-1.7-modified-2/HSQL/Database/HSQL.hsc >>>> --- HSQL-1.7-modified/HSQL/Database/HSQL.hsc 2005-12-15 20:57:18.000000000 +0000 >>>> +++ HSQL-1.7-modified-2/HSQL/Database/HSQL.hsc 2006-08-17 01:43:19.000000000 +0100 >>>> @@ -304,28 +304,17 @@ >>>> >>>> toSqlValue d = show d >>>> >>>> -mkClockTime :: Int -> Int -> Int -> Int -> Int -> Int -> Int -> ClockTime >>>> mkClockTime year mon mday hour min sec tz = >>>> - unsafePerformIO $ do >>>> - allocaBytes (#const sizeof(struct tm)) $ \ p_tm -> do >>>> - (#poke struct tm,tm_sec ) p_tm (fromIntegral sec :: CInt) >>>> - (#poke struct tm,tm_min ) p_tm (fromIntegral min :: CInt) >>>> - (#poke struct tm,tm_hour ) p_tm (fromIntegral hour :: CInt) >>>> - (#poke struct tm,tm_mday ) p_tm (fromIntegral mday :: CInt) >>>> - (#poke struct tm,tm_mon ) p_tm (fromIntegral (mon-1) :: CInt) >>>> - (#poke struct tm,tm_year ) p_tm (fromIntegral (year-1900) :: CInt) >>>> - (#poke struct tm,tm_isdst) p_tm (-1 :: CInt) >>>> - t <- mktime p_tm >>>> -#if __GLASGOW_HASKELL__ >= 603 >>>> - return (TOD (fromIntegral (fromEnum t) + fromIntegral (tz-currTZ)) 0) >>>> -#else >>>> - return (TOD (fromIntegral t + fromIntegral (tz-currTZ)) 0) >>>> -#endif >>>> -foreign import ccall unsafe mktime :: Ptr () -> IO CTime >>>> - >>>> -{-# NOINLINE currTZ #-} >>>> -currTZ :: Int >>>> -currTZ = ctTZ (unsafePerformIO (getClockTime >>= toCalendarTime)) -- Hack >>>> + toClockTime $ CalendarTime { >>>> + ctYear = year, >>>> + ctMonth = toEnum $ mon, >>>> + ctDay = mday, >>>> + ctHour = hour, >>>> + ctMin = min, >>>> + ctSec = sec, >>>> + ctPicosec = 0, >>>> + ctTZ = tz >>>> + } >>>> >>>> parseTZ :: ReadP Int >>>> parseTZ = (char '+' >> readDecP) `mplus` (char '-' >> fmap negate readDecP) >>>> @@ -373,14 +362,14 @@ >>>> getTime :: ReadP ClockTime >>>> getTime = do >>>> (hour, minutes, seconds) <- readHMS >>>> - return (mkClockTime 1970 1 1 hour minutes seconds currTZ) >>>> + return (mkClockTime 1970 1 1 hour minutes seconds 0) >>>> >>>> fromSqlValue SqlDate s = f_read getDate s >>>> where >>>> getDate :: ReadP ClockTime >>>> getDate = do >>>> (year, month, day) <- readYMD >>>> - return (mkClockTime year month day 0 0 0 currTZ) >>>> + return (mkClockTime year month day 0 0 0 0) >>>> >>>> fromSqlValue SqlDateTimeTZ s = f_read getDateTimeTZ s >>>> where >>>> @@ -400,7 +389,7 @@ >>>> getDateTime :: ReadP ClockTime >>>> getDateTime = do >>>> (year, month, day, hour, minutes, seconds) <- readDateTime >>>> - return (mkClockTime year month day hour minutes seconds currTZ) >>>> + return (mkClockTime year month day hour minutes seconds 0) >>>> >>>> fromSqlValue _ _ = Nothing >>>> >>> >>>> # This Makefile is mostly a wrapper around Setup.hs for people who >>>> # just want to type make. >>>> >>>> CAS=runhaskell Setup.lhs >>>> CONFOPTS ?= --user --prefix=${HOME} >>>> INSTOPTS ?= --user >>>> >>>> all: build >>>> >>>> configure: .setup-config >>>> .setup-config: HSQL.cabal >>>> ${CAS} configure ${CONFOPTS} >>>> >>>> build: configure >>>> ${CAS} build >>>> >>>> install: build >>>> ${CAS} install ${INSTOPTS} >>>> >>>> uninstall: unregister >>>> unregister: configure >>>> ${CAS} unregister >>>> >>>> clean: >>>> -runhaskell Setup.hs clean >>>> -rm -rf dist >>>> -rm -f .setup-config >>>> >>>> .PHONY: all configure build install uninstall unregister clean >>> >>> >>> >>> ------------------------------------------------------------------------ >>> >>> diff -ur HSQL-1.7-modified/HSQL/Database/HSQL.hsc HSQL-1.7-modified-2/HSQL/Database/HSQL.hsc >>> --- HSQL-1.7-modified/HSQL/Database/HSQL.hsc 2005-12-15 20:57:18.000000000 +0000 >>> +++ HSQL-1.7-modified-2/HSQL/Database/HSQL.hsc 2006-08-17 22:04:23.000000000 +0100 >>> @@ -304,28 +304,17 @@ >>> >>> toSqlValue d = show d >>> >>> -mkClockTime :: Int -> Int -> Int -> Int -> Int -> Int -> Int -> ClockTime >>> mkClockTime year mon mday hour min sec tz = >>> - unsafePerformIO $ do >>> - allocaBytes (#const sizeof(struct tm)) $ \ p_tm -> do >>> - (#poke struct tm,tm_sec ) p_tm (fromIntegral sec :: CInt) >>> - (#poke struct tm,tm_min ) p_tm (fromIntegral min :: CInt) >>> - (#poke struct tm,tm_hour ) p_tm (fromIntegral hour :: CInt) >>> - (#poke struct tm,tm_mday ) p_tm (fromIntegral mday :: CInt) >>> - (#poke struct tm,tm_mon ) p_tm (fromIntegral (mon-1) :: CInt) >>> - (#poke struct tm,tm_year ) p_tm (fromIntegral (year-1900) :: CInt) >>> - (#poke struct tm,tm_isdst) p_tm (-1 :: CInt) >>> - t <- mktime p_tm >>> -#if __GLASGOW_HASKELL__ >= 603 >>> - return (TOD (fromIntegral (fromEnum t) + fromIntegral (tz-currTZ)) 0) >>> -#else >>> - return (TOD (fromIntegral t + fromIntegral (tz-currTZ)) 0) >>> -#endif >>> -foreign import ccall unsafe mktime :: Ptr () -> IO CTime >>> - >>> -{-# NOINLINE currTZ #-} >>> -currTZ :: Int >>> -currTZ = ctTZ (unsafePerformIO (getClockTime >>= toCalendarTime)) -- Hack >>> + toClockTime $ CalendarTime { >>> + ctYear = year, >>> + ctMonth = toEnum $ (mon-1), >>> + ctDay = mday, >>> + ctHour = hour, >>> + ctMin = min, >>> + ctSec = sec, >>> + ctPicosec = 0, >>> + ctTZ = tz >>> + } >>> >>> parseTZ :: ReadP Int >>> parseTZ = (char '+' >> readDecP) `mplus` (char '-' >> fmap negate readDecP) >>> @@ -373,14 +362,14 @@ >>> getTime :: ReadP ClockTime >>> getTime = do >>> (hour, minutes, seconds) <- readHMS >>> - return (mkClockTime 1970 1 1 hour minutes seconds currTZ) >>> + return (mkClockTime 1970 1 1 hour minutes seconds 0) >>> >>> fromSqlValue SqlDate s = f_read getDate s >>> where >>> getDate :: ReadP ClockTime >>> getDate = do >>> (year, month, day) <- readYMD >>> - return (mkClockTime year month day 0 0 0 currTZ) >>> + return (mkClockTime year month day 0 0 0 0) >>> >>> fromSqlValue SqlDateTimeTZ s = f_read getDateTimeTZ s >>> where >>> @@ -400,7 +389,7 @@ >>> getDateTime :: ReadP ClockTime >>> getDateTime = do >>> (year, month, day, hour, minutes, seconds) <- readDateTime >>> - return (mkClockTime year month day hour minutes seconds currTZ) >>> + return (mkClockTime year month day hour minutes seconds 0) >>> >>> fromSqlValue _ _ = Nothing |
From: Frederik E. <fre...@a5...> - 2008-01-20 04:47:04
|
Hello all, Is there going to be a new maintainer for HSQL? I have submitted a number of patches to fix some painful bugs. It's been almost a year since my previous enquiry and the last release was December 15, 2005, over two years ago: https://sourceforge.net/project/showfiles.php?group_id=65248 The software no longer compiles with the latest version of GHC, due to some (seemingly gratuitous) changes in the Cabal libraries (I see there is a September 2007 thread on libraries@). Unfortunately, I am too busy to maintain it myself; I was probably even too busy to write the patches in the first place, but it is sad to see them go to waste... Frederik P.S. Quan Ta: regarding your July 20, 2006 query, "HSQL-MySQL: non-standard port", my first patch adds the ability to specify a non-standard port with the server host name, if you are still interested I can send it. On Sun, Mar 25, 2007 at 06:55:21PM +0200, Björn Bringert wrote: > I found this very old mail in my inbox, sorry for not responding sooner. > Yeah, a new HSQL release would be a good idea, IMO. Krasimir is the > maintainer, so it's really up to him. > > /Björn > > Frederik Eaton wrote: > > Hi Bjorn, > > > > The sourceforge page for HSQL shows a most recent release date of > > December 15, 2005 - over a year ago, presumably not including the > > timezone patch which I think fixes a rather serious bug, which caused > > a lot of problems for me when I tried to use HSQL for my master's > > project. Perhaps it might be helpful to other users if the fix were > > made available to them as well? > > > > Thanks, > > > > Frederik > > > > On Fri, Aug 25, 2006 at 11:20:55AM +0200, Björn Bringert wrote: > >> Sorry for the delay, I've been on vacation. The timezone patch has been > >> committed. I haven't added the Makefile, since I think that some cabal > >> tools that will come with GHC 6.6 could make it obsolete. > >> > >> /Björn > >> > >> Frederik Eaton wrote: > >>> Hi, > >>> > >>> Oops, sorry, there was a bug. Here's a more-tested patch. Stay tuned! > >>> > >>> (if you've already applied the last one, change HSQL.hsc's > >>> > >>> ctMonth = toEnum $ mon, > >>> > >>> to > >>> > >>> ctMonth = toEnum $ (mon-1), > >>> > >>> ) > >>> > >>> Frederik > >>> > >>> On Thu, Aug 17, 2006 at 01:49:40AM +0100, Frederik Eaton wrote: > >>> > >>>> I'm attaching a patch which I've tested. > >>>> > >>>> I'm also attaching a Makefile derived from Bulat's IIRC, it might be > >>>> good to include it in those directories which contain a .cabal file. > >>>> > >>>> Thanks, > >>>> > >>>> Frederik > >>>> > >>>> On Thu, Aug 17, 2006 at 01:17:11AM +0100, Frederik Eaton wrote: > >>>> > >>>>> Hi, in > >>>>> > >>>>> HSQL/Database/HSQL.hsc > >>>>> > >>>>> instance SqlBind ClockTime where > >>>>> ... > >>>>> > >>>>> all of the 'fromSqlValue' functions convert with respect to the local > >>>>> timezone, while 'toSqlValue' converts with respect to UTC. Thus the > >>>>> values being written are not the same, it would seem, as those being > >>>>> read. Certainly that is the case for me. > >>>>> > >>>>> If the three appearances of currTZ within the body of that instance > >>>>> (and not elsewhere) are changed to 0, it should fix the problem (but I > >>>>> haven't tested). > >>>>> > >>>>> Also, I don't understand why a custom function 'mkClockTime' has been > >>>>> written in that module (it calls 'mktime' via FFI), rather than > >>>>> calling the standard library function toClockTime which seems to do > >>>>> the same thing. > >>>>> > >>>>> Frederik > >>>>> > >>>>> On Thu, Aug 10, 2006 at 04:19:36PM +0100, Frederik Eaton wrote: > >>>>> > >>>>>> In HSQL, why are 'datetime' columns interpreted as being in the local > >>>>>> timezone? > >>>>>> > >>>>>> I would think that UTC would be more useful. If the local timezone is > >>>>>> used, then it makes it more difficult to move a server between > >>>>>> timezones, or to have multiple servers in multiple timezones. > >>>>>> > >>>>>> Frederik > >>>>>> > >>>>>> On Sat, Aug 05, 2006 at 06:59:21PM +0100, Frederik Eaton wrote: > >>>>>> > >>>>>>> Thanks! > >>>>>>> > >>>>>>> On Sat, Aug 05, 2006 at 05:27:04PM +0200, Bjorn Bringert wrote: > >>>>>>> > >>>>>>>> On Aug 5, 2006, at 3:34 PM, Frederik Eaton wrote: > >>>>>>>> > >>>>>>>> > >>>>>>>>> On Sat, Aug 05, 2006 at 11:15:19AM +0200, Bjorn Bringert wrote: > >>>>>>>>> > >>>>>>>>>> On Jul 31, 2006, at 12:55 PM, Frederik Eaton wrote: > >>>>>>>>>> > >>>>>>>>>> > >>>>>>>>>>> Hi, > >>>>>>>>>>> > >>>>>>>>>>> I'm attaching another HSQL patch. > >>>>>>>>>>> > >>>>>>>>>>> It allows users to specify a port number with the server name in the > >>>>>>>>>>> MySQL client. > >>>>>>>>>>> > >>>>>>>>>>> Frederik > >>>>>>>>>> Hi Frederik, > >>>>>>>>>> > >>>>>>>>>> the patch doesn't apply cleanly against the current CVS version. Is > >>>>>>>>>> there any chance you could make a patch against the CVS version > >>>>>>>>>> instead? > >>>>>>>>> It's a very simple modification, can't you just copy and paste from > >>>>>>>>> the patch? > >>>>>>>> It appears to have been a simple whitespace mismatch problem (tabs in the original HSQL source). I > >>>>>>>> have committed your patch to CVS. > >>>>>>>> > >>>>>>>> Thanks! > >>>>>>>> > >>>>>>>> /Björn > >>>> -- > >>>> http://ofb.net/~frederik/ > >>> > >>>> diff -ur HSQL-1.7-modified/HSQL/Database/HSQL.hsc HSQL-1.7-modified-2/HSQL/Database/HSQL.hsc > >>>> --- HSQL-1.7-modified/HSQL/Database/HSQL.hsc 2005-12-15 20:57:18.000000000 +0000 > >>>> +++ HSQL-1.7-modified-2/HSQL/Database/HSQL.hsc 2006-08-17 01:43:19.000000000 +0100 > >>>> @@ -304,28 +304,17 @@ > >>>> > >>>> toSqlValue d = show d > >>>> > >>>> -mkClockTime :: Int -> Int -> Int -> Int -> Int -> Int -> Int -> ClockTime > >>>> mkClockTime year mon mday hour min sec tz = > >>>> - unsafePerformIO $ do > >>>> - allocaBytes (#const sizeof(struct tm)) $ \ p_tm -> do > >>>> - (#poke struct tm,tm_sec ) p_tm (fromIntegral sec :: CInt) > >>>> - (#poke struct tm,tm_min ) p_tm (fromIntegral min :: CInt) > >>>> - (#poke struct tm,tm_hour ) p_tm (fromIntegral hour :: CInt) > >>>> - (#poke struct tm,tm_mday ) p_tm (fromIntegral mday :: CInt) > >>>> - (#poke struct tm,tm_mon ) p_tm (fromIntegral (mon-1) :: CInt) > >>>> - (#poke struct tm,tm_year ) p_tm (fromIntegral (year-1900) :: CInt) > >>>> - (#poke struct tm,tm_isdst) p_tm (-1 :: CInt) > >>>> - t <- mktime p_tm > >>>> -#if __GLASGOW_HASKELL__ >= 603 > >>>> - return (TOD (fromIntegral (fromEnum t) + fromIntegral (tz-currTZ)) 0) > >>>> -#else > >>>> - return (TOD (fromIntegral t + fromIntegral (tz-currTZ)) 0) > >>>> -#endif > >>>> -foreign import ccall unsafe mktime :: Ptr () -> IO CTime > >>>> - > >>>> -{-# NOINLINE currTZ #-} > >>>> -currTZ :: Int > >>>> -currTZ = ctTZ (unsafePerformIO (getClockTime >>= toCalendarTime)) -- Hack > >>>> + toClockTime $ CalendarTime { > >>>> + ctYear = year, > >>>> + ctMonth = toEnum $ mon, > >>>> + ctDay = mday, > >>>> + ctHour = hour, > >>>> + ctMin = min, > >>>> + ctSec = sec, > >>>> + ctPicosec = 0, > >>>> + ctTZ = tz > >>>> + } > >>>> > >>>> parseTZ :: ReadP Int > >>>> parseTZ = (char '+' >> readDecP) `mplus` (char '-' >> fmap negate readDecP) > >>>> @@ -373,14 +362,14 @@ > >>>> getTime :: ReadP ClockTime > >>>> getTime = do > >>>> (hour, minutes, seconds) <- readHMS > >>>> - return (mkClockTime 1970 1 1 hour minutes seconds currTZ) > >>>> + return (mkClockTime 1970 1 1 hour minutes seconds 0) > >>>> > >>>> fromSqlValue SqlDate s = f_read getDate s > >>>> where > >>>> getDate :: ReadP ClockTime > >>>> getDate = do > >>>> (year, month, day) <- readYMD > >>>> - return (mkClockTime year month day 0 0 0 currTZ) > >>>> + return (mkClockTime year month day 0 0 0 0) > >>>> > >>>> fromSqlValue SqlDateTimeTZ s = f_read getDateTimeTZ s > >>>> where > >>>> @@ -400,7 +389,7 @@ > >>>> getDateTime :: ReadP ClockTime > >>>> getDateTime = do > >>>> (year, month, day, hour, minutes, seconds) <- readDateTime > >>>> - return (mkClockTime year month day hour minutes seconds currTZ) > >>>> + return (mkClockTime year month day hour minutes seconds 0) > >>>> > >>>> fromSqlValue _ _ = Nothing > >>>> > >>> > >>>> # This Makefile is mostly a wrapper around Setup.hs for people who > >>>> # just want to type make. > >>>> > >>>> CAS=runhaskell Setup.lhs > >>>> CONFOPTS ?= --user --prefix=${HOME} > >>>> INSTOPTS ?= --user > >>>> > >>>> all: build > >>>> > >>>> configure: .setup-config > >>>> .setup-config: HSQL.cabal > >>>> ${CAS} configure ${CONFOPTS} > >>>> > >>>> build: configure > >>>> ${CAS} build > >>>> > >>>> install: build > >>>> ${CAS} install ${INSTOPTS} > >>>> > >>>> uninstall: unregister > >>>> unregister: configure > >>>> ${CAS} unregister > >>>> > >>>> clean: > >>>> -runhaskell Setup.hs clean > >>>> -rm -rf dist > >>>> -rm -f .setup-config > >>>> > >>>> .PHONY: all configure build install uninstall unregister clean > >>> > >>> > >>> > >>> ------------------------------------------------------------------------ > >>> > >>> diff -ur HSQL-1.7-modified/HSQL/Database/HSQL.hsc HSQL-1.7-modified-2/HSQL/Database/HSQL.hsc > >>> --- HSQL-1.7-modified/HSQL/Database/HSQL.hsc 2005-12-15 20:57:18.000000000 +0000 > >>> +++ HSQL-1.7-modified-2/HSQL/Database/HSQL.hsc 2006-08-17 22:04:23.000000000 +0100 > >>> @@ -304,28 +304,17 @@ > >>> > >>> toSqlValue d = show d > >>> > >>> -mkClockTime :: Int -> Int -> Int -> Int -> Int -> Int -> Int -> ClockTime > >>> mkClockTime year mon mday hour min sec tz = > >>> - unsafePerformIO $ do > >>> - allocaBytes (#const sizeof(struct tm)) $ \ p_tm -> do > >>> - (#poke struct tm,tm_sec ) p_tm (fromIntegral sec :: CInt) > >>> - (#poke struct tm,tm_min ) p_tm (fromIntegral min :: CInt) > >>> - (#poke struct tm,tm_hour ) p_tm (fromIntegral hour :: CInt) > >>> - (#poke struct tm,tm_mday ) p_tm (fromIntegral mday :: CInt) > >>> - (#poke struct tm,tm_mon ) p_tm (fromIntegral (mon-1) :: CInt) > >>> - (#poke struct tm,tm_year ) p_tm (fromIntegral (year-1900) :: CInt) > >>> - (#poke struct tm,tm_isdst) p_tm (-1 :: CInt) > >>> - t <- mktime p_tm > >>> -#if __GLASGOW_HASKELL__ >= 603 > >>> - return (TOD (fromIntegral (fromEnum t) + fromIntegral (tz-currTZ)) 0) > >>> -#else > >>> - return (TOD (fromIntegral t + fromIntegral (tz-currTZ)) 0) > >>> -#endif > >>> -foreign import ccall unsafe mktime :: Ptr () -> IO CTime > >>> - > >>> -{-# NOINLINE currTZ #-} > >>> -currTZ :: Int > >>> -currTZ = ctTZ (unsafePerformIO (getClockTime >>= toCalendarTime)) -- Hack > >>> + toClockTime $ CalendarTime { > >>> + ctYear = year, > >>> + ctMonth = toEnum $ (mon-1), > >>> + ctDay = mday, > >>> + ctHour = hour, > >>> + ctMin = min, > >>> + ctSec = sec, > >>> + ctPicosec = 0, > >>> + ctTZ = tz > >>> + } > >>> > >>> parseTZ :: ReadP Int > >>> parseTZ = (char '+' >> readDecP) `mplus` (char '-' >> fmap negate readDecP) > >>> @@ -373,14 +362,14 @@ > >>> getTime :: ReadP ClockTime > >>> getTime = do > >>> (hour, minutes, seconds) <- readHMS > >>> - return (mkClockTime 1970 1 1 hour minutes seconds currTZ) > >>> + return (mkClockTime 1970 1 1 hour minutes seconds 0) > >>> > >>> fromSqlValue SqlDate s = f_read getDate s > >>> where > >>> getDate :: ReadP ClockTime > >>> getDate = do > >>> (year, month, day) <- readYMD > >>> - return (mkClockTime year month day 0 0 0 currTZ) > >>> + return (mkClockTime year month day 0 0 0 0) > >>> > >>> fromSqlValue SqlDateTimeTZ s = f_read getDateTimeTZ s > >>> where > >>> @@ -400,7 +389,7 @@ > >>> getDateTime :: ReadP ClockTime > >>> getDateTime = do > >>> (year, month, day, hour, minutes, seconds) <- readDateTime > >>> - return (mkClockTime year month day hour minutes seconds currTZ) > >>> + return (mkClockTime year month day hour minutes seconds 0) > >>> > >>> fromSqlValue _ _ = Nothing > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > htoolkit-users mailing list > hto...@li... > https://lists.sourceforge.net/lists/listinfo/htoolkit-users > -- http://ofb.net/~frederik/ |
From: Duncan C. <dun...@wo...> - 2008-01-20 12:46:31
|
On Sun, 2008-01-20 at 04:46 +0000, Frederik Eaton wrote: > Hello all, > > Is there going to be a new maintainer for HSQL? I have submitted a > number of patches to fix some painful bugs. It's been almost a year > since my previous enquiry and the last release was December 15, 2005, > over two years ago: > > https://sourceforge.net/project/showfiles.php?group_id=65248 > > The software no longer compiles with the latest version of GHC, due to > some (seemingly gratuitous) changes in the Cabal libraries (I see > there is a September 2007 thread on libraries@). Unfortunately, I am > too busy to maintain it myself; I was probably even too busy to write > the patches in the first place, but it is sad to see them go to > waste... Gentoo has patches to make hsql-* build with ghc-6.8.x which you or any volunteer maintainer may find useful. Duncan |
From: Bryan O'S. <bo...@se...> - 2008-01-20 05:05:37
|
Frederik Eaton wrote: > Is there going to be a new maintainer for HSQL? I have submitted a > number of patches to fix some painful bugs. It's been almost a year > since my previous enquiry and the last release was December 15, 2005, > over two years ago: I think that if it's sat moribund for this long, you could reasonably declare yourself the maintainer by fiat. Some OSS communities have a formal process for declaring packages as orphaned, but I don't think we're big enough for that. If you don't mind the idea of taking the HSQL package over, perhaps you should follow the same steps Don did with the X11 package: * declare your intention to take over in a message to libraries@ * wait a week for someone to pop up with an objection * if nobody does, upload a new release with your fixes to Hackage <b |
From: Krasimir A. <kr....@gm...> - 2008-01-20 10:18:14
|
Hi Frederik and Bryan, The latest darcs repository for HSQL is here: http://darcs.haskell.org/HSQL/ I have to admit that I didn't have enough energy to maintain the HSQL in the last two years. If someone voluntee to take the HSQL maintaince then he is highly welcome. There are some new features like prepared statements and large binary objects that aren't completed/tested yet and this should be done before the next official release. Best regards, Krasimir On 1/20/08, Bryan O'Sullivan <bo...@se...> wrote: > Frederik Eaton wrote: > > > Is there going to be a new maintainer for HSQL? I have submitted a > > number of patches to fix some painful bugs. It's been almost a year > > since my previous enquiry and the last release was December 15, 2005, > > over two years ago: > > I think that if it's sat moribund for this long, you could reasonably > declare yourself the maintainer by fiat. Some OSS communities have a > formal process for declaring packages as orphaned, but I don't think > we're big enough for that. > > If you don't mind the idea of taking the HSQL package over, perhaps you > should follow the same steps Don did with the X11 package: > > * declare your intention to take over in a message to libraries@ > * wait a week for someone to pop up with an objection > * if nobody does, upload a new release with your fixes to Hackage > > <b > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > htoolkit-users mailing list > hto...@li... > https://lists.sourceforge.net/lists/listinfo/htoolkit-users > |
From: Frederik E. <fre...@a5...> - 2008-01-25 11:15:32
|
Hello all, I don't mind maintaining HSQL, if no one else will do it, but I'm not really an ideal person since I don't use the library in my current work. Any other takers? I'll wait a few days and see if someone else is interested... Best regards, Frederik On Sun, Jan 20, 2008 at 11:18:12AM +0100, Krasimir Angelov wrote: > Hi Frederik and Bryan, > > The latest darcs repository for HSQL is here: > > http://darcs.haskell.org/HSQL/ > > I have to admit that I didn't have enough energy to maintain the HSQL > in the last two years. If someone voluntee to take the HSQL maintaince > then he is highly welcome. There are some new features like prepared > statements and large binary objects that aren't completed/tested yet > and this should be done before the next official release. > > Best regards, > Krasimir > > > > On 1/20/08, Bryan O'Sullivan <bo...@se...> wrote: > > Frederik Eaton wrote: > > > > > Is there going to be a new maintainer for HSQL? I have submitted a > > > number of patches to fix some painful bugs. It's been almost a year > > > since my previous enquiry and the last release was December 15, 2005, > > > over two years ago: > > > > I think that if it's sat moribund for this long, you could reasonably > > declare yourself the maintainer by fiat. Some OSS communities have a > > formal process for declaring packages as orphaned, but I don't think > > we're big enough for that. > > > > If you don't mind the idea of taking the HSQL package over, perhaps you > > should follow the same steps Don did with the X11 package: > > > > * declare your intention to take over in a message to libraries@ > > * wait a week for someone to pop up with an objection > > * if nobody does, upload a new release with your fixes to Hackage > > > > <b > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by: Microsoft > > Defy all challenges. Microsoft(R) Visual Studio 2008. > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > _______________________________________________ > > htoolkit-users mailing list > > hto...@li... > > https://lists.sourceforge.net/lists/listinfo/htoolkit-users > > > _______________________________________________ > Libraries mailing list > Lib...@ha... > http://www.haskell.org/mailman/listinfo/libraries > -- http://ofb.net/~frederik/ |
From: Frederik E. <fre...@a5...> - 2008-02-17 21:30:05
|
Hello, I was trying to apply my patches to the HSQL, and I noticed that Bjorn has already applied them (thanks!) in 2006, and they are visible at http://darcs.haskell.org/HSQL/ I even have emails where he tells me that he applied them to CVS, sorry for missing that! However, there is still the problem that new users who search for "HSQL haskell" will find the following sourceforge page much higher in their search results than the darcs.haskell.org URL: http://htoolkit.sourceforge.net/ and they will be directed to download the buggy, two-year-old HSQL-1.7: https://sourceforge.net/project/showfiles.php?group_id=65248 rather than the latest version at http://darcs.haskell.org/HSQL/. I have tried to find out the answers to the following questions from Krasimir and then Duncan, but no response: 1. How do we get rid of the defunct HSQL versions at sourceforge.net? 2. How does one push patches to http://darcs.haskell.org/HSQL/? Who maintains that version? At this point, it seems #1 is more important than #2, since all the patches I care about have been committed to the darcs version and the darcs version compiles with the latest GHC/Cabal... Thanks, Frederik -- http://ofb.net/~frederik/ |
From: Duncan C. <dun...@wo...> - 2008-02-18 00:10:31
|
On Sun, 2008-02-17 at 21:30 +0000, Frederik Eaton wrote: > Hello, > > I was trying to apply my patches to the HSQL, and I noticed that Bjorn > has already applied them (thanks!) in 2006, and they are visible at > > http://darcs.haskell.org/HSQL/ > > I even have emails where he tells me that he applied them to CVS, > sorry for missing that! > > However, there is still the problem that new users who search for > "HSQL haskell" will find the following sourceforge page much higher in > their search results than the darcs.haskell.org URL: > > http://htoolkit.sourceforge.net/ > > and they will be directed to download the buggy, two-year-old > HSQL-1.7: > > https://sourceforge.net/project/showfiles.php?group_id=65248 > > rather than the latest version at http://darcs.haskell.org/HSQL/. > > I have tried to find out the answers to the following questions from > Krasimir and then Duncan, but no response: Yeah, sorry, forgot. > 1. How do we get rid of the defunct HSQL versions at sourceforge.net? You can ask Krasimir to add you as a project admin. This seems the most straightforward option. In the extreme case, SourceForge do have procedures to transfer projects when their maintainers disappear but that does not seem necessary at this stage. > 2. How does one push patches to http://darcs.haskell.org/HSQL/? Who > maintains that version? Have the darcs motd redirect to a new repo on code.haskell.org. You can ask someone to do this for you. So the old one will remain but be clearly marked as defunct. > At this point, it seems #1 is more important than #2, since all the > patches I care about have been committed to the darcs version and the > darcs version compiles with the latest GHC/Cabal... Then all you need is a release on hackage that works :-) Duncan |
From: Krasimir A. <kr....@gm...> - 2008-02-18 09:28:58
|
> > 1. How do we get rid of the defunct HSQL versions at sourceforge.net? > > You can ask Krasimir to add you as a project admin. This seems the most > straightforward option. In the extreme case, SourceForge do have > procedures to transfer projects when their maintainers disappear but > that does not seem necessary at this stage. If you give me Sourceforge account I will add you. > > 2. How does one push patches to http://darcs.haskell.org/HSQL/? Who > > maintains that version? Don't anyone with SSH key have a write permission to the repository? Regards, Krasimir |
From: Duncan C. <dun...@wo...> - 2008-02-18 09:47:30
|
On Mon, 2008-02-18 at 10:28 +0100, Krasimir Angelov wrote: > > > 1. How do we get rid of the defunct HSQL versions at sourceforge.net? > > > > You can ask Krasimir to add you as a project admin. This seems the most > > straightforward option. In the extreme case, SourceForge do have > > procedures to transfer projects when their maintainers disappear but > > that does not seem necessary at this stage. > > If you give me Sourceforge account I will add you. Just to be clear, it's Frederik Eaton who would like to take over maintenance. > > > 2. How does one push patches to http://darcs.haskell.org/HSQL/? Who > > > maintains that version? > > Don't anyone with SSH key have a write permission to the repository? That's true, however new accounts are not being given out so Frederik Eaton would not easily be able to get an account. The obvious choice therefore is to copy the repo to code.haskell.org. Duncan |