Re: [PATCH] to improve DBD::Sybase 'make test' when using freetds

David Dick <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
On 13/04/10 23:41, Frediano Ziglio wrote:
> 2010/4/11 David Dick<[email protected]>:
>> This patch redirects some logging statements from stderr to the tdsdump file
>> and tries to improve the results of running 'make test' from DBD::Sybase
>> when using the freetds libraries.  It allows every DBD::Sybase test to pass
>> except for t/xblob.t.
>>
>
> Well... patch left after some commits

EAGAIN with the following patch to the ct_describe function :)

_______________________________________________
FreeTDS mailing list
[email protected]
http://lists.ibiblio.org/mailman/listinfo/freetds
freetds_dbd_sybase2.patch (text/plain, 864 B)
Index: src/ctlib/ct.c
===================================================================
RCS file: /cvsroot/freetds/freetds/src/ctlib/ct.c,v
retrieving revision 1.203
diff -u -r1.203 ct.c
--- src/ctlib/ct.c	13 Apr 2010 13:23:32 -0000	1.203
+++ src/ctlib/ct.c	18 Apr 2010 12:52:48 -0000
@@ -2311,8 +2311,10 @@
 	datafmt->datatype = _ct_get_client_type(curcol);
 	tdsdump_log(TDS_DBG_INFO1, "ct_describe() datafmt->datatype = %d server type %d\n", datafmt->datatype,
 		    curcol->column_type);
-	/* FIXME is ok this value for numeric/decimal? */
-	datafmt->maxlength = curcol->column_size;
+	if (is_numeric_type(curcol->column_type))
+		datafmt->maxlength = curcol->column_prec;
+	else
+		datafmt->maxlength = curcol->column_size;
 	datafmt->usertype = curcol->column_usertype;
 	datafmt->precision = curcol->column_prec;
 	datafmt->scale = curcol->column_scale;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.