Index: modules/comment.module
===================================================================
--- modules/comment.module	(revision 5735)
+++ modules/comment.module	(working copy)
@@ -618,8 +639,18 @@
       }
 
       if ($edit['cid']) {
+        $sqlparts = array('status = \'%s\'' => 'status', 'timestamp = %d' => 'timestamp', 'subject = \'%s\'' => 'subject', 'comment = \'%s\'' => 'comment', 'format = \'%s\'' => 'format', 'uid = %d' => 'uid', 'name = \'%s\'' => 'name');
+        $sqlfields = array();
+        $sqlvalues = array();
+        foreach ($sqlparts as $sql => $arrayindex) {
+          if (isset($edit[$arrayindex])) {
+            $sqlfields[] = $sql;
+            $sqlvalues[] = $edit[$arrayindex];
+          }
+        }
         // Update the comment in the database.
-        db_query("UPDATE {comments} SET status = '%s', timestamp = %d, subject = '%s', comment = '%s', format = '%s', uid = %d, name = '%s' WHERE cid = %d", $edit['status'], $edit['timestamp'], $edit['subject'], $edit['comment'], $edit['format'], $edit['uid'], $edit['name'], $edit['cid']);
+        $sqlvalues[] = $edit['cid'];
+        db_query("UPDATE {comments} SET " . implode (', ', $sqlfields) . " WHERE cid = %d", $sqlvalues);
 
         _comment_update_node_statistics($edit['nid']);
 
