? 371235-patched-benchmarks.txt
? 371235-unpatched-benchmarks.txt
? sites/all/modules/cvs
Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.470
diff -u -p -r1.470 theme.inc
--- includes/theme.inc	22 Feb 2009 17:55:29 -0000	1.470
+++ includes/theme.inc	24 Feb 2009 19:30:50 -0000
@@ -1692,6 +1692,9 @@ function theme_username($object) {
 
     $output .= ' (' . t('not verified') . ')';
   }
+  elseif (!empty($object->hostname)) {
+    $output = check_plain($object->hostname);
+  }
   else {
     $output = variable_get('anonymous', t('Anonymous'));
   }
Index: modules/dblog/dblog.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/dblog/dblog.admin.inc,v
retrieving revision 1.12
diff -u -p -r1.12 dblog.admin.inc
--- modules/dblog/dblog.admin.inc	18 Feb 2009 15:19:55 -0000	1.12
+++ modules/dblog/dblog.admin.inc	24 Feb 2009 19:30:50 -0000
@@ -63,7 +63,7 @@ function dblog_overview() {
     array('data' => t('Operations')),
   );
 
-  $sql = "SELECT w.wid, w.uid, w.severity, w.type, w.timestamp, w.message, w.variables, w.link, u.name FROM {watchdog} w INNER JOIN {users} u ON w.uid = u.uid";
+  $sql = "SELECT w.wid, w.uid, w.severity, w.type, w.timestamp, w.message, w.variables, w.link, w.hostname, u.name FROM {watchdog} w INNER JOIN {users} u ON w.uid = u.uid";
   $tablesort = tablesort_sql($header);
   if (!empty($filter['where'])) {
     $result = pager_query($sql . " WHERE " . $filter['where'] . $tablesort, 50, 0, NULL, $filter['args']);
Index: modules/poll/poll.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/poll/poll.pages.inc,v
retrieving revision 1.13
diff -u -p -r1.13 poll.pages.inc
--- modules/poll/poll.pages.inc	18 Feb 2009 15:19:56 -0000	1.13
+++ modules/poll/poll.pages.inc	24 Feb 2009 19:30:50 -0000
@@ -31,15 +31,28 @@ function poll_votes($node) {
   drupal_set_title($node->title);
   $output = t('This table lists all the recorded votes for this poll. If anonymous users are allowed to vote, they will be identified by the IP address of the computer they used when they voted.');
 
-  $header[] = array('data' => t('Visitor'), 'field' => 'u.name');
-  $header[] = array('data' => t('Vote'), 'field' => 'pc.chtext');
-  $header[] = array('data' => t('Timestamp'), 'field' => 'pv.timestamp', 'sort' => 'desc');
+  $header = array(
+    array('data' => t('Visitor'), 'field' => 'u.name'),
+    array('data' => t('Vote'), 'field' => 'pc.chtext'),
+    array('data' => t('Timestamp'), 'field' => 'pv.timestamp', 'sort' => 'desc'),
+  );
+
+  $query = db_select('poll_vote', 'pv');
+  $query->join('poll_choice', 'pc', 'pv.chid = pc.chid');
+  $query->leftjoin('users', 'u', 'pv.uid = u.uid');
+  $query->fields('pv', array('chid', 'uid', 'hostname', 'timestamp', 'nid'));
+  $query->fields('pc', array('chtext'));
+  $query->fields('u', array('name'));
+  $query->condition('pv.nid', $node->nid);
+  $query->extend('PagerDefault')->extend('TableSort')
+        ->limit(20)
+        ->setHeader($header);
+  $result = $query->execute();
 
-  $result = pager_query("SELECT pv.chid, pv.uid, pv.hostname, pv.timestamp, pv.nid, pc.chtext, u.name FROM {poll_vote} pv INNER JOIN {poll_choice} pc ON pv.chid = pc.chid LEFT JOIN {users} u ON pv.uid = u.uid WHERE pv.nid = %d". tablesort_sql($header), 20, 0, NULL, $node->nid);
   $rows = array();
-  while ($vote = db_fetch_object($result)) {
+  foreach ($result as $vote) {
     $rows[] = array(
-      $vote->name ? theme('username', $vote) : check_plain($vote->hostname),
+      theme('username', $vote),
       check_plain($vote->chtext),
       format_date($vote->timestamp),
     );
Index: modules/statistics/statistics.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/statistics/statistics.admin.inc,v
retrieving revision 1.18
diff -u -p -r1.18 statistics.admin.inc
--- modules/statistics/statistics.admin.inc	18 Feb 2009 15:19:56 -0000	1.18
+++ modules/statistics/statistics.admin.inc	24 Feb 2009 19:30:51 -0000
@@ -17,11 +17,17 @@ function statistics_recent_hits() {
     array('data' => t('Operations'))
   );
 
-  $sql = 'SELECT a.aid, a.path, a.title, a.uid, u.name, a.timestamp FROM {accesslog} a LEFT JOIN {users} u ON u.uid = a.uid' . tablesort_sql($header);
+  $query = db_select('accesslog', 'a');
+  $query->join('users', 'u', 'a.uid = u.uid');
+  $query->fields('a', array('aid', 'path', 'title', 'uid', 'hostname', 'timestamp'));
+  $query->fields('u', array('name'));
+  $query->extend('PagerDefault')->extend('TableSort')
+        ->limit(30)
+        ->setHeader($header);
+  $result = $query->execute();
 
-  $result = pager_query($sql, 30);
   $rows = array();
-  while ($log = db_fetch_object($result)) {
+  foreach ($result as $log) {
     $rows[] = array(
       array('data' => format_date($log->timestamp, 'small'), 'class' => 'nowrap'),
       _statistics_format_item($log->title, $log->path),
@@ -90,7 +96,7 @@ function statistics_top_visitors() {
   while ($account = db_fetch_object($result)) {
     $qs = drupal_get_destination();
     $ban_link =  $account->iid ? l(t('unblock IP address'), "admin/settings/ip-blocking/delete/$account->iid", array('query' => $qs)) : l(t('block IP address'), "admin/settings/ip-blocking/$account->hostname", array('query' => $qs));
-    $rows[] = array($account->hits, ($account->uid ? theme('username', $account) : $account->hostname), format_interval(round($account->total / 1000)), (user_access('block IP addresses') && !$account->uid) ? $ban_link : '');
+    $rows[] = array($account->hits, theme('username', $account), format_interval(round($account->total / 1000)), (user_access('block IP addresses') && !$account->uid) ? $ban_link : '');
   }
 
   if (empty($rows)) {
Index: modules/statistics/statistics.pages.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/statistics/statistics.pages.inc,v
retrieving revision 1.7
diff -u -p -r1.7 statistics.pages.inc
--- modules/statistics/statistics.pages.inc	18 Feb 2009 15:19:56 -0000	1.7
+++ modules/statistics/statistics.pages.inc	24 Feb 2009 19:30:51 -0000
@@ -10,14 +10,24 @@ function statistics_node_tracker() {
   if ($node = node_load(arg(1))) {
 
     $header = array(
-        array('data' => t('Time'), 'field' => 'a.timestamp', 'sort' => 'desc'),
-        array('data' => t('Referrer'), 'field' => 'a.url'),
-        array('data' => t('User'), 'field' => 'u.name'),
-        array('data' => t('Operations')));
+      array('data' => t('Time'), 'field' => 'a.timestamp', 'sort' => 'desc'),
+      array('data' => t('Referrer'), 'field' => 'a.url'),
+      array('data' => t('User'), 'field' => 'u.name'),
+      array('data' => t('Operations')),
+    );
+
+    $query = db_select('accesslog', 'a');
+    $query->join('users', 'u', 'a.uid = u.uid');
+    $query->fields('a', array('aid', 'timestamp', 'url', 'uid', 'hostname'));
+    $query->fields('u', array('name'));
+    $query->condition('a.path', 'node/'. $node->nid);
+    $query->extend('PagerDefault')->extend('TableSort')
+          ->limit(30)
+          ->setHeader($header);
+    $result = $query->execute();
 
-    $result = pager_query('SELECT a.aid, a.timestamp, a.url, a.uid, u.name FROM {accesslog} a LEFT JOIN {users} u ON a.uid = u.uid WHERE a.path LIKE \'node/%d%%\'' . tablesort_sql($header), 30, 0, NULL, $node->nid);
     $rows = array();
-    while ($log = db_fetch_object($result)) {
+    foreach ($result as $log) {
       $rows[] = array(
         array('data' => format_date($log->timestamp, 'small'), 'class' => 'nowrap'),
         _statistics_link($log->url),
