change row to r everywhere; see : https://sourceforge.net/p/postfixadmin/discussion/676076/thread/616c1d25/?limit=25#7da0 - hopefully removing "row" which might be a reserved keyword for some databases etc

postfixadmin_3.2
David Goodwin 5 years ago
parent 938d71758a
commit c65a99ce2d

@ -544,8 +544,8 @@ function create_page_browser($idxfield, $querypart) {
if (db_pgsql()) {
$query = "
SELECT * FROM (
SELECT $idxfield AS label, nextval('rowcount') AS row $querypart
) idx WHERE MOD(idx.row, $page_size) IN (0,$page_size_zerobase) OR idx.row = $count_results
SELECT $idxfield AS label, nextval('rowcount') AS r $querypart
) idx WHERE MOD(idx.r, $page_size) IN (0,$page_size_zerobase) OR idx.r = $count_results
";
}
@ -554,9 +554,9 @@ function create_page_browser($idxfield, $querypart) {
$end = $bits[1];
$query = "
WITH idx AS (SELECT * $querypart)
SELECT $end AS label, (SELECT (COUNT(*) - 1) FROM idx t1 WHERE t1.$end <= t2.$end ) AS row
SELECT $end AS label, (SELECT (COUNT(*) - 1) FROM idx t1 WHERE t1.$end <= t2.$end ) AS r
FROM idx t2
WHERE (row % $page_size) IN (0,$page_size_zerobase) OR row = $count_results";
WHERE (r % $page_size) IN (0,$page_size_zerobase) OR r = $count_results";
}
# TODO: $query is MySQL-specific

Loading…
Cancel
Save