? sites/default/files
? sites/default/modules
? sites/default/settings.php
Index: includes/database/mysql/schema.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/database/mysql/schema.inc,v
retrieving revision 1.3
diff -u -p -r1.3 schema.inc
--- includes/database/mysql/schema.inc	19 Sep 2008 20:30:32 -0000	1.3
+++ includes/database/mysql/schema.inc	24 Sep 2008 16:09:22 -0000
@@ -73,6 +73,12 @@ class DatabaseSchema_mysql extends Datab
   protected function createFieldSql($name, $spec) {
     $sql = "`" . $name . "` " . $spec['mysql_type'];
 
+    // BLOB and TEXT columns cannot have DEFAULT values.
+    // Refer to http://dev.mysql.com/doc/refman/5.1/en/blob.html
+    if (($spec['type'] == 'text') || ($spec['type'] == 'blob')) {
+      unset($spec['default']);
+    }
+
     if (isset($spec['length'])) {
       $sql .= '(' . $spec['length'] . ')';
     }
Index: modules/comment/comment.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.install,v
retrieving revision 1.26
diff -u -p -r1.26 comment.install
--- modules/comment/comment.install	17 Sep 2008 07:11:56 -0000	1.26
+++ modules/comment/comment.install	24 Sep 2008 16:09:22 -0000
@@ -109,6 +109,16 @@ function comment_update_7001() {
 }
 
 /**
+ * Remap {comments}.comment as BLOB type.
+ */
+function comment_update_7002() {
+  $ret = array();
+  db_change_field($ret, 'comments', 'comment', 'comment', array('type' => 'blob', 'not null' => TRUE, 'default' => '', 'size' => 'big'));
+
+  return $ret;
+}
+
+/**
  * @} End of "defgroup updates-6.x-to-7.x"
  * The next series of updates should start at 8000.
  */
@@ -151,8 +161,9 @@ function comment_schema() {
         'description' => t('The comment title.'),
       ),
       'comment' => array(
-        'type' => 'text',
+        'type' => 'blob',
         'not null' => TRUE,
+        'default' => '',
         'size' => 'big',
         'description' => t('The comment body.'),
       ),
Index: modules/comment/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.module,v
retrieving revision 1.650
diff -u -p -r1.650 comment.module
--- modules/comment/comment.module	17 Sep 2008 20:37:31 -0000	1.650
+++ modules/comment/comment.module	24 Sep 2008 16:09:22 -0000
@@ -666,7 +666,7 @@ function comment_save($edit) {
       );
       if ($edit['cid']) {
         // Update the comment in the database.
-        db_query("UPDATE {comments} SET status = %d, timestamp = %d, subject = '%s', comment = '%s', format = %d, uid = %d, name = '%s', mail = '%s', homepage = '%s' WHERE cid = %d", $edit['status'], $edit['timestamp'], $edit['subject'], $edit['comment'], $edit['format'], $edit['uid'], $edit['name'], $edit['mail'], $edit['homepage'], $edit['cid']);
+        drupal_write_record('comments', $edit, 'cid');
         // Allow modules to respond to the updating of a comment.
         comment_invoke_comment($edit, 'update');
         // Add an entry to the watchdog log.
@@ -719,8 +719,11 @@ function comment_save($edit) {
           $edit['name'] = $user->name;
         }
 
-        db_query("INSERT INTO {comments} (nid, pid, uid, subject, comment, format, hostname, timestamp, status, thread, name, mail, homepage) VALUES (%d, %d, %d, '%s', '%s', %d, '%s', %d, %d, '%s', '%s', '%s', '%s')", $edit['nid'], $edit['pid'], $edit['uid'], $edit['subject'], $edit['comment'], $edit['format'], ip_address(), $edit['timestamp'], $edit['status'], $thread, $edit['name'], $edit['mail'], $edit['homepage']);
-        $edit['cid'] = db_last_insert_id('comments', 'cid');
+        $edit += array(
+          'hostname' => ip_address(),
+          'thread' => $thread
+        );
+        drupal_write_record('comments', $edit);
         // Tell the other modules a new comment has been submitted.
         comment_invoke_comment($edit, 'insert');
         // Add an entry to the watchdog log.
