From: Rafael Kitover Date: Sat, 31 Oct 2009 22:59:19 +0000 (+0000) Subject: work-around disconnect bug with DBD::Pg 2.15.1 X-Git-Tag: v0.08113~20 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=993fd91cb2f1d2e2c5d55fc434fec0ca3a20713e;p=dbsrgits%2FDBIx-Class.git work-around disconnect bug with DBD::Pg 2.15.1 --- diff --git a/lib/DBIx/Class/Storage/DBI/Pg.pm b/lib/DBIx/Class/Storage/DBI/Pg.pm index 3d25b83..92f1a78 100644 --- a/lib/DBIx/Class/Storage/DBI/Pg.pm +++ b/lib/DBIx/Class/Storage/DBI/Pg.pm @@ -61,11 +61,15 @@ sub _dbh_get_autoinc_seq { ( $schema, $table ) = ( $1, $2 ); } +### XXX This is unsafe in DBD::Pg 2.15.1, it can disconnect for some reason +### # use DBD::Pg to fetch the column info if it is recent enough to # work. otherwise, use custom SQL - my $seq_expr = $DBD::Pg::VERSION >= 2.015001 - ? eval{ $dbh->column_info(undef,$schema,$table,$col)->fetchrow_hashref->{COLUMN_DEF} } - : $self->_dbh_get_column_default( $dbh, $schema, $table, $col ); +# my $seq_expr = $DBD::Pg::VERSION >= 2.015001 +# ? eval{ $dbh->column_info(undef,$schema,$table,$col)->fetchrow_hashref->{COLUMN_DEF} } +# : $self->_dbh_get_column_default( $dbh, $schema, $table, $col ); + + my $seq_expr = $self->_dbh_get_column_default( $dbh, $schema, $table, $col ); # if no default value is set on the column, or if we can't parse the # default value as a sequence, throw.