Skip to Content.
Sympa Menu

freetds - Re: [freetds] ODBC bcp

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Richard Hughes <cyreve AT gmail.com>
  • To: Frediano Ziglio <freddy77 AT gmail.com>, FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] ODBC bcp
  • Date: Mon, 30 Mar 2015 22:03:38 +0100

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
appropriate).

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.

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.

Richard.

Attachment: 0001-Add-support-for-bcp-bulk-copy-using-ODBC-connections.patch.gz
Description: Binary data




Archive powered by MHonArc 2.6.24.

Top of Page