|
From: Jeremy S. <jer...@li...> - 2004-02-29 02:15:22
|
Hello,
I don't know if this has been fixed yet -- I am using the nightly tarball from 2004-02-23.
When I try to insert a date into a mysql database, the SQL string looks like:
INSERT INTO table1 (id,
date)
VALUES (1,
2004-February-27 12:0:0)
MySQL does not like this and returns an error. I had to make two
changes to make it happy:
(1) put quotes around the date string
(2) use the number 2 instead of the word February
Here is a simple patch.
--- orig/src/Query.hs
+++ mod/src/Query.hs
@@ -306,8 +306,8 @@
instance ShowConstant CalendarTime where
showConstant (CalendarTime {ctYear = y, ctMonth = mo, ctDay = d,
ctHour = h, ctMin = mi, ctSec = s})
- = (show y)++"-"++(show mo)++"-"++(show d)++" "++
- (show h)++":"++(show mi)++":"++(show s)
+ = "\"" ++ (show y)++"-"++(show ((fromEnum mo) + 1))++"-"++(show d)++" "++
+ (show h)++":"++(show mi)++":"++(show s)++"\""
instance ShowConstant a => ShowConstant (Maybe a) where
Jeremy Shaw.
|