summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2011-12-06 12:54:09 +0100
committerFrédéric Buclin <LpSolit@gmail.com>2011-12-06 12:54:09 +0100
commit5c90b7dc1ca576328de2e673f76717c87ba3cf8a (patch)
tree31bef812fbeecaa59d65ee5da3059a4842ef098b /Bugzilla
parentd96494907e3685db5fecab173fb814b6d0ef32ec (diff)
downloadbugzilla-5c90b7dc1ca576328de2e673f76717c87ba3cf8a.tar.gz
bugzilla-5c90b7dc1ca576328de2e673f76717c87ba3cf8a.tar.xz
Bug 657290: Bug.add_attachment() stores truncated timestamps in the DB (seconds are missing)
r=dkl a=mkanat
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/WebService/Bug.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm
index b2f909e1e..eece1af6c 100644
--- a/Bugzilla/WebService/Bug.pm
+++ b/Bugzilla/WebService/Bug.pm
@@ -631,9 +631,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},
@@ -648,7 +651,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;