Skip to content

Commit

Permalink
Yert more info.
Browse files Browse the repository at this point in the history
  • Loading branch information
bos committed Apr 27, 2011
1 parent 57b1b88 commit eae9bcb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Database/MySQL.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ module Database.MySQL
, protocolInfo
, characterSetName
, sslCipher
, serverStatus
-- * General information
, clientInfo
, clientVersion
Expand Down Expand Up @@ -134,6 +135,12 @@ sslCipher conn = withConn conn $ \ptr -> do
then return Nothing
else Just <$> peekCString name

serverStatus :: Connection -> IO String
serverStatus conn = withConn conn $ \ptr -> do
st <- withRTSSignalsBlocked $ mysql_stat ptr
check "serverStatus" ptr (ptrToIntPtr st)
peekCString st

clientInfo :: String
clientInfo = unsafePerformIO $ peekCString mysql_get_client_info
{-# NOINLINE clientInfo #-}
Expand Down
4 changes: 4 additions & 0 deletions Database/MySQL/C.hsc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module Database.MySQL.C
, mysql_get_proto_info
, mysql_character_set_name
, mysql_get_ssl_cipher
, mysql_stat
-- * General information
, mysql_get_client_info
, mysql_get_client_version
Expand Down Expand Up @@ -141,6 +142,9 @@ foreign import ccall safe mysql_character_set_name
foreign import ccall safe mysql_get_ssl_cipher
:: Ptr MYSQL -> IO CString

foreign import ccall unsafe mysql_stat
:: Ptr MYSQL -> IO CString

foreign import ccall safe mysql_get_client_info :: CString

foreign import ccall safe mysql_get_client_version :: CULong
Expand Down

0 comments on commit eae9bcb

Please sign in to comment.