Update of /cvsroot/htoolkit/HSQL/MySQL/Database/HSQL
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24354/Database/HSQL
Modified Files:
MySQL.hsc
Log Message:
return the number of affected rows
Index: MySQL.hsc
===================================================================
RCS file: /cvsroot/htoolkit/HSQL/MySQL/Database/HSQL/MySQL.hsc,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** MySQL.hsc 3 Jan 2006 22:59:46 -0000 1.5
--- MySQL.hsc 4 Jan 2006 19:59:36 -0000 1.6
***************
*** 49,52 ****
--- 49,53 ----
foreign import #{CALLCONV} "HsMySQL.h mysql_error" mysql_error :: MYSQL -> IO CString
foreign import #{CALLCONV} "HsMySQL.h mysql_query" mysql_query :: MYSQL -> CString -> IO CInt
+ foreign import #{CALLCONV} "HsMySQL.h mysql_affected_rows" mysql_affected_rows :: MYSQL -> IO (#type my_ulonglong)
foreign import #{CALLCONV} "HsMySQL.h mysql_use_result" mysql_use_result :: MYSQL -> IO MYSQL_RES
foreign import #{CALLCONV} "HsMySQL.h mysql_fetch_field" mysql_fetch_field :: MYSQL_RES -> IO MYSQL_FIELD
***************
*** 99,105 ****
, connTables = tables connection pMYSQL
, connDescribe = describe connection pMYSQL
! , connBeginTransaction = execute pMYSQL "begin"
! , connCommitTransaction = execute pMYSQL "commit"
! , connRollbackTransaction = execute pMYSQL "rollback"
, connClosed = refFalse
}
--- 100,106 ----
, connTables = tables connection pMYSQL
, connDescribe = describe connection pMYSQL
! , connBeginTransaction = execute pMYSQL "begin" >> return ()
! , connCommitTransaction = execute pMYSQL "commit" >> return ()
! , connRollbackTransaction = execute pMYSQL "rollback" >> return ()
, connClosed = refFalse
}
***************
*** 110,114 ****
res <- withCString query (mysql_query pMYSQL)
when (res /= 0) (handleSqlError pMYSQL)
! return (-1)
withStatement :: Connection -> MYSQL -> MYSQL_RES -> IO Statement
--- 111,116 ----
res <- withCString query (mysql_query pMYSQL)
when (res /= 0) (handleSqlError pMYSQL)
! nrows <- mysql_affected_rows pMYSQL
! return $! fromIntegral nrows
withStatement :: Connection -> MYSQL -> MYSQL_RES -> IO Statement
|