From de0268f5829d716c133dda2d96c0965af4f40b4c Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" Date: Tue, 6 Dec 2011 12:05:31 +0000 Subject: [PATCH] Bug 657290: Bug.add_attachment() stores truncated timestamps in the DB (seconds are missing) r=dkl a=mkanat git-svn-id: svn://10.0.0.236/branches/BUGZILLA-4_0-BRANCH@263137 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/bugzilla/.bzrrev | 2 +- mozilla/webtools/bugzilla/Bugzilla/WebService/Bug.pm | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/mozilla/webtools/bugzilla/.bzrrev b/mozilla/webtools/bugzilla/.bzrrev index 42cd5bc7bf8..709f86b160d 100644 --- a/mozilla/webtools/bugzilla/.bzrrev +++ b/mozilla/webtools/bugzilla/.bzrrev @@ -1 +1 @@ -7665 \ No newline at end of file +7666 \ No newline at end of file diff --git a/mozilla/webtools/bugzilla/Bugzilla/WebService/Bug.pm b/mozilla/webtools/bugzilla/Bugzilla/WebService/Bug.pm index fb17dae4914..7a640337be9 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/WebService/Bug.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/WebService/Bug.pm @@ -639,9 +639,12 @@ sub add_attachment { my @created; $dbh->bz_start_transaction(); + my $timestamp = $dbh->selectrow_array('SELECT LOCALTIMESTAMP(0)'); + foreach my $bug (@bugs) { my $attachment = Bugzilla::Attachment->create({ bug => $bug, + creation_ts => $timestamp, data => $params->{data}, description => $params->{summary}, filename => $params->{file_name}, @@ -657,7 +660,7 @@ sub add_attachment { extra_data => $attachment->id }); push(@created, $attachment); } - $_->bug->update($_->attached) foreach @created; + $_->bug->update($timestamp) foreach @created; $dbh->bz_commit_transaction(); $_->send_changes() foreach @bugs;