Skip to Content.
Sympa Menu

freetds - Re: need some help with freebcp

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frediano Ziglio <freddyz77 AT tin.it>
  • To: TDS Development Group <freetds AT franklin.oit.unc.edu>
  • Subject: Re: need some help with freebcp
  • Date: 23 Oct 2002 20:44:50 +0200


Il mer, 2002-10-23 alle 18:42, Thompson, Bill D (London) ha scritto:
> OK,
>
> I've tracked down these errors. As I suspected they are both symptoms of the
> same bug.
>
> I remember now that my fix for this last time was to change dbconvert(), but
> that change doesn't seem to have made it into CVS ( for good reason I'm sure
> - it was to do with my use of strlen, I think).
>
> As I have no wish to re-visit the convert code :-) , I've fixed the issue at
> source in bcp.c
> here it is, a one line change.
>
> in function _bcp_exec_out() :
>
> for (i = 0; i < dbproc->bcp_colcount; i++) {
>
> bcpcol = dbproc->bcp_columns[i];
> curcol = resinfo->columns[bcpcol->tab_colnum - 1];
>
> if (is_blob_type(curcol->column_type)) {
> /* FIX ME -- no converts supported */
> src = curcol->column_textvalue;
> len = curcol->column_cur_size;
> }
> else
> {
>
> src = &resinfo->current_row[curcol->column_offset];
>
> srctype = tds_get_conversion_type(curcol->column_type,
> curcol->column_size);
>
> if ( srctype != bcpcol->db_type )
> {
> bcpcol->db_type = srctype;
> }
>
> if (is_numeric_type(curcol->column_type))
> memcpy(bcpcol->data, src, sizeof(TDS_NUMERIC));
> else
> memcpy(bcpcol->data, src, curcol->column_size);
>
> -- bcpcol->data_size = curcol->column_size;
> ++ bcpcol->data_size = curcol->column_cur_size;
> }
> }
>
> A quick test shows that this resolves both issues.
> Perhaps someone could put this patch in ?
> Ta.
>
> Bill
>

Committed

freddy77






Archive powered by MHonArc 2.6.24.

Top of Page