Permalink
Browse files

add 'executeRaw' handler to Statement initializer.

--HG--
extra : convert_revision : 1b10224cbc6535178a0b555be8ab160d5c87ce6e
  • Loading branch information...
1 parent 9514ac3 commit e6263c7f445ccecc68cffb2232e4fe94e454d9aa @waterson waterson committed Apr 18, 2010
Showing with 8 additions and 0 deletions.
  1. +8 −0 Database/HDBC/MySQL/Connection.hsc
@@ -278,6 +278,7 @@ newStatement mysql__ query = withForeignPtr mysql__ $ \mysql_ -> do
-- statement is around.
return $ Types.Statement
{ Types.execute = execute mysql__ stmt__
+ , Types.executeRaw = executeRaw mysql__ stmt__
, Types.executeMany = mapM_ $ execute mysql__ stmt__
, Types.finish = finalizeForeignPtr stmt__
, Types.fetchRow = fetchRow mysql__ stmt__ results
@@ -450,6 +451,13 @@ bindOfSqlValue' len buf_ btype signedness = do
, bindIsUnsigned = (if signedness == Unsigned then 1 else 0)
}
+executeRaw :: ForeignPtr MYSQL -> ForeignPtr MYSQL_STMT -> IO ()
+executeRaw mysql__ stmt__ =
+ withForeignPtr mysql__ $ \_ ->
+ withForeignPtr stmt__ $ \stmt_ -> do
+ rv <- mysql_stmt_execute stmt_
+ when (rv /= 0) (statementError stmt_)
+
-- Returns an appropriate binding structure for a field.
resultOfField :: MYSQL_FIELD -> IO MYSQL_BIND
resultOfField field =

0 comments on commit e6263c7

Please sign in to comment.