[freetds] ODBC bcp
freddy77 at gmail.com
Tue Mar 31 16:27:10 EDT 2015
2015-03-30 22:03 GMT+01:00 Richard Hughes <cyreve at gmail.com>:
> Here's my v3 patch (hopefully in a slightly more gitish format - still
> trying to figure out which of the various workflows on offer is
Yes, git format-patch format is fine.
Patch looks really good. Perhaps need some cleanup and some update on
comments but it's working.
> I think I've addressed everything discussed, including redoing how the
> new functions are called, adding some more stuff to the unit test and
> fixing a few bugs thereby found.
> I've got a couple of questions outstanding:
> 1) I think I've found a bug in Microsoft's sqlncli11: inserting from
> an application type of SQL_NUMERIC_STRUCT to a column of type varchar
> appears to ignore the 'scale' of the decimal. This is commented in the
> unit test, but causes an attempt to insert 3.141593
> (SQL_NUMERIC_STRUCT) to come out as '3141593' (varchar). What's the
> general policy for things like this? Do we attempt bug-compatibility?
> I don't imagine many people will want this particular conversion - I
> only spotted it by accident.
I don't think emulating a bug like this is of any help.
> 2) I'm testing inserting to a datetime2 column. It works fine but
> tcpdump shows that it's actually being sent as a nvarchar over the
> wire, not binary. I'm assuming this is not my fault, but rather an
> underlying problem in src/tds/bulk.c which should be treated as a
> separate patch. If you think it is my fault then I'd appreciate it if
> you could point out where I might have gone wrong.
Are you sure you are using protocol 7.3 ? If you use a former protocol
sql server send datetime2 as nvarchar.
More information about the FreeTDS