packages feed

mysql-haskell 0.4.1.0 → 0.5.0.0

raw patch · 5 files changed

+41/−3 lines, 5 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Database.MySQL.Base: DecodePacketFailed :: ByteString -> ByteOffset -> String -> DecodePacketException
+ Database.MySQL.Base: DecodePacketPartial :: DecodePacketException
+ Database.MySQL.Base: ERRException :: ERR -> ERRException
+ Database.MySQL.Base: NetworkException :: NetworkException
+ Database.MySQL.Base: UnconsumedResultSet :: UnconsumedResultSet
+ Database.MySQL.Base: UnexpectedPacket :: Packet -> UnexpectedPacket
+ Database.MySQL.Base: WrongParamsCount :: WrongParamsCount
+ Database.MySQL.Base: data DecodePacketException
+ Database.MySQL.Base: data ERRException
+ Database.MySQL.Base: data NetworkException
+ Database.MySQL.Base: data UnconsumedResultSet
+ Database.MySQL.Base: data UnexpectedPacket
+ Database.MySQL.Base: data WrongParamsCount

Files

ChangeLog.md view
@@ -1,5 +1,11 @@ # Revision history for mysql-haskell +## 0.5.0.0 -- 2016-8-22++* Export exception types.+* Fix a regression cause password authentication failed, add tests.+* Fix a reading order bug cause 'prepareStmt/prepareStmtDetail' failed.+ ## 0.4.0.0 -- 2016-8-22  * Enable TLS support via `tls` package, add benchmarks.
Database/MySQL/Base.hs view
@@ -52,6 +52,13 @@     , renderParams     , command     , Stream.skipToEof+      -- * Exceptions+    , NetworkException(..)+    , UnconsumedResultSet(..)+    , ERRException(..)+    , UnexpectedPacket(..)+    , DecodePacketException(..)+    , WrongParamsCount(..)       -- * MySQL protocol     , module  Database.MySQL.Protocol.Auth     , module  Database.MySQL.Protocol.Command
Database/MySQL/Protocol/Auth.hs view
@@ -100,7 +100,10 @@     skip 10 -- 10 * 0x00     salt2 <- if (cap .&. CLIENT_SECURE_CONNECTION) == 0         then pure B.empty-        else let len = max 13 (authPluginLen - 8) in getByteString (fromIntegral len)+        else getByteStringNul   -- This is different with the MySQL document here+                                -- The doc said we should expect a MAX(13, length of auth-plugin-data - 8)+                                -- length bytes, but doing so stop us from login+     authPlugin <- if (cap .&. CLIENT_PLUGIN_AUTH) == 0         then pure B.empty         else getByteStringNul
mysql-haskell.cabal view
@@ -1,5 +1,5 @@ name:                mysql-haskell-version:             0.4.1.0+version:             0.5.0.0 synopsis:            pure haskell MySQL driver description:         pure haskell MySQL driver license:             BSD3
test/Main.hs view
@@ -1,3 +1,5 @@+{-# LANGUAGE ScopedTypeVariables #-}+ module Main where  import qualified BinaryRow@@ -5,7 +7,7 @@ import qualified BinLog import qualified BinLogNew import           Control.Concurrent    (forkIO, threadDelay)-import           Control.Exception     (bracket)+import           Control.Exception     (bracket, catch) import           Control.Monad import qualified Data.ByteString       as B import           Database.MySQL.Base@@ -118,6 +120,24 @@      close c +    (greet, c) <- connectDetail defaultConnectInfo {ciUser = "testMySQLHaskell", ciDatabase = "testMySQLHaskell"}+    execute_ c "SET PASSWORD = PASSWORD('123456abcdefg???')"+    close c++    let loginFailMsg = "ERRException (ERR {errCode = 1045, errState = \"28000\", \+            \errMsg = \"Access denied for user 'testMySQLHaskell'@'localhost' (using password: YES)\"})"++    (greet, c) <- connectDetail+        defaultConnectInfo {ciUser = "testMySQLHaskell", ciDatabase = "testMySQLHaskell", ciPassword = "123456abcdefg???"}+    execute_ c "SET PASSWORD = PASSWORD('')"+    close c++    catch+        (void $ connectDetail+                    defaultConnectInfo+                        {ciUser = "testMySQLHaskell", ciDatabase = "testMySQLHaskell", ciPassword = "wrongPassWord"})+        (\ (e :: ERRException) -> assertEqual "wrong password should fail to login" (show e) loginFailMsg)+   where     resetTestTable c = do             execute_ c  "DELETE FROM test WHERE __id=0"@@ -162,3 +182,5 @@                         \NULL,\                         \NULL\                         \)"++