I'm getting core dumps when I try to use a BYTEA value with
a byte outside 0..127.

    use DBI qw(SQL_BINARY);
    my $dbh = DBI->connect("dbi:Pg:dbname=merlyntest", "user", "pass",
      { RaiseError => 1 });
    $dbh->do("CREATE TABLE test (a BYTEA)");
    my $insert = $dbh->prepare("INSERT INTO test VALUES (?)");
    $insert->bind_param(1, undef, SQL_BINARY); # necessary for BYTEA escaping
    $insert->execute("fred"); # works fine
    $insert->execute(pack "C*", 0..127); # works fine
    $insert->execute(pack "C*", 128); # BOMB, core dump

(I'm cutting and pasting this from a perl debugger session, so if
that's not quite it, forgive me.)

DBI version 1.18
DBD::Pg version 1.00
postgresql version 7.1.2
Perl version 5.5.3

Is it just me?  Am I not holding my mouth right?

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

Reply via email to