Skip Menu |
 

This queue is for tickets about the DateTime-Format-Oracle CPAN distribution.

Report information
The Basics
Id: 105473
Status: new
Priority: 0/
Queue: DateTime-Format-Oracle

People
Owner: Nobody in particular
Requestors: mca [...] sanger.ac.uk
Cc:
AdminCc:

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



MIME-Version: 1.0
X-Spam-Status: No, score=-3.72 tagged_above=-99.9 required=10 tests=[AWL=0.490, BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, T_RP_MATCHES_RCVD=-0.01] autolearn=ham
Content-Disposition: inline
X-Spam-Flag: NO
content-type: text/plain; charset="utf-8"
Message-ID: <20150624153831.GH18753 [...] sanger.ac.uk>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Spam-Score: -3.72
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id BB20D2404D0 for <cpan-bug+DateTime-Format-Oracle [...] hipster.bestpractical.com>; Wed, 24 Jun 2015 11:39:01 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MwxWr8Z0LPJ9 for <cpan-bug+DateTime-Format-Oracle [...] hipster.bestpractical.com>; Wed, 24 Jun 2015 11:38:56 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id CB7C224027D for <bug-DateTime-Format-Oracle [...] rt.cpan.org>; Wed, 24 Jun 2015 11:38:55 -0400 (EDT)
Received: (qmail 376 invoked by alias); 24 Jun 2015 15:38:54 -0000
Received: from smtp.sanger.ac.uk (HELO smtp.sanger.ac.uk) (193.62.202.243) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Wed, 24 Jun 2015 08:38:46 -0700
Received: from cgp-login.internal.sanger.ac.uk ([172.17.97.155]) by intmail3a.internal.sanger.ac.uk with esmtps (TLSv1:AES256-SHA:256) (Exim 4.80.1) (envelope-from <mca [...] sanger.ac.uk>) id 1Z7mkx-0001Ed-S7 for bug-DateTime-Format-Oracle [...] rt.cpan.org; Wed, 24 Jun 2015 16:38:31 +0100
Received: from mca by cgp-login.internal.sanger.ac.uk with local (Exim 4.69) (envelope-from <mca [...] sanger.ac.uk>) id 1Z7mkx-00086j-Qh for bug-DateTime-Format-Oracle [...] rt.cpan.org; Wed, 24 Jun 2015 16:38:31 +0100
Delivered-To: cpan-bug+DateTime-Format-Oracle [...] hipster.bestpractical.com
User-Agent: Mutt/1.5.18 (2008-05-17)
Subject: format_timestamp_with_timezone, parse_timestamp_with_timezone : missing from 0.06 due to (?)typo
Return-Path: <mca [...] sanger.ac.uk>
X-RT-Mail-Extension: datetime-format-oracle
X-Original-To: cpan-bug+DateTime-Format-Oracle [...] hipster.bestpractical.com
X-Spam-Check-BY: la.mx.develooper.com
Date: Wed, 24 Jun 2015 16:38:31 +0100
X-Spam-Level:
X-Message-Source: cgp-login.internal.sanger.ac.uk
To: bug-DateTime-Format-Oracle [...] rt.cpan.org
From: Matthew Astley <mca [...] sanger.ac.uk>
X-RT-Original-Encoding: ascii
X-RT-Interface: Email
Content-Length: 3422
Download (untitled) / with headers
text/plain 3.3k
Hi, Thanks for DateTime::Format::Oracle. I was trying to use DateTime::Format::Oracle 0.06 DBIx::Class::InflateColumn::DateTime from DBIx::Class 0.08250 Oracle 11g 11.2.0.4.0 and found that "timestamp with timezone" was losing the timezone, giving me a 3600 second time offset. This is because D:C:IC::DateTime is constructing[1] methods named =~ /_timestamp_with_timezone$/ and the implemented methods are =~ /_timestamp_with_time_zone$/ I fixed this in my application with symbol table aliases, use DateTime::Format::Oracle 0.06; # for parse_timestamp_with_timezone (* DateTime::Format::Oracle::parse_timestamp_with_timezone = \&DateTime::Format::Oracle::parse_timestamp_with_time_zone ) unless DateTime::Format::Oracle->can('parse_timestamp_with_timezone'); (* DateTime::Format::Oracle::format_timestamp_with_timezone = \&DateTime::Format::Oracle::format_timestamp_with_time_zone ) unless DateTime::Format::Oracle->can('format_timestamp_with_timezone'); Sorry, I can't think of a good way to write a test this without bringing in DBIx::Class and an Oracle instance. -- Matthew [1] debug output preferred_method = format_timestamp_with_timezone; DateTime::Format::Oracle 0.06 from /software/perl-5.16.2/lib/site_perl/5.16.2/DateTime/Format/Oracle.pm CANNOT preferred_method = parse_timestamp_with_timezone; DateTime::Format::Oracle 0.06 from /software/perl-5.16.2/lib/site_perl/5.16.2/DateTime/Format/Oracle.pm CANNOT inflate(began) 2015-06-24 14:40:52 +0100,Sanger::CGP::DataOut::DB::Session=HASH(0x35a84c0) => 2015-06-24 14:40:52 +0000 from a code change (applied by putting a modified copy of the module earlier in $PERL5LIB) mca@cgpfoo:~/gitwk-cgp/cgpDataOut$ diff -u /software/perl-5.16.2/lib/site_perl/5.16.2/DBIx/Class/InflateColumn/DateTime.pm lib/DBIx/Class/InflateColumn/DateTime.pm --- /software/perl-5.16.2/lib/site_perl/5.16.2/DBIx/Class/InflateColumn/DateTime.pm 2013-04-15 16:21:57.000000000 +0100 +++ lib/DBIx/Class/InflateColumn/DateTime.pm 2015-06-24 14:09:54.776032000 +0100 @@ -171,8 +171,9 @@ # propagate for error reporting $infcopy->{__dbic_colname} = $column; - my $dt = $obj->_inflate_to_datetime( $value, $infcopy ); +my $dt_txt = defined $dt ? $dt->strftime('%Y-%m-%d %H:%M:%S %z') : '(undef)'; +warn " inflate($column) $value,$obj => $dt_txt\n"; return (defined $dt) ? $obj->_post_inflate_datetime( $dt, $infcopy ) @@ -196,7 +197,9 @@ my $parser = $self->_datetime_parser; my $preferred_method = sprintf($method_fmt, $info->{ _ic_dt_method }); my $method = $parser->can($preferred_method) || sprintf($method_fmt, 'datetime'); - + my $pfile = $parser; $pfile =~ s{::}{/}g; $pfile .= '.pm'; + warn " preferred_method = $preferred_method; $parser ". + ($parser->VERSION)." from $INC{$pfile} ".($parser->can($preferred_method) ? "CAN" : "CANNOT")."\n"; return try { $parser->$method($value); } relevant variable info, $method_fmt = 'format_%s' or 'parse_%s'; $info->{_ic_dt_method} = 'timestamp_with_timezone'; # datatype is 'timestamp with timezone' -- The Wellcome Trust Sanger Institute is operated by Genome Research Limited, a charity registered in England with number 1021457 and a company registered in England with number 2742969, whose registered office is 215 Euston Road, London, NW1 2BE.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.