dbd:pg finish() bug

Поиск
Список
Период
Сортировка
От Vivek Khera
Тема dbd:pg finish() bug
Дата
Msg-id 15119.63751.783572.411703@yertle.kciLink.com
обсуждение исходный текст
Список pgsql-bugs
The DBD::Pg driver doesn't properly reset "Active" state when all data
from a handle is fetched, as specified in the DBI docs under the
description of finish().

This program should not report any warnings with the finish() method
commented out.  It however, complains about an active handle during
the destroy.

The sample database is below.

--cut here--
#! /usr/bin/perl
use strict;

use DBI;

&main();

sub main {
  my $dbh = DBI->connect('dbi:Pg:dbname=khera','khera',undef,{PrintError=>1})
    or die "dbi connect failure: ".$DBI::errstr;

  my $sth = $dbh->prepare('select a,b from t1')
    or die $dbh->errstr;

  $sth->execute();
  while (my ($a,$b) = $sth->fetchrow_array()) {
    print "a=$a, b=$b\n";
  }

  print 'active:',$sth->{Active},"\n";
  # finish is not necessary according to DBI...
  $sth->finish();
  print 'active:',$sth->{Active},"\n";

  print "--------\n";

  $dbh->disconnect();
}
--cut here--


CREATE TABLE "t1" (
        "a" integer,
        "b" integer
);
COPY "t1"  FROM stdin;
1       2
2       3
3       4
\.

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Edmund Mergl
Дата:
Сообщение: Re: dbd:pg finish() bug
Следующее
От: Brent Ewing
Дата:
Сообщение: repeated pointless memmove() calls in pqReadData()