1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-10 10:44:20 +02:00

Merge branch 'develop-olympus' into develop

* develop-olympus:
  [ticket/10653] Call get_row_count of base class in mysql get_estimated_row_count
  [ticket/9813] Only get posts table row count if we detected a fulltext index.
  [ticket/9813] Also use estimated row count of posts table for fulltext mysql.
  [ticket/10653] Fix parameter to substr() in unit tests. Should be 1, not -1.
  [ticket/10653] Unit tests for get_row_count() and get_estimated_row_count().
  [ticket/10653] Add ability to count table rows to database abstraction layer.
  [ticket/9813] Use table status row count only if greater than 100000 or exact.
  [ticket/9813] Use SHOW TABLE STATUS to get search stats for native on MySQL.
This commit is contained in:
Oleg Pudeyev
2012-03-08 08:44:32 -05:00
6 changed files with 203 additions and 16 deletions

View File

@@ -897,11 +897,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
}
$db->sql_freeresult($result);
$sql = 'SELECT COUNT(post_id) as total_posts
FROM ' . POSTS_TABLE;
$result = $db->sql_query($sql);
$this->stats['total_posts'] = (int) $db->sql_fetchfield('total_posts');
$db->sql_freeresult($result);
$this->stats['total_posts'] = empty($this->stats) ? 0 : $db->get_estimated_row_count(POSTS_TABLE);
}
/**