From: Kei H. <ex8...@gm...> - 2012-04-17 08:44:21
|
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. |