Commits

Bryan O'Sullivan committed da571e3

Handle empty binary data correctly.

Comments (0)

Files changed (1)

Database/MySQL/Simple/Param.hs

         [Plain (fromChar ')')]
 
 instance Param (Binary SB.ByteString) where
-    render (Binary bs) = Plain $ fromByteString "0x" `mappend`
-                                 fromByteString (B16.encode bs)
+    render (Binary bs) = Plain $ fromByteString "x'" `mappend`
+                                 fromByteString (B16.encode bs) `mappend`
+                                 fromChar '\''
 
 instance Param (Binary LB.ByteString) where
     render (Binary bs) = Plain $ fromByteString "0x" `mappend`