]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 657290: Bug.add_attachment() stores truncated timestamps in the DB (seconds are...
authorFrédéric Buclin <LpSolit@gmail.com>
Tue, 6 Dec 2011 11:59:28 +0000 (12:59 +0100)
committerFrédéric Buclin <LpSolit@gmail.com>
Tue, 6 Dec 2011 11:59:28 +0000 (12:59 +0100)
r=dkl a=mkanat

Bugzilla/WebService/Bug.pm

index e825e1ee63ce01cde83974a56a0af0b0c031dc28..ea1becc0aed422f6bcc74610731213afe77bea4e 100644 (file)
@@ -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},
@@ -656,7 +659,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;