mirror of
https://git.freebsd.org/ports.git
synced 2025-06-13 16:50:29 -04:00
- Pass Maintainership to Submitter PR: 230712 Submitted by: Krzysztof <ports@bsdserwis.com> Sponsored by: Netzkommune GmbH Differential Revision: https://reviews.freebsd.org/D17946
143 lines
5.2 KiB
PHP
143 lines
5.2 KiB
PHP
--- lib/DBEngine.class.php.orig 2007-06-14 19:00:15 UTC
|
|
+++ lib/DBEngine.class.php
|
|
@@ -133,35 +133,35 @@ class DBEngine {
|
|
MAX(stattable.pending) AS pending
|
|
FROM (
|
|
SELECT CAST(time_iso AS DATE) AS date,
|
|
- COUNT(content) AS spam,
|
|
+ COUNT(msgs.content) AS spam,
|
|
0 AS banned,
|
|
0 AS viruses,
|
|
0 AS badheaders,
|
|
0 AS pending
|
|
FROM msgs INNER JOIN msgrcpt ON msgs.mail_id=msgrcpt.mail_id
|
|
- WHERE content='S' AND NOT (msgs.quar_type = '')
|
|
+ WHERE msgs.content='S' AND NOT (msgs.quar_type = '')
|
|
AND msgrcpt.rs IN ('','v')
|
|
GROUP BY CAST(time_iso AS DATE)
|
|
UNION
|
|
SELECT CAST(time_iso AS DATE) AS date,
|
|
0 AS spam,
|
|
- COUNT(content) AS banned,
|
|
+ COUNT(msgs.content) AS banned,
|
|
0 AS viruses,
|
|
0 AS badheaders,
|
|
0 AS pending
|
|
FROM msgs INNER JOIN msgrcpt ON msgs.mail_id=msgrcpt.mail_id
|
|
- WHERE content='B' AND NOT (msgs.quar_type = '')
|
|
+ WHERE msgs.content='B' AND NOT (msgs.quar_type = '')
|
|
AND msgrcpt.rs IN ('','v')
|
|
GROUP BY CAST(time_iso AS DATE)
|
|
UNION
|
|
SELECT CAST(time_iso AS DATE) AS date,
|
|
0 AS spam,
|
|
0 AS banned,
|
|
- COUNT(content) AS viruses,
|
|
+ COUNT(msgs.content) AS viruses,
|
|
0 AS badheaders,
|
|
0 AS pending
|
|
FROM msgs INNER JOIN msgrcpt ON msgs.mail_id=msgrcpt.mail_id
|
|
- WHERE content='V' AND NOT (msgs.quar_type = '')
|
|
+ WHERE msgs.content='V' AND NOT (msgs.quar_type = '')
|
|
AND msgrcpt.rs IN ('','v')
|
|
GROUP BY CAST(time_iso AS DATE)
|
|
UNION
|
|
@@ -169,10 +169,10 @@ class DBEngine {
|
|
0 AS spam,
|
|
0 AS banned,
|
|
0 AS viruses,
|
|
- COUNT(content) AS badheaders,
|
|
+ COUNT(msgs.content) AS badheaders,
|
|
0 AS pending
|
|
FROM msgs INNER JOIN msgrcpt ON msgs.mail_id=msgrcpt.mail_id
|
|
- WHERE content='H' AND NOT (msgs.quar_type = '')
|
|
+ WHERE msgs.content='H' AND NOT (msgs.quar_type = '')
|
|
AND msgrcpt.rs IN ('','v')
|
|
GROUP BY CAST(time_iso AS DATE)
|
|
UNION
|
|
@@ -181,7 +181,7 @@ class DBEngine {
|
|
0 AS banned,
|
|
0 AS viruses,
|
|
0 AS badheaders,
|
|
- COUNT(content) AS pending
|
|
+ COUNT(msgs.content) AS pending
|
|
FROM msgs JOIN msgrcpt ON msgs.mail_id=msgrcpt.mail_id
|
|
WHERE msgrcpt.rs='p' AND NOT (msgs.quar_type = '')
|
|
GROUP BY CAST(time_iso AS DATE)
|
|
@@ -240,7 +240,7 @@ class DBEngine {
|
|
$recipEmailClause = $this->convertEmailaddresses2SQL($emailaddresses);
|
|
|
|
# mysql seems to run faster with a left join
|
|
- if ($conf['db']['dbtype'] == 'mysql') {
|
|
+ if ($conf['db']['dbType'] == 'mysql') {
|
|
$join_type = ' LEFT JOIN';
|
|
} else {
|
|
$join_type = ' INNER JOIN';
|
|
@@ -254,38 +254,38 @@ class DBEngine {
|
|
MAX(stattable.pending) AS pending
|
|
FROM (
|
|
SELECT CAST(time_iso AS DATE) AS date,
|
|
- COUNT(content) AS spam,
|
|
+ COUNT(msgs.content) AS spam,
|
|
0 AS banned,
|
|
0 AS viruses,
|
|
0 AS badheaders,
|
|
0 AS pending
|
|
FROM msgs INNER JOIN msgrcpt ON msgs.mail_id=msgrcpt.mail_id
|
|
$join_type maddr AS recip ON msgrcpt.rid=recip.id
|
|
- WHERE content='S' AND NOT (msgs.quar_type = '') AND msgrcpt.rs IN ('','v')
|
|
+ WHERE msgs.content='S' AND NOT (msgs.quar_type = '') AND msgrcpt.rs IN ('','v')
|
|
AND $recipEmailClause
|
|
GROUP BY CAST(time_iso AS DATE)
|
|
UNION
|
|
SELECT CAST(time_iso AS DATE) AS date,
|
|
0 AS spam,
|
|
- COUNT(content) AS banned,
|
|
+ COUNT(msgs.content) AS banned,
|
|
0 AS viruses,
|
|
0 AS badheaders,
|
|
0 AS pending
|
|
FROM msgs INNER JOIN msgrcpt ON msgs.mail_id=msgrcpt.mail_id
|
|
$join_type maddr AS recip ON msgrcpt.rid=recip.id
|
|
- WHERE content='B' AND NOT (msgs.quar_type = '') AND msgrcpt.rs IN ('','v')
|
|
+ WHERE msgs.content='B' AND NOT (msgs.quar_type = '') AND msgrcpt.rs IN ('','v')
|
|
AND $recipEmailClause
|
|
GROUP BY CAST(time_iso AS DATE)
|
|
UNION
|
|
SELECT CAST(time_iso AS DATE) AS date,
|
|
0 AS spam,
|
|
0 AS banned,
|
|
- COUNT(content) AS viruses,
|
|
+ COUNT(msgs.content) AS viruses,
|
|
0 AS badheaders,
|
|
0 AS pending
|
|
FROM msgs INNER JOIN msgrcpt ON msgs.mail_id=msgrcpt.mail_id
|
|
$join_type maddr AS recip ON msgrcpt.rid=recip.id
|
|
- WHERE content='V' AND NOT (msgs.quar_type = '') AND msgrcpt.rs IN ('','v')
|
|
+ WHERE msgs.content='V' AND NOT (msgs.quar_type = '') AND msgrcpt.rs IN ('','v')
|
|
AND $recipEmailClause
|
|
GROUP BY CAST(time_iso AS DATE)
|
|
UNION
|
|
@@ -293,11 +293,11 @@ class DBEngine {
|
|
0 AS spam,
|
|
0 AS banned,
|
|
0 AS viruses,
|
|
- COUNT(content) AS badheaders,
|
|
+ COUNT(msgs.content) AS badheaders,
|
|
0 AS pending
|
|
FROM msgs INNER JOIN msgrcpt ON msgs.mail_id=msgrcpt.mail_id
|
|
$join_type maddr AS recip ON msgrcpt.rid=recip.id
|
|
- WHERE content='H' AND NOT (msgs.quar_type = '') AND msgrcpt.rs IN ('','v')
|
|
+ WHERE msgs.content='H' AND NOT (msgs.quar_type = '') AND msgrcpt.rs IN ('','v')
|
|
AND $recipEmailClause
|
|
GROUP BY CAST(time_iso AS DATE)
|
|
UNION
|
|
@@ -306,7 +306,7 @@ class DBEngine {
|
|
0 AS banned,
|
|
0 AS viruses,
|
|
0 AS badheaders,
|
|
- COUNT(content) AS pending
|
|
+ COUNT(msgs.content) AS pending
|
|
FROM msgs INNER JOIN msgrcpt ON msgs.mail_id=msgrcpt.mail_id
|
|
$join_type maddr AS recip ON msgrcpt.rid=recip.id
|
|
WHERE msgrcpt.rs='p' AND NOT (msgs.quar_type = '')
|