do not use count(distinct) for SQLite

This commit is contained in:
Garvin Hicking 2008-12-09 10:08:29 +00:00
parent 61be3385e3
commit 63fe29e942

View File

@ -473,6 +473,12 @@ class serendipity_archives_plugin extends serendipity_plugin {
echo '<ul>' . "\n"; echo '<ul>' . "\n";
if ($serendipity['dbType'] == 'sqlite' || $serendipity['dbType'] == 'sqlite3') {
$dist_sql = 'count(e.id) AS orderkey';
} else {
$dist_sql = 'count(DISTINCT e.id) AS orderkey';
}
for($x = 0; $x < $max_x; $x++) { for($x = 0; $x < $max_x; $x++) {
$current_ts = $ts; $current_ts = $ts;
switch($freq) { switch($freq) {
@ -552,7 +558,7 @@ class serendipity_archives_plugin extends serendipity_plugin {
'', '',
false, false,
true, true,
'count(DISTINCT e.id) AS orderkey', $dist_sql,
'', '',
'single', 'single',
false, $category_set // the joins used false, $category_set // the joins used