From: Kei H. <ex8...@gm...> - 2012-04-18 06:59:32
|
In the message "Re: HDBC >= 2.2.7.0 breaks haskelldb-hdbc " <CABPxb2=k=u3G...@ma...> Justin Bailey wrote: > 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. I appreciate your consideration. I think this change is portable for older HDBC versions too. > Out of curiousity, how are you using HaskellDB? How did you find it?/ I'm using IBM DB2 client driver over unixODBC with haskelldb-hdbc-odbc. Default behavior of DB2 river returns upper-case field names. So, my database accessing code raised "No such field" error :) > 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. |