From: Frédéric Buclin Date: Tue, 6 Dec 2011 12:00:50 +0000 (+0100) Subject: Bug 657290: Bug.add_attachment() stores truncated timestamps in the DB (seconds are... X-Git-Tag: bugzilla-4.0.3~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f3dd5835932829ebe538d06b6a9ae6405fcb4e8c;p=thirdparty%2Fbugzilla.git Bug 657290: Bug.add_attachment() stores truncated timestamps in the DB (seconds are missing) r=dkl a=mkanat --- diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm index fb17dae491..7a640337be 100644 --- a/Bugzilla/WebService/Bug.pm +++ b/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;