gbwey / persistent-odbc

uses persistent connecting via hdbc odbc
Other
17 stars 16 forks source link

Make MS SQL migrations compatible with new HDBC-odbc #7

Closed anton-dessiatov closed 10 years ago

anton-dessiatov commented 10 years ago

I've uploaded a new version of HDBC-odbc, which is 2.4.0.0 to the Hackage. This version implements different query parameter binding for different SqlValue constructors to fix numerous issues with binary data and unicode strings passed as query parameters. This now means that when ODBC driver sees that bytestring is passed in place of nvarchar(64) column, it tries to perform a conversion based on current collation settings. This breaks migration scripts.

This pull request changes the type of the query parameter to PersistText (which makes sense beause it's text indeed, it was just passed as the bytestring previously to overcome the lack of proper parameter binding). It also bumps HDBC-odbc dependency to >= 2.4 because this fix will unfortunately break MS SQL migrations for the earlier HDBC-odbc versions.

Please also sorry for adding a bunch of changes that aren't really related to the fix, but are just the results of my text editor stripping the trailing whitespace.

gbwey commented 10 years ago

Hi Anton, Thanks a lot for the fixes. I will upload this to hackage tonight. Best, Grant