PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: mpeppler at itf dot ch (Michael Peppler)
Subject: Sybperl bcp_sendrow bug
Date: Mar 5 1996 9:05AM

----------
X-Sun-Data-Type: text
X-Sun-Data-Description: text
X-Sun-Data-Name: text
X-Sun-Content-Lines: 17
X-Sun-Content-Length: 781

I've just uncovered a subtle bug with sybperl's implementation of
bcp_meminit()/bcp_sendrow(). When bulk-copying binary data
(specifically TEXT or IMAGE columns) to the server the data can get
truncated if it includes a NULL byte. This bug exists on all versions
of sybperl, but it only shows up when copying binary data to the server
- bcp operations involving 'normal' columns are immune to this bug.

It's fairly obvious that nobody's been bitten by this bug (yet! - or
I'd have heard about it :-) but it's a pretty stupid coding error that
needs to be corrected.

I attach two patches below that should solve this problem. The first
patch is for sybperl 2.03 and the second is for sybperl 2.04.

To apply the patch, cd sybperl-2.0x/DBlib and say patch -p