Skip Menu |

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

Report information
The Basics
Id: 50322
Status: resolved
Priority: 0/
Queue: DBD-Pg

People
Owner: greg [...] turnstep.com
Requestors: HMBRAND [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: 3.0.0



Subject: bigints do not return type_info on 64bit pg-8.4.1
The ->{TYPE} attribute for bigint is -5, which does not return usefull info in ->type_info () $ cat test.pl #!/pro/bin/perl use strict; use warnings; use DBI; use DBD::Pg; use Data::Peek; my $dbh = DBI->connect ("dbi:Pg:", undef, undef, { RaiseError => 1 }); print STDERR "Using DBI $DBI::VERSION + DBD::Pg $DBD::Pg::VERSION\n"; print STDERR " libpg-$dbh->{pg_lib_version}, server $dbh-> {pg_server_version}\n"; $dbh->do ("create table xx_test (c_test bigint)"); my $sth = $dbh->prepare ("select * from xx_test"); $sth->execute; DDumper ($sth->{TYPE}[0], $dbh->type_info ($sth->{TYPE}[0])); $dbh->do ("drop table xx_test"); $ perl test.pl Using DBI 1.609 + DBD::Pg 2.15.1 libpg-80401, server 80401 $VAR1 = -5; $
Yeah, bigint is a bit of a problem. From the DBI docs: These constants are defined by SQL/CLI, ODBC or both. "SQL_BIGINT" is (currently) omitted, because SQL/CLI and ODBC provide conflicting codes. However, it looks like DBI has more or less standardized on -5 (as opposed to 25), so we can probably go from there. I'm not convinced we've even got the right mappings inside of Pg.pm, but I'll see what I can do.
Not sure when or how this was fixed (probably via a newer version of DBI), but all should be working as expected now. Please give it a whirl and confirm.
Subject: Re: [rt.cpan.org #50322] bigints do not return type_info on 64bit pg-8.4.1
Date: Thu, 28 Nov 2013 08:11:59 +0100
To: bug-DBD-Pg [...] rt.cpan.org
From: "H.Merijn Brand" <h.m.brand [...] xs4all.nl>
On Thu, 28 Nov 2013 00:22:55 -0500, "Greg Sabino Mullane via RT" <bug-DBD-Pg@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=50322 > > > Not sure when or how this was fixed (probably via a newer version > of DBI), but all should be working as expected now. Please give it a > whirl and confirm.
Sorry, I see no change, except for the missing '$VAR1 = ' $ perl test.pl Using DBI 1.63 + DBD::Pg 2.19.3 libpg-90201, server 90300 -5 This is perl 5, version 16, subversion 2 (v5.16.2) built for x86_64-linux-ld -- H.Merijn Brand http://tux.nl Perl Monger http://amsterdam.pm.org/ using perl5.00307 .. 5.19 porting perl5 on HP-UX, AIX, and openSUSE http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/ http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/
Thanks for the quick reply - can you try git head please?
Subject: Re: [rt.cpan.org #50322] bigints do not return type_info on 64bit pg-8.4.1
Date: Thu, 28 Nov 2013 14:08:22 +0100
To: bug-DBD-Pg [...] rt.cpan.org
From: "H.Merijn Brand" <h.m.brand [...] xs4all.nl>
On Thu, 28 Nov 2013 07:50:26 -0500, "Greg Sabino Mullane via RT" <bug-DBD-Pg@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=50322 > > > Thanks for the quick reply - can you try git head please?
commit 85cb069e674ef86bbdb37cb12548022091d8559d Author: Greg Sabino Mullane <greg@endpoint.com> Date: Wed Nov 27 23:36:14 2013 -0500 Make sure we rewrite the new done_testing bit # DBI Version 1.63 # DBD::Pg Version 2.20.1_5 # Perl Version 5.16.2 # OS linux # PostgreSQL (compiled) 90300 # PostgreSQL (target) 90300 # PostgreSQL (reported) PostgreSQL 9.3.0 on x86_64-suse-linux-gnu, compiled by gcc (SUSE Linux) 4.7.2 20130108 [gcc-4_7-branch revision 195012], 64-bit # Default port 5432 # DBI_DSN dbi:Pg:db="postgres";port=5440;host=<pwd>/dbdpg_test_database/data/socket # DBI_USER postgres # Test schema dbd_pg_testschema # LANG C # array_nulls on # backslash_quote safe_encoding # client_encoding UTF8 # server_encoding UTF8 # standard_conforming_strings on # Adjusted: initdb All tests successful. Files=21, Tests=1755, 40 wallclock secs ( 0.22 usr 0.03 sys + 3.75 cusr 0.80 csys = 4.80 CPU) Result: PASS With the DDumper line changed to DDumper [ $sth->{TYPE}[0], $dbh->type_info ($sth->{TYPE}[0]) ]; Using DBI 1.63 + DBD::Pg 2.19.3 libpg-90201, server 90300 [ -5 ] Using DBI 1.63 + DBD::Pg 2.20.1_5 libpg-90300, server 90300 [ -5, { AUTO_UNIQUE_VALUE => 0, CASE_SENSITIVE => 0, COLUMN_SIZE => 20, CREATE_PARAMS => undef, DATA_TYPE => -5, FIXED_PREC_SCALE => 0, INTERVAL_PRECISION => undef, LITERAL_PREFIX => undef, LITERAL_SUFFIX => undef, LOCAL_TYPE_NAME => 'LONGINT', MAXIMUM_SCALE => 0, MINIMUM_SCALE => 0, NULLABLE => 1, NUM_PREC_RADIX => undef, SEARCHABLE => 2, SQL_DATA_TYPE => -5, SQL_DATETIME_SUB => undef, TYPE_NAME => 'int8', UNSIGNED_ATTRIBUTE => 0 } ] -- H.Merijn Brand http://tux.nl Perl Monger http://amsterdam.pm.org/ using perl5.00307 .. 5.19 porting perl5 on HP-UX, AIX, and openSUSE http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/ http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/