- fix table aliases
This commit is contained in:
ccooper%deadsquid.com 2007-06-08 16:52:30 +00:00
Родитель cf0002f6fe
Коммит 10e2fa515c
4 изменённых файлов: 9 добавлений и 8 удалений

Просмотреть файл

@ -149,8 +149,9 @@ sub coverage() {
$sql .= " AND tr.user_id=" . $user->{'user_id'};
}
if ($trusted) {
$sql .= " AND tr.user_id=u.user_id AND u.user_id=ugm.user_id AND ugm.group_id=sd.group_id ";
$sql .= " AND (sd.grouptype=1 OR sd.grouptype=3)";
$sql .= " AND tr.user_id=u.user_id AND u.user_id=ugm.user_id AND ugm.group_id=sg.group_id ";
$sql .= " AND (sg.grouptype=1 OR sg.grouptype=3)";
}
$sql .= " GROUP BY tr.testcase_id";

Просмотреть файл

@ -355,7 +355,7 @@ $sql .= " WHERE
if ($trusted) {
$sql .= " AND tr.user_id=u.user_id AND u.user_id=ugm.user_id AND
ugm.group_id=sd.group_id AND (secgrps.grouptype=1 OR secgrps.grouptype=3)";
ugm.group_id=secgrps.group_id AND (secgrps.grouptype=1 OR secgrps.grouptype=3)";
}
$sql .= $self->getCriteriaSql();
@ -420,7 +420,7 @@ $sql .= " WHERE
if ($trusted) {
$sql .= " AND tr.user_id=u.user_id AND u.user_id=ugm.user_id AND
ugm.group_id=sd.group_id AND (secgrps.grouptype=1 OR secgrps.grouptype=3)";
ugm.group_id=secgrps.group_id AND (secgrps.grouptype=1 OR secgrps.grouptype=3)";
}
$sql .= $self->getCriteriaSql();
@ -477,7 +477,7 @@ $sql .= " WHERE
if ($trusted) {
$sql .= " AND tr.user_id=u.user_id AND u.user_id=ugm.user_id AND
ugm.group_id=sd.group_id AND (secgrps.grouptype=1 OR secgrps.grouptype=3)";
ugm.group_id=secgrps.group_id AND (secgrps.grouptype=1 OR secgrps.grouptype=3)";
}
$sql .= $self->getCriteriaSql();

Просмотреть файл

@ -233,7 +233,7 @@ sub coverage() {
}
if ($trusted) {
$from .= ", user_group_map ugm, security_groups sg";
$where .= " AND tr.user_id=u.user_id AND u.user_id=ugm.user_id AND ugm.group_id=sd.group_id AND (sg.grouptype=1 OR sg.grouptype=3)";
$where .= " AND tr.user_id=u.user_id AND u.user_id=ugm.user_id AND ugm.group_id=sg.group_id AND (sg.grouptype=1 OR sg.grouptype=3)";
}
my $sql = $select . $from . $where . $order_by;
#print $sql,"<br/>\n";

Просмотреть файл

@ -133,8 +133,8 @@ Litmus::DB::Testresult->set_sql(CompletedByTrusted => qq{
tr.opsys_id=? AND
tr.user_id=u.user_id AND
AND tr.user_id=u.user_id AND u.user_id=ugm.user_id AND
ugm.group_id=sd.group_id AND
(sd.grouptype=1 OR sd.grouptype=3)
ugm.group_id=sg.group_id AND
(sg.grouptype=1 OR sg.grouptype=3)
ORDER BY tr.submission_time DESC
});