summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authormkanat%kerio.com <>2005-02-25 08:37:47 +0100
committermkanat%kerio.com <>2005-02-25 08:37:47 +0100
commit63dde60072374b2f7ef2f756d4ab9dff66669793 (patch)
tree294b30fddd43508bc9fa4d8c3c540ac4bbcd3c8c /Bugzilla
parent32882b6e3513fa69185ea5b3d115e70b69ea5362 (diff)
downloadbugzilla-63dde60072374b2f7ef2f756d4ab9dff66669793.tar.gz
bugzilla-63dde60072374b2f7ef2f756d4ab9dff66669793.tar.xz
Bug 280500: Replace "DATE_FORMAT()" with Bugzilla::DB function call
Patch By Tomas Kopal <Tomas.Kopal@altap.cz> r=mkanat, a=myk
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/Attachment.pm8
-rwxr-xr-xBugzilla/Bug.pm19
2 files changed, 15 insertions, 12 deletions
diff --git a/Bugzilla/Attachment.pm b/Bugzilla/Attachment.pm
index 5f491f315..8be92dcf2 100644
--- a/Bugzilla/Attachment.pm
+++ b/Bugzilla/Attachment.pm
@@ -67,6 +67,8 @@ sub query
# "attachments" variable.
my ($bugid) = @_;
+ my $dbh = Bugzilla->dbh;
+
my $in_editbugs = &::UserInGroup("editbugs");
&::SendSQL("SELECT product_id
FROM bugs
@@ -76,9 +78,9 @@ sub query
# Retrieve a list of attachments for this bug and write them into an array
# of hashes in which each hash represents a single attachment.
- &::SendSQL("
- SELECT attach_id, DATE_FORMAT(creation_ts, '%Y.%m.%d %H:%i'),
- mimetype, description, ispatch, isobsolete, isprivate,
+ &::SendSQL("SELECT attach_id, " .
+ $dbh->sql_date_format('creation_ts', '%Y.%m.%d %H:%i') .
+ ", mimetype, description, ispatch, isobsolete, isprivate,
submitter_id, LENGTH(thedata)
FROM attachments WHERE bug_id = $bugid ORDER BY attach_id
");
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm
index 5e25820e9..2f1df58bd 100755
--- a/Bugzilla/Bug.pm
+++ b/Bugzilla/Bug.pm
@@ -144,18 +144,19 @@ sub initBug {
rep_platform, op_sys, bug_status, resolution, priority,
bug_severity, bugs.component_id, components.name, assigned_to,
reporter, bug_file_loc, short_desc, target_milestone,
- qa_contact, status_whiteboard,
- DATE_FORMAT(creation_ts,'%Y.%m.%d %H:%i'),
+ qa_contact, status_whiteboard, " .
+ $dbh->sql_date_format('creation_ts', '%Y.%m.%d %H:%i') . ",
delta_ts, COALESCE(SUM(votes.vote_count), 0),
reporter_accessible, cclist_accessible,
- estimated_time, remaining_time, DATE_FORMAT(deadline,'%Y-%m-%d')
- from bugs left join votes using(bug_id),
+ estimated_time, remaining_time, " .
+ $dbh->sql_date_format('deadline', '%Y-%m-%d') . ",
+ FROM bugs LEFT JOIN votes using(bug_id),
classifications, products, components
WHERE bugs.bug_id = ?
AND classifications.id = products.classification_id
AND products.id = bugs.product_id
AND components.id = bugs.component_id
- group by bugs.bug_id";
+ GROUP BY bugs.bug_id";
my $bug_sth = $dbh->prepare($query);
$bug_sth->execute($bug_id);
@@ -534,11 +535,11 @@ sub GetComments {
my @comments;
my $sth = $dbh->prepare(
"SELECT profiles.realname AS name, profiles.login_name AS email,
- date_format(longdescs.bug_when,'%Y.%m.%d %H:%i') AS time,
- longdescs.thetext AS body, longdescs.work_time,
+ " . $dbh->sql_date_format('longdescs.bug_when', '%Y.%m.%d %H:%i') . "
+ AS time, longdescs.thetext AS body, longdescs.work_time,
isprivate, already_wrapped,
- date_format(longdescs.bug_when,'%Y%m%d%H%i%s')
- FROM longdescs, profiles
+ " . $dbh->sql_date_format('longdescs.bug_when', '%Y%m%d%H%i%s') . "
+ FROM longdescs, profiles
WHERE profiles.userid = longdescs.who
AND longdescs.bug_id = ?
ORDER BY longdescs.bug_when");