Closed (fixed)
Project:
Drupal driver for SQL Server and SQL Azure
Version:
7.x-1.x-dev
Component:
Documentation
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Nov 2012 at 12:31 UTC
Updated:
6 Jun 2013 at 20:40 UTC
Jump to comment: Most recent file
Comments
Comment #1
lyricnz commentedAccording to http://msdn.microsoft.com/en-us/library/ms187928.aspx there are a number of conversions that must be made explicitly (see the "Implicit Conversions" section). If we restrict that table to only the (13) data types used by sqlsvr, the only problematic conversions are those from date+datetime2+nchar+nvarchar+time to varbinary(max). Only the nchar+nvarchar cases are realistic.
I started this in attached patch, but (a) I don't have any SQL Server to test on, and (b) I don't know how to check the old field spec to determine if it's nchar+nvarchar (is it safe to ask for the schema from in here).
So, marking this as CNW pending someone with any clue about SQL Server at all :)
Comment #2
lyricnz commentedComment #3
lyricnz commentedMissing a close-bracket, at least.
Comment #4
katannshaw commentedThanks for the patch lyricnz. I'll give it a try first thing Monday morning and I'll let you know what happens. It's much appreciated.
Comment #5
lyricnz commentedThe patch is probably incomplete - it will use CAST() whether it needs to or not, when migrating to varbinary(max)
Comment #6
katannshaw commentedOk, thanks for letting me know. Would you prefer for me to wait until it's complete, or would you like for me to test it out?
Comment #7
lyricnz commentedI have no way of testing it. Go for it.
Comment #8
damien tournoud commentedIs there any reason not to always use an explicit cast? After all, an implicit cast is... a cast too, just implicit.
Comment #9
Uncle_Code_Monkey commentedMy error happened to be when updating CTools (
datafield inctools_object_cachechanged from varchar to varbinary). I modified the patch to always use an explicit cast since Damien made sense with his observation. Tested on my site and verified that it fixes my issue and did not cause any others.FYI, don't forget to apply this patch to the sqlsrv module and then copy the entire sqlsrv subfolder to
%site%/includes/databaseso the change actually gets used.Comment #10
thorsten. commentedThx for the patch!
Comment #11
gabriel.achille commentedit is working for me too. Thanks.
Comment #12
omegamonk commentedThanks for the patch. It has been committed to the development release.