[guest - Fri Feb 6 08:51:21 2004]:
Show quoted text> [guest - Thu May 8 09:35:48 2003]:
>
> > If you try to SELECT more then 8 fields in an SQL query, you get
the
Show quoted text> > following error message:
> >
> > Unknown message type: '' at C:/Chris/Perl/site/lib/DBD/PgPP.pm line
> > 634
>
>
> The following patch fixed it for me
>
> ian.cass@bitch:~/smpp-client$ diff PgPP.pm PgPP.pm.new
> 1430c1430
> < my $bitmap = unpack 'C*', $stream->_get_byte($bitmap_length);
> ---
> > my $bitmap = _unpack_bitmap($stream->_get_byte
($bitmap_length));
Show quoted text> 1445a1446,1456
> > sub _unpack_bitmap {
> > my $packed = shift;
> > my $len = length($packed) - 1;
> > my $unpacked;
> > foreach my $byte (split //, $packed) {
> > $unpacked += ord($byte) << (8 * $len);
> > $len--;
> > }
> > return $unpacked;
> > }
> >
Or you could just unpack the stream as a bit array and directly index
the array to check if a field is null or not....
my @bm = split('', unpack('B*', $stream->_get_byte($bitmap_length)));
for (my $i = 0; $i < $fields_length; $i++)
{
push (@result, $bm[$i] ? $stream->_get_byte($stream->_get_int32
() - 4) : undef);
}