HDBC-mysql 0.1 → 0.2
raw patch · 2 files changed
+21/−12 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Database/HDBC/MySQL/Connection.hsc +20/−11
- HDBC-mysql.cabal +1/−1
Database/HDBC/MySQL/Connection.hsc view
@@ -120,7 +120,11 @@ -- So we'll turn it off here and start our first transaction. mysql_autocommit mysql_ 0 - mysql__ <- newForeignPtr mysql_close mysql_+ -- XXX force a leak here. I have yet to fathom why the+ -- references below to mysql__ don't keep the foreignPtr+ -- alive.+ --mysql__ <- newForeignPtr mysql_close mysql_+ mysql__ <- newForeignPtr_ mysql_ doStartTransaction mysql__ return $ Connection@@ -207,12 +211,12 @@ (#poke MYSQL_BIND, buffer_length) p buflen data MYSQL_TIME = MYSQL_TIME- { timeYear :: CInt- , timeMonth :: CInt- , timeDay :: CInt- , timeHour :: CInt- , timeMinute :: CInt- , timeSecond :: CInt+ { timeYear :: CUInt+ , timeMonth :: CUInt+ , timeDay :: CUInt+ , timeHour :: CUInt+ , timeMinute :: CUInt+ , timeSecond :: CUInt } instance Storable MYSQL_TIME where@@ -245,8 +249,12 @@ -- If an error occurs below, we'll lose the reference to the foreign -- pointer and run the finalizer.- stmt__ <- newForeignPtr mysql_stmt_close stmt_ + -- XXX force a leak here. I have yet to fathom why the references+ -- below to stmt__ don't keep the foreignPtr alive.+ --stmt__ <- newForeignPtr mysql_stmt_close stmt_+ stmt__ <- newForeignPtr_ stmt_+ withCStringLen query $ \(query_, len) -> do rv <- mysql_stmt_prepare stmt_ query_ (fromIntegral len) when (rv /= 0) (statementError stmt_)@@ -480,9 +488,10 @@ -- Returns the amount of storage required for a particular result -- type. boundSize :: CInt -> CULong -> CULong-boundSize #{const MYSQL_TYPE_LONG} _ = 4-boundSize #{const MYSQL_TYPE_DOUBLE} _ = 8-boundSize _ n = n+boundSize #{const MYSQL_TYPE_LONG} _ = 4+boundSize #{const MYSQL_TYPE_DOUBLE} _ = 8+boundSize #{const MYSQL_TYPE_DATETIME} _ = #{const sizeof(MYSQL_TIME)}+boundSize _ n = n -- Fetches a row from an executed statement and converts the cell -- values into a list of SqlValue types.
HDBC-mysql.cabal view
@@ -1,7 +1,7 @@ Name: HDBC-mysql Category: Database Synopsis: MySQL driver for HDBC-Version: 0.1+Version: 0.2 Description: This package provides a MySQL driver for HDBC. Stability: Experimental Maintainer: Chris Waterson <waterson@maubi.net>