From 3bbeb9f92853a30b6f6929b58996656612d3d766 Mon Sep 17 00:00:00 2001 From: David Golden Date: Wed, 23 May 2018 16:36:22 -0400 Subject: [PATCH] PERL-909 Fix BSON::Timestamp back-compat constructor --- Changes | 5 +++++ lib/BSON/Timestamp.pm | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Changes b/Changes index fa3cdfe..a4cde85 100644 --- a/Changes +++ b/Changes @@ -2,6 +2,11 @@ Revision history for BSON {{$NEXT}} + [Bugs] + + - [PERL-641] Fix back-compatible BSON::Timestamp constructor + so that MongoDB::Timestamp can be an empty subclass of it. + v1.6.1 2018-05-17 13:41:11-04:00 America/New_York [Bugs] diff --git a/lib/BSON/Timestamp.pm b/lib/BSON/Timestamp.pm index 54c1364..f8292ef 100644 --- a/lib/BSON/Timestamp.pm +++ b/lib/BSON/Timestamp.pm @@ -32,7 +32,7 @@ use namespace::clean -except => 'meta'; my $max_int32 = 2147483647; -# Support back-compat 'secs' and inc' and legacy constructor shortcut +# Support back-compat 'sec' and inc' and legacy constructor shortcut sub BUILDARGS { my ($class) = shift; @@ -46,8 +46,8 @@ sub BUILDARGS { unless @_ % 2 == 0; %args = @_; - $args{seconds} = $args{secs} if exists $args{secs} && !exists $args{seconds}; - $args{increment} = $args{inc} if exists $args{inc} && !exists $args{increment}; + $args{seconds} = $args{sec} if exists $args{sec} && !exists $args{seconds}; + $args{increment} = $args{inc} if exists $args{inc} && !exists $args{increment}; } $args{seconds} = time unless defined $args{seconds};