зеркало из https://github.com/mozilla/pjs.git
Patch by daa@rmi.net (Dave Avery) -- newer alphas of MySQL won't let
use "when" as a column name, so let's change our usage while it's still easy to do so.
This commit is contained in:
Родитель
c1f31aefa7
Коммит
00e1989d67
|
@ -523,16 +523,16 @@ sub DumpBugActivity {
|
|||
my ($id, $starttime) = (@_);
|
||||
my $datepart = "";
|
||||
if (defined $starttime) {
|
||||
$datepart = "and bugs_activity.when >= $starttime";
|
||||
$datepart = "and bugs_activity.bug_when >= $starttime";
|
||||
}
|
||||
my $query = "
|
||||
select bugs_activity.field, bugs_activity.when,
|
||||
select bugs_activity.field, bugs_activity.bug_when,
|
||||
bugs_activity.oldvalue, bugs_activity.newvalue,
|
||||
profiles.login_name
|
||||
from bugs_activity,profiles
|
||||
where bugs_activity.bug_id = $id $datepart
|
||||
and profiles.userid = bugs_activity.who
|
||||
order by bugs_activity.when";
|
||||
order by bugs_activity.bug_when";
|
||||
|
||||
SendSQL($query);
|
||||
|
||||
|
|
|
@ -10,6 +10,14 @@ query the CVS tree. For example,
|
|||
will tell you what has been changed in the last week.
|
||||
|
||||
|
||||
9/15/99 Apparently, newer alphas of MySQL won't allow you to have
|
||||
"when" as a column name. So, I have had to rename a column in the
|
||||
bugs_activity table. You must feed the below to mysql or you won't
|
||||
work at all.
|
||||
|
||||
alter table bugs_activity change column when bug_when datetime not null;
|
||||
|
||||
|
||||
8/16/99 Added "OpenVMS" to the list of OS's. Feed this to mysql:
|
||||
|
||||
alter table bugs change column op_sys op_sys enum("All", "Windows 3.1", "Windows 95", "Windows 98", "Windows NT", "Mac System 7", "Mac System 7.5", "Mac System 7.6.1", "Mac System 8.0", "Mac System 8.5", "Mac System 8.6", "AIX", "BSDI", "HP-UX", "IRIX", "Linux", "FreeBSD", "OSF/1", "Solaris", "SunOS", "Neutrino", "OS/2", "BeOS", "OpenVMS", "other") not null;
|
||||
|
|
|
@ -392,13 +392,13 @@ if (defined $ref && 0 < @$ref) {
|
|||
}
|
||||
$query .= "and bugs_activity.bug_id = bugs.bug_id and (" .
|
||||
join(' or ', @list) . ") ";
|
||||
$query .= "and bugs_activity.when >= " .
|
||||
$query .= "and bugs_activity.bug_when >= " .
|
||||
SqlifyDate($::FORM{'chfieldfrom'}) . "\n";
|
||||
my $to = $::FORM{'chfieldto'};
|
||||
if (defined $to) {
|
||||
$to = trim($to);
|
||||
if ($to ne "" && $to !~ /^now$/i) {
|
||||
$query .= "and bugs_activity.when <= " . SqlifyDate($to) . "\n";
|
||||
$query .= "and bugs_activity.bug_when <= " . SqlifyDate($to) . "\n";
|
||||
}
|
||||
}
|
||||
my $value = $::FORM{'chfieldvalue'};
|
||||
|
|
|
@ -1,47 +0,0 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# The contents of this file are subject to the Mozilla Public License
|
||||
# Version 1.0 (the "License"); you may not use this file except in
|
||||
# compliance with the License. You may obtain a copy of the License at
|
||||
# http://www.mozilla.org/MPL/
|
||||
#
|
||||
# Software distributed under the License is distributed on an "AS IS"
|
||||
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing rights and limitations
|
||||
# under the License.
|
||||
#
|
||||
# The Original Code is the Bugzilla Bug Tracking System.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape Communications
|
||||
# Corporation. Portions created by Netscape are Copyright (C) 1998
|
||||
# Netscape Communications Corporation. All Rights Reserved.
|
||||
#
|
||||
# Contributor(s): Terry Weissman <terry@mozilla.org>
|
||||
|
||||
mysql > /dev/null 2>/dev/null << OK_ALL_DONE
|
||||
|
||||
use bugs;
|
||||
|
||||
drop table bugs_activity
|
||||
OK_ALL_DONE
|
||||
mysql << OK_ALL_DONE
|
||||
use bugs;
|
||||
create table bugs_activity (
|
||||
bug_id mediumint not null,
|
||||
who mediumint not null,
|
||||
when datetime not null,
|
||||
field varchar(64) not null,
|
||||
oldvalue tinytext,
|
||||
newvalue tinytext,
|
||||
|
||||
index (bug_id),
|
||||
index (when),
|
||||
index (field)
|
||||
);
|
||||
|
||||
|
||||
|
||||
show columns from bugs_activity;
|
||||
show index from bugs_activity;
|
||||
|
||||
OK_ALL_DONE
|
|
@ -292,7 +292,7 @@ sub LogDependencyActivity {
|
|||
my ($i, $oldstr, $target, $me) = (@_);
|
||||
my $newstr = SnapShotDeps($i, $target, $me);
|
||||
if ($oldstr ne $newstr) {
|
||||
SendSQL("insert into bugs_activity (bug_id,who,when,field,oldvalue,newvalue) values ($i,$whoid,$timestamp,'$target','$oldstr','$newstr')");
|
||||
SendSQL("insert into bugs_activity (bug_id,who,bug_when,field,oldvalue,newvalue) values ($i,$whoid,$timestamp,'$target','$oldstr','$newstr')");
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
|
@ -491,7 +491,7 @@ The changes made were:
|
|||
$col = SqlQuote($col);
|
||||
$old = SqlQuote($old);
|
||||
$new = SqlQuote($new);
|
||||
my $q = "insert into bugs_activity (bug_id,who,when,field,oldvalue,newvalue) values ($id,$whoid,$timestamp,$col,$old,$new)";
|
||||
my $q = "insert into bugs_activity (bug_id,who,bug_when,field,oldvalue,newvalue) values ($id,$whoid,$timestamp,$col,$old,$new)";
|
||||
# puts "<pre>$q</pre>"
|
||||
SendSQL($q);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче