? sites/default/modules
? sites/default/settings.php
? themes/engines/phptemplate/.new.phptempla
Index: modules/dblog/dblog.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/dblog/dblog.admin.inc,v
retrieving revision 1.8
diff -u -p -r1.8 dblog.admin.inc
--- modules/dblog/dblog.admin.inc	19 Jul 2008 07:44:45 -0000	1.8
+++ modules/dblog/dblog.admin.inc	13 Oct 2008 07:25:06 -0000
@@ -108,10 +108,11 @@ function dblog_top($type) {
     array('data' => t('Message'), 'field' => 'message')
   );
 
-  $result = pager_query("SELECT COUNT(wid) AS count, message, variables FROM {watchdog} WHERE type = '%s' GROUP BY message, variables " . tablesort_sql($header), 30, 0, "SELECT COUNT(DISTINCT(message)) FROM {watchdog} WHERE type = '%s'", $type);
+  $result = pager_query("SELECT COUNT(wid) AS count, message FROM {watchdog} WHERE type = %s GROUP BY message " . tablesort_sql($header), 30, 0, "SELECT COUNT(DISTINCT(message)) FROM {watchdog} WHERE type = %s", $type);
 
   $rows = array();
   while ($dblog = db_fetch_object($result)) {
+    $dblog->variables = db_query("SELECT variables FROM {watchdog} WHERE message = :message", array(':message' => $dblog->message))->fetchField();    
     $rows[] = array($dblog->count, truncate_utf8(_dblog_format_message($dblog), 56, TRUE, TRUE));
   }
 
Index: modules/dblog/dblog.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/dblog/dblog.install,v
retrieving revision 1.8
diff -u -p -r1.8 dblog.install
--- modules/dblog/dblog.install	21 Aug 2008 19:36:37 -0000	1.8
+++ modules/dblog/dblog.install	13 Oct 2008 07:25:06 -0000
@@ -49,8 +49,8 @@ function dblog_schema() {
         'description' => t('Text of log message to be passed into the t() function.'),
       ),
       'variables' => array(
-        'type' => 'text',
-        'not null' => TRUE,
+        'type' => 'blob',
+        'not null' => FALSE,
         'size' => 'big',
         'description' => t('Serialized array of variables that match the message string and that is passed into the t() function.'),
       ),
@@ -105,6 +105,11 @@ function dblog_schema() {
 }
 
 /**
+ * @defgroup updates-6.x-to-7.x Database logging updates from 6.x to 7.x
+ * @{
+ */
+
+/**
  * Allow NULL values for links.
  */
 function dblog_update_7001() {
@@ -113,3 +118,18 @@ function dblog_update_7001() {
   db_change_field($ret, 'watchdog', 'referer', 'referer', array('type' => 'varchar', 'length' => 255, 'not null' => FALSE, 'default' => ''));
   return $ret;
 }
+
+/**
+ * Remap {watchdog}.variables as BLOB type.
+ */
+function dblog_update_7002() {
+  $ret = array();
+  db_change_field($ret, 'watchdog', 'variables', 'variables', array('type' => 'blob', 'not null' => FALSE, 'size' => 'big'));
+
+  return $ret;
+}
+
+/**
+ * @} End of "defgroup updates-6.x-to-7.x"
+ * The next series of updates should start at 8000.
+ */
Index: modules/dblog/dblog.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/dblog/dblog.module,v
retrieving revision 1.28
diff -u -p -r1.28 dblog.module
--- modules/dblog/dblog.module	6 Oct 2008 11:30:11 -0000	1.28
+++ modules/dblog/dblog.module	13 Oct 2008 07:25:06 -0000
@@ -119,26 +119,20 @@ function _dblog_get_message_types() {
 }
 
 function dblog_watchdog($log = array()) {
-  $current_db = db_set_active();
-  db_query("INSERT INTO {watchdog}
-    (uid, type, message, variables, severity, link, location, referer, hostname, timestamp)
-    VALUES
-    (%d, '%s', '%s', '%s', %d, '%s', '%s', '%s', '%s', %d)",
-    $log['user']->uid,
-    $log['type'],
-    $log['message'],
-    serialize($log['variables']),
-    $log['severity'],
-    $log['link'],
-    $log['request_uri'],
-    $log['referer'],
-    $log['ip'],
-    $log['timestamp']
-  );
-
-  if ($current_db) {
-    db_set_active($current_db);
-  }
+  Database::getConnection('default')->insert('watchdog')
+    ->fields(array(
+      'uid' => $log['user']->uid,
+      'type' => $log['type'],
+      'message' => $log['message'],
+      'variables' => serialize($log['variables']),
+      'severity' => $log['severity'],
+      'link' => $log['link'],
+      'location' => $log['request_uri'],
+      'referer' => $log['referer'],
+      'hostname' => $log['ip'],
+      'timestamp' => $log['timestamp'],
+    ))
+    ->execute();
 }
 
 /**
