php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #2664 default conversion of sybase data types to SYBCHAR return extranious chars
Submitted: 1999-11-04 15:26 UTC Modified: 1999-11-05 03:58 UTC
From: neal at wanlink dot com Assigned:
Status: Closed Package: Sybase (dblib) related
PHP Version: 3.0.12 OS: Solaris
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
45 - 3 = ?
Subscribe to this entry?

 
 [1999-11-04 15:26 UTC] neal at wanlink dot com
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 */

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-11-05 03:58 UTC] thies at cvs dot php dot net
thanx for the patch - fixed in CVS
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 23 14:01:31 2024 UTC