Bug #2664: default conversion of sybase data types to SYBCHAR return extranious chars
| From: | neal at wanlink dot com | Date: | Thu, 04 Nov 1999 20:26:28 +0000 |
| Subject: | Bug #2664: default conversion of sybase data types to SYBCHAR return extranious chars | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-12118@lists.php.net to get a copy of this message | ||
From: neal@wanlink.com
Operating system: Solaris
PHP version: 3.0.12
PHP Bug Type: Sybase (dblib) related
Bug description: default conversion of sybase data types to SYBCHAR return extranious chars
This problem has existed since at least 3.0.5 that I'm aware of, and I finally got tired of
seeing it.... Any sybase data type that is not explicitly handled (ei. SYBINT(2,4) SYBCHAR, SYBTEXT,
SYBREAL) is implicitly converted to SYBCHAR by calling dbconvert, and returns not only the converted
data, but un-initialized extranious data for the length the the field as it is stored in sybase. A
simple call to memset just before the dbconvert call seems to cure this anoying little creepy
crawly... :)
This fix may apply to, and close the following bugs (I did little research on these bugid's so
YMMV);
863,889,941,894,1112,1338,1376
*** sybase.c.orig Thu Nov 4 13:14:05 1999
--- sybase.c Thu Nov 4 12:39:04 1999
***************
*** 662,667 ****
--- 662,668 ----
}
res_buf = (char *) emalloc(res_length+1);
+ memset(res_buf,' ',res_length+1);
dbconvert(NULL,coltype(offset),dbdata(sybase_ptr->link,offset),
res_length,SYBCHAR,res_buf,-1);
/* get rid of trailing spaces */