freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
Re: [freetds] [PATCH] Problem with VARCHAR in sybase.
- From: Eddy Pronk <epronk AT muftor.com>
- To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
- Subject: Re: [freetds] [PATCH] Problem with VARCHAR in sybase.
- Date: Sun, 06 Jul 2008 09:08:52 +1000
James K. Lowden wrote:
The way I solved it for now inside libdbi right now is like this:
The basic question is: How should ct_fetch() react when the
datafmt.maxlength argument indicates a length *exactly* equal to the
length of the returned data and datafmt.format is CS_FMT_NULLTERM?
case CS_CHAR_TYPE:
case CS_TEXT_TYPE:
case CS_VARCHAR_TYPE:
_type = DBI_TYPE_STRING;
datafmt->format = CS_FMT_NULLTERM;
++datafmt->maxlength; /* 1 extra byte for \0 */
break;
Increase the maxlength with 1 byte before calling bind.
see: *http://thread.gmane.org/gmane.comp.db.libdbi.drivers/225*
I'll try it with CVS HEAD.
ct_fetch() copies 16 bytes, discovers there's no room for the NULL
terminator, and returns the error. Exactly as should be.
I'm interested to hear if CVS HEAD resolves the original problem.
Eddy
-
Re: [freetds] [PATCH] Problem with VARCHAR in sybase.,
Eddy Pronk, 07/01/2008
- <Possible follow-up(s)>
-
Re: [freetds] [PATCH] Problem with VARCHAR in sybase.,
Eddy Pronk, 07/03/2008
-
Re: [freetds] [PATCH] Problem with VARCHAR in sybase.,
James K. Lowden, 07/05/2008
-
Re: [freetds] [PATCH] Problem with VARCHAR in sybase.,
Eddy Pronk, 07/05/2008
-
Re: [freetds] [PATCH] Problem with VARCHAR in sybase.,
James K. Lowden, 07/06/2008
-
Re: [freetds] [PATCH] Problem with VARCHAR in sybase.,
Eddy Pronk, 07/07/2008
- Re: [freetds] [PATCH] Problem with VARCHAR in sybase., James K. Lowden, 07/07/2008
-
Re: [freetds] [PATCH] Problem with VARCHAR in sybase.,
Eddy Pronk, 07/07/2008
-
Re: [freetds] [PATCH] Problem with VARCHAR in sybase.,
James K. Lowden, 07/06/2008
- Re: [freetds] [PATCH] Problem with VARCHAR in sybase., James K. Lowden, 07/06/2008
-
Re: [freetds] [PATCH] Problem with VARCHAR in sybase.,
Eddy Pronk, 07/05/2008
-
Re: [freetds] [PATCH] Problem with VARCHAR in sybase.,
James K. Lowden, 07/05/2008
Archive powered by MHonArc 2.6.24.