? sites/default/files ? sites/default/settings.php Index: includes/database/mysql/schema.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/database/mysql/schema.inc,v retrieving revision 1.1 diff -u -p -r1.1 schema.inc --- includes/database/mysql/schema.inc 21 Aug 2008 19:36:36 -0000 1.1 +++ includes/database/mysql/schema.inc 27 Aug 2008 20:23:32 -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.24 diff -u -p -r1.24 comment.install --- modules/comment/comment.install 2 Aug 2008 20:29:43 -0000 1.24 +++ modules/comment/comment.install 27 Aug 2008 20:23:33 -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.647 diff -u -p -r1.647 comment.module --- modules/comment/comment.module 21 Aug 2008 19:36:36 -0000 1.647 +++ modules/comment/comment.module 27 Aug 2008 20:23:34 -0000 @@ -666,7 +666,17 @@ 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']); + db_update('comments')->fields(array( + 'status' => $edit['status'], + 'timestamp' => $edit['timestamp'], + 'subject' => $edit['subject'], + 'comment' => $edit['comment'], + 'format' => $edit['format'], + 'uid' => $edit['uid'], + 'name' => $edit['name'], + 'mail' => $edit['mail'], + 'homepage' => $edit['homepage'] + ))->condition('cid', $edit['cid'])->execute(); // Allow modules to respond to the updating of a comment. comment_invoke_comment($edit, 'update'); // Add an entry to the watchdog log. @@ -719,8 +729,21 @@ 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['cid'] = db_insert('comments')->fields(array( + 'nid' => $edit['nid'], + 'pid' => $edit['pid'], + 'uid' => $edit['uid'], + 'subject' => $edit['subject'], + 'comment' => $edit['comment'], + 'format' => $edit['format'], + 'hostname' => ip_address(), + 'timestamp' => $edit['timestamp'], + 'status' => $edit['status'], + 'thread' => $thread, + 'name' => $edit['name'], + 'mail' => $edit['mail'], + 'homepage' => $edit['homepage'] + ))->execute(); // Tell the other modules a new comment has been submitted. comment_invoke_comment($edit, 'insert'); // Add an entry to the watchdog log.