diff --git a/Database/SQLite3/Bindings/Types.hsc b/Database/SQLite3/Bindings/Types.hsc
--- a/Database/SQLite3/Bindings/Types.hsc
+++ b/Database/SQLite3/Bindings/Types.hsc
@@ -124,6 +124,11 @@
 instance Show ParamIndex where
     show (ParamIndex n) = show n
 
+-- | Limit min/max bounds to fit into SQLite's native parameter ranges.
+instance Bounded ParamIndex where
+    minBound = ParamIndex (fromIntegral (minBound :: CInt))
+    maxBound = ParamIndex (fromIntegral (maxBound :: CInt))
+
 -- | Index of a column in a result set.  Column indices start from 0.
 newtype ColumnIndex = ColumnIndex Int
     deriving (Eq, Ord, Enum, Num, Real, Integral)
@@ -131,6 +136,11 @@
 -- | This just shows the underlying integer, without the data constructor.
 instance Show ColumnIndex where
     show (ColumnIndex n) = show n
+
+-- | Limit min/max bounds to fit into SQLite's native parameter ranges.
+instance Bounded ColumnIndex where
+    minBound = ColumnIndex (fromIntegral (minBound :: CInt))
+    maxBound = ColumnIndex (fromIntegral (maxBound :: CInt))
 
 -- | Number of columns in a result set.
 type ColumnCount = ColumnIndex
diff --git a/direct-sqlite.cabal b/direct-sqlite.cabal
--- a/direct-sqlite.cabal
+++ b/direct-sqlite.cabal
@@ -1,5 +1,5 @@
 name: direct-sqlite
-version: 2.3.6
+version: 2.3.7
 build-type: Simple
 license: BSD3
 license-file: LICENSE
@@ -20,6 +20,8 @@
   supports strings encoded as UTF8, and BLOBs represented as ByteStrings.
   .
   Release history:
+  .
+  [Version 2.3.7] Fix a test failure related to 64-bit math on column indices.
   .
   [Version 2.3.6] Re-apply the stat64 hack after upgrade to the bundled
   SQLite3.  Oops!
diff --git a/test/Main.hs b/test/Main.hs
--- a/test/Main.hs
+++ b/test/Main.hs
@@ -407,8 +407,8 @@
               Just "y"  <- columnName stmt 2
               Just "ü"  <- columnName stmt 3
               Nothing   <- columnName stmt 4
-              Nothing   <- columnName stmt (ColumnIndex minBound)
-              Nothing   <- columnName stmt (ColumnIndex maxBound)
+              Nothing   <- columnName stmt minBound
+              Nothing   <- columnName stmt maxBound
               return ()
       checkNames
       Row <- step stmt
@@ -427,8 +427,8 @@
       Just "123"  <- columnName stmt 2
       Just "über" <- columnName stmt 3
       Nothing     <- columnName stmt 4
-      Nothing     <- columnName stmt (ColumnIndex minBound)
-      Nothing     <- columnName stmt (ColumnIndex maxBound)
+      Nothing     <- columnName stmt minBound
+      Nothing     <- columnName stmt maxBound
       return ()
 
 -- Testing for specific error codes:
