Index: dblist.php =================================================================== --- dblist.php (revision 15437) +++ dblist.php (working copy) @@ -697,7 +697,8 @@ $group = $this->GetGroupClause(); if ( $for_counting ) { - $optimizer = new LeftJoinOptimizer($q, $where . '|' . $having . '|' . $order . '|' . $group . '|' . $keep_clause); + $usage_string = $where . '|' . $having . '|' . $order . '|' . $group . '|' . $keep_clause; + $optimizer = new LeftJoinOptimizer($q, str_replace('%1$s', $this->TableName, $usage_string)); $q = $optimizer->simplify(); }