Index: includes/bootstrap.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v
retrieving revision 1.206.2.29
diff -u -r1.206.2.29 bootstrap.inc
--- includes/bootstrap.inc	6 Aug 2010 11:50:24 -0000	1.206.2.29
+++ includes/bootstrap.inc	17 Sep 2010 14:17:43 -0000
@@ -927,7 +927,9 @@
  *
  * @param $type
  *   The category to which this message belongs. Can be any string, but the
- *   general practice is to use the name of the module calling watchdog().
+ *   general practice is to use the name of the module calling watchdog(). If
+ *   dblog is enabled and this string is longer than 32 characters, it will be
+ *   trimmed to fit.
  * @param $message
  *   The message to store in the log. See t() for documentation
  *   on how $message and $variables interact. Keep $message
Index: modules/dblog/dblog.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/dblog/dblog.install,v
retrieving revision 1.6.2.3
diff -u -r1.6.2.3 dblog.install
--- modules/dblog/dblog.install	14 Sep 2009 08:19:24 -0000	1.6.2.3
+++ modules/dblog/dblog.install	17 Sep 2010 14:15:14 -0000
@@ -37,7 +37,7 @@
       ),
       'type' => array(
         'type' => 'varchar',
-        'length' => 16,
+        'length' => 32,
         'not null' => TRUE,
         'default' => '',
         'description' => 'Type of log message, for example "user" or "page not found."',
@@ -114,6 +114,20 @@
   return $ret;
 }
 
+function dblog_update_6001() {
+   db_add_index($ret, 'watchdog', 'uid', array('uid'));
+   return $ret;
+ }
+
+/**
+ * Allow longer type values.
+ */
+function dblog_update_6002() {
+  $ret = array();
+  db_change_field($ret, 'watchdog', 'type', 'type', array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => ''));
+  return $ret;
+}
+
 /**
  * @} End of "defgroup updates-6.x-extra"
  * The next series of updates should start at 7000.
Index: modules/dblog/dblog.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/dblog/dblog.module,v
retrieving revision 1.21.2.3
diff -u -r1.21.2.3 dblog.module
--- modules/dblog/dblog.module	1 Mar 2010 10:26:48 -0000	1.21.2.3
+++ modules/dblog/dblog.module	17 Sep 2010 14:10:52 -0000
@@ -128,6 +128,9 @@
 
 /**
  * Implementation of hook_watchdog().
+ *
+ * Note that if the 'type' field is longer than 32 characters, it will be
+ * trimmed to fit.
  */
 function dblog_watchdog($log = array()) {
   $current_db = db_set_active();
@@ -136,7 +139,7 @@
     VALUES
     (%d, '%s', '%s', '%s', %d, '%s', '%s', '%s', '%s', %d)",
     $log['user']->uid,
-    $log['type'],
+    substr($log['type'], 0, 32),
     $log['message'],
     serialize($log['variables']),
     $log['severity'],
