From ba00739e5d343845e5c0b0c66846e2b8032ab233 Mon Sep 17 00:00:00 2001 From: waterson Date: Thu, 26 Feb 2009 22:31:54 +0000 Subject: [PATCH] fix binding size for MYSQL_TYPE_LONG columns. --HG-- extra : convert_revision : fe69495730f9f69dbd8ac48dc212bca77ce14588 --- ChangeLog | 7 ++++++- Database/HDBC/MySQL/Connection.hsc | 2 +- HDBC-mysql.cabal | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index a2e72f4..91bcf93 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,9 @@ -2009-02-18 Chris Waterson +2009-02-26 Chris Waterson + + * HDBC-mysql-0.4. Fix incorrect binding size (should always be 4 + bytes, not compiler's "long") for MYSQL_TYPE_LONG columns. + +2009-02-18 Chris Waterson * HDBC-mysql-0.3 Deal with some of the problems where statements would mysteriously "close". It turns out that only one statement diff --git a/Database/HDBC/MySQL/Connection.hsc b/Database/HDBC/MySQL/Connection.hsc index 5713445..e60a4dc 100644 --- a/Database/HDBC/MySQL/Connection.hsc +++ b/Database/HDBC/MySQL/Connection.hsc @@ -516,7 +516,7 @@ cellValue bind = do nonNullCellValue :: CInt -> Ptr () -> CULong -> IO Types.SqlValue nonNullCellValue #{const MYSQL_TYPE_LONG} p _ = do - n :: CLong <- peek $ castPtr p + n :: CInt <- peek $ castPtr p return $ Types.SqlInteger (fromIntegral n) nonNullCellValue #{const MYSQL_TYPE_LONGLONG} p _ = do diff --git a/HDBC-mysql.cabal b/HDBC-mysql.cabal index 7eacc34..eb14125 100644 --- a/HDBC-mysql.cabal +++ b/HDBC-mysql.cabal @@ -1,7 +1,7 @@ Name: HDBC-mysql Category: Database Synopsis: MySQL driver for HDBC -Version: 0.3 +Version: 0.4 Description: This package provides a MySQL driver for HDBC. Stability: Experimental Maintainer: Chris Waterson