Skip Menu |

This queue is for tickets about the DBD-PgPP CPAN distribution.

Report information
The Basics
Id: 2535
Status: resolved
Priority: 0/
Queue: DBD-PgPP

People
Owner: Nobody in particular
Requestors: chris_j_johnstone [...] yahoo.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: (no value)
Fixed in: 0.05



Subject: SELECT fails on more then 8 fields
If you try to SELECT more then 8 fields in an SQL query, you get the following error message: Unknown message type: '' at C:/Chris/Perl/site/lib/DBD/PgPP.pm line 634
[guest - Thu May 8 09:35:48 2003]: Show quoted text
> If you try to SELECT more then 8 fields in an SQL query, you get the > 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); --- Show quoted text
> my $bitmap = _unpack_bitmap($stream->_get_byte($bitmap_length));
1445a1446,1456 Show quoted text
> 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; > } >
[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); }
[guest - Mon Mar 1 11:19:11 2004]: Show quoted text
> [guest - Fri Feb 6 08:51:21 2004]: >
> > [guest - Thu May 8 09:35:48 2003]: > >
> > > If you try to SELECT more then 8 fields in an SQL query, you get
> the
> > > 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));
> > 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); > } > > >
I get a similar error message: DBD::PgPP::st execute failed: Unknown message type: 'S' at C:/Perl/site/lib/DBD/PgPP.pm line 634 when I execute a query like: select sku, offering, publisher from generation order by sku limit 3896 but if I use: select sku, offering, publisher from generation order by sku limit 3895 it works. Any idea? I tried the first solution and it does not solves my problem.
[guest - Fri Oct 15 05:13:32 2004]: Show quoted text
> [guest - Mon Mar 1 11:19:11 2004]: >
> > [guest - Fri Feb 6 08:51:21 2004]: > >
> > > [guest - Thu May 8 09:35:48 2003]: > > >
> > > > If you try to SELECT more then 8 fields in an SQL query, you get
> > the
> > > > 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));
> > > 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); > > } > > > > > >
> > > I get a similar error message: > DBD::PgPP::st execute failed: Unknown message type: 'S' at > C:/Perl/site/lib/DBD/PgPP.pm line 634 > > when I execute a query like: > select sku, offering, publisher from generation order by sku limit > 3896 > but if I use: > select sku, offering, publisher from generation order by sku limit > 3895 > it works. Any idea? > > I tried the first solution and it does not solves my problem.
Ok, I found the problem (sorry for not checking this deeper) It is because one of the fields has an empty value at row 3896 I change the field to have value at that row and now it works but it makes me think that this is a bug too. :)
Was fixed in DBD-PgPP 0.05, released 2004-05-09. Apologies for the extreme delay in responding.