On Thu, 22 Apr 2004 20:56:43 -0700, Jonathan Leffler wrote: > tvilliers wrote: >> I have a perl script, using the DBI and DBD::Informix to unload data to >> a flat file. To improve network traffic, the Informix specific >> FET_BUF_SIZE environment variable is set to "16k". This causes the >> script to die with "Memory fault". When FET_BUF_SIZE is unset, the >> script runs fine. I've tried to set the DBI's "LongReadLen" attribute, >> but it doies not seem to make any difference. >> >> Is this a DBI specific problem? >> >> uname -sr gives "Linux 2.4.10-4GB" and perl -v "5.6.1" with >> "Compile-time options: USE_LARGE_FILES". The DBI version is "1.19". > > DBD::Informix is documented to ignore LongReadLen - so it wouldn't make > any odds whatsoever. > > FET_BUF_SIZE is peculiar to Informix; it is not something DBI should be > affected by. > > You're using fairly old versions of Perl and DBI. You give no indication > of the version of DBD::Informix - so presumably 2003.04 (if not, start > thinking hard about using it) - nor any indication of the version of CSDK > (which is probably the most important piece of data).
Yes, this is the problem (a very old version of DBD::Informix), as well as a very old DBI: $DBD::Informix::VERSION = "1.00.PC2" check_version csdk = "2.81.UC1" I tried the script on another box with this environment: perl -v = "5.8.2" $DBI::VERSION = "1.40" $DBD::Informix::VERSION = "2003.04" check_version csdk = "2.81.UC2X5" And it worked fine. > Succinctly, I don't know what the problem is, but my suspicion is that the > conversion of "16k" is failing and the zero is being used for the buffer > size. Poor error control (in CSDK - not your code, or mine), but > nevertheless what I suspect. In the CSDK 2.80 ESQL/C Programmer's > Reference Manual (5423a.pdf), on p14-22, it illustrates the use of a > 20,000 byte FET_BUF_SIZE with: > > setenv FET_BUF_SIZE 20000 > > Apart from the heathen shell it is using, it is moderately clear that to > use 16 KB, you need to do: > > export FET_BUF_SIZE=16384 My apologies for not posting the full string as used in the script -- it was 16384 indeed. >From the sqlidebug.log : "FET_BUF_SIZE"="16384" > > You might be using a 16 byte buffer, or a 0 byte buffer; neither is very > likely to be conducive to good performance. Thank you for your help!