? 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 19:09:14 -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/aggregator/aggregator.install =================================================================== RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.install,v retrieving revision 1.17 diff -u -p -r1.17 aggregator.install --- modules/aggregator/aggregator.install 12 Aug 2008 07:00:48 -0000 1.17 +++ modules/aggregator/aggregator.install 27 Aug 2008 19:09:14 -0000 @@ -229,8 +229,9 @@ function aggregator_schema() { 'description' => t('Author of the feed item.'), ), 'description' => array( - 'type' => 'text', + 'type' => 'blob', 'not null' => TRUE, + 'default' => '', 'size' => 'big', 'description' => t('Body of the feed item.'), ), @@ -263,3 +264,13 @@ function aggregator_update_7000() { db_add_field($ret, 'aggregator_feed', 'hash', array('type' => 'varchar', 'length' => 32, 'not null' => TRUE, 'default' => '')); return $ret; } + +/** + * Remap {aggregator_item}.description as BLOB type. + */ +function aggregator_update_7001() { + $ret = array(); + db_change_field($ret, 'aggregator_item', 'description', 'description', array('type' => 'blob', 'not null' => TRUE, 'default' => '', 'size' => 'big')); + + return $ret; +} Index: modules/aggregator/aggregator.module =================================================================== RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.module,v retrieving revision 1.389 diff -u -p -r1.389 aggregator.module --- modules/aggregator/aggregator.module 16 Aug 2008 14:48:17 -0000 1.389 +++ modules/aggregator/aggregator.module 27 Aug 2008 19:09:14 -0000 @@ -836,15 +836,29 @@ function aggregator_parse_feed(&$data, $ */ function aggregator_save_item($edit) { if ($edit['iid'] && $edit['title']) { - db_query("UPDATE {aggregator_item} SET title = '%s', link = '%s', author = '%s', description = '%s', guid = '%s', timestamp = %d WHERE iid = %d", $edit['title'], $edit['link'], $edit['author'], $edit['description'], $edit['guid'], $edit['timestamp'], $edit['iid']); + db_update('aggregator_item')->fields(array( + 'title' => $edit['title'], + 'link' => $edit['link'], + 'author' => $edit['author'], + 'description' => $edit['description'], + 'guid' => $edit['guid'], + 'timestamp' => $edit['timestamp'] + ))->condition('iid', $edit['iid'])->execute(); } elseif ($edit['iid']) { db_query('DELETE FROM {aggregator_item} WHERE iid = %d', $edit['iid']); db_query('DELETE FROM {aggregator_category_item} WHERE iid = %d', $edit['iid']); } elseif ($edit['title'] && $edit['link']) { - db_query("INSERT INTO {aggregator_item} (fid, title, link, author, description, timestamp, guid) VALUES (%d, '%s', '%s', '%s', '%s', %d, '%s')", $edit['fid'], $edit['title'], $edit['link'], $edit['author'], $edit['description'], $edit['timestamp'], $edit['guid']); - $edit['iid'] = db_last_insert_id('aggregator_item', 'iid'); + $edit['iid'] = db_insert('aggregator_item')->fields(array( + 'fid' => $edit['fid'], + 'title' => $edit['title'], + 'link' => $edit['link'], + 'author' => $edit['author'], + 'description' => $edit['description'], + 'guid' => $edit['guid'], + 'timestamp' => $edit['timestamp'] + ))->execute(); // file the items in the categories indicated by the feed $categories = db_query('SELECT cid FROM {aggregator_category_feed} WHERE fid = %d', $edit['fid']); while ($category = db_fetch_object($categories)) {