Skip site navigation (1) Skip section navigation (2)

Possible bug in DBD::Pg 0.95

From: "Jeff Duffy" <jeff(at)alanne(dot)com>
To: "DBI Users" <dbi-users(at)perl(dot)org>
Cc: Postgres Interfaces <pgsql-interfaces(at)postgresql(dot)org>, "Edmund Mergl" <e(dot)mergl(at)bawue(dot)de>
Subject: Possible bug in DBD::Pg 0.95
Date: 2001-03-29 12:14:07
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces
While poking about in my favorite MUA 
I discovered what may be a serious bug in DBD::Pg. While attempting
to import some files (email) into the database, the script dumped 

 Some experimenting shows that smaller files (>100k or so) insert
fine, but larger file inserts into text fields cause the script to 
segfault and dump core when execute() is called on the statement 

 I have successfully inserted the same text into Postgres using the
COPY command, so that should rule out db issues. 

The offending code:

use DBI;

my $dbh = DBI->connect("dbi:Pg:dbname='jeff'", 'jeff', '', 
 {AutoCommit => 0 });

open(FILE, 'test.msg');
undef $/;
my $msg = <FILE>;

my $sth = $dbh->prepare("INSERT INTO message_sources VALUES(91, ?)");
$sth->bind_param(1, $msg);

The file test.msg is ~178k (it's a pgsql-general-digest message). 

 The table:

jeff=# \d message_sources 
    Table "message_sources"
 Attribute |  Type   | Modifier 
 id	   | integer | not null
 bodytext  | text    | 
Index: message_sources_pkey

The first few lines of 'strings core' suggests that there might be an
issue with DynaLoader:

tch %s%s%s%s %_
"@ t
ERT INTO message_sources VALUES(91, ?)");
 => 0 });

The environment:

Red Hat 7.0 (linux 2.4.2)
Perl 5.6.0 (compiled from source, shared
PostgreSQL 7.1RC1 (compiled from source)
DBD::Pg 0.95 (compiled from source)

 I recompiled Perl and DBD::Pg using kgcc (egcs-2.91.66) to make sure
that the RH gcc 2.96 wasn't at fault, and got the same results.

 The corefile and test message are available.

 Jeff Duffy
 Great Bridge, Inc.

pgsql-interfaces by date

Next:From: Jeff MacDonaldDate: 2001-03-29 20:10:05
Subject: mod_auth_pgsql
Previous:From: NSB)Hiroshi KasamatsuDate: 2001-03-29 07:48:34
Subject: JDBC connection by crontab

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group