From: Justin B. <jgb...@gm...> - 2012-04-17 23:59:57
|
Thanks for your bug report and patch. I will apply it as soon as I can, but that might be a while. If you wish to submit a patch that rolls the version number of haskell-hdbc and updates the dependency on HDBC, I'd be glad to apply it right away. Out of curiousity, how are you using HaskellDB? How did you find it?/ On Tue, Apr 17, 2012 at 1:26 AM, Kei HIBINO <ex8...@gm...> wrote: > > Hi. > > I want to report a bug. > > Sorry, not to use trac tickets. > I couldn't receive trac's address verification mails. > > I'm trying haskelldb-hdbc-2.1.0 with HDBC-2.3.1. > I noticed HDBC's new versions no longer converts column names to lower case > > https://github.com/hdbc/hdbc/commit/23f82c23d41ec11decff0c3851fedc1437a7ef28 > > which breaks hdbcGetValue in Database/HaskellDB/HDBC.hs . > I made a small naive patch to avoid this problem below this. > > Regards. > > > > --- haskelldb-hdbc-2.1.0.orig/Database/HaskellDB/HDBC.hs > +++ haskelldb-hdbc-2.1.0/Database/HaskellDB/HDBC.hs > @@ -171,8 +171,14 @@ hdbcPrimQuery conn sql scheme rel = > do > stmt <- handleSqlError $ HDBC.prepare conn sql > handleSqlError $ HDBC.execute stmt [] > - rows <- HDBC.fetchAllRowsMap stmt > - mapM (getRec hdbcGetInstances rel scheme) rows > + rows <- fetchLowerAllRowsAL stmt > + mapM (getRec hdbcGetInstances rel scheme) $ map Map.fromList rows > + where fetchLowerAllRowsAL sth = > + do names <- map wordToLower `fmap` getColumnNames sth > + rows <- fetchAllRows sth > + return $ map (zip names) rows > + wordToLower = map toLower > + > > -- | Primitive execute > hdbcPrimExecute :: (IConnection conn) => conn -- ^ Database connection. |