diff -urpN drupal-6.x-dev-200707090006/includes/cache.inc drupal-6.x-dev-clob-0.3/includes/cache.inc --- drupal-6.x-dev-200707090006/includes/cache.inc 2007-05-26 05:01:30.000000000 +0800 +++ drupal-6.x-dev-clob-0.3/includes/cache.inc 2007-07-09 10:58:14.000000000 +0800 @@ -105,10 +105,11 @@ function cache_set($cid, $data, $table = $serialized = 1; } $created = time(); - db_query("UPDATE {". $table ."} SET data = %b, created = %d, expire = %d, headers = '%s', serialized = %d WHERE cid = '%s'", $data, $created, $expire, $headers, $serialized, $cid); + db_query("UPDATE {". $table ."} SET data = %b, created = %d, expire = %d, headers = '%s', serialized = %d WHERE cid = '%s'", NULL, $created, $expire, $headers, $serialized, $cid); if (!db_affected_rows()) { - @db_query("INSERT INTO {". $table ."} (cid, data, created, expire, headers, serialized) VALUES ('%s', %b, %d, %d, '%s', %d)", $cid, $data, $created, $expire, $headers, $serialized); + @db_query("INSERT INTO {". $table ."} (cid, data, created, expire, headers, serialized) VALUES ('%s', %b, %d, %d, '%s', %d)", $cid, NULL, $created, $expire, $headers, $serialized); } + db_update_blob('{' . $table . '}', array('data' => $data), "cid = '%s'", $cid); } /** diff -urpN drupal-6.x-dev-200707090006/includes/database.inc drupal-6.x-dev-clob-0.3/includes/database.inc --- drupal-6.x-dev-200707090006/includes/database.inc 2007-07-02 22:41:35.000000000 +0800 +++ drupal-6.x-dev-clob-0.3/includes/database.inc 2007-07-09 11:40:12.000000000 +0800 @@ -158,6 +158,9 @@ function db_set_active($name = 'default' /** * Helper function for db_query(). + * + * NOTE: %b and %c should input NULL as placeholder, and further more + * manually update its value by using db_update_blob() or db_update_clob(). */ function _db_query_callback($match, $init = FALSE) { static $args = NULL; @@ -175,15 +178,17 @@ function _db_query_callback($match, $ini return '%'; case '%f': return (float) array_shift($args); - case '%b': // binary data - return db_encode_blob(array_shift($args)); + case '%b': // binary large object. NULL input as placeholder. + return db_encode_blob(array_shift($args)); + case '%c': // character large object. NULL input as placeholder. + return db_escape_string(array_shift($args)); } } /** * Indicates the place holders that should be replaced in _db_query_callback(). */ -define('DB_QUERY_REGEXP', '/(%d|%s|%%|%f|%b)/'); +define('DB_QUERY_REGEXP', '/(%d|%s|%%|%f|%b|%c)/'); /** * Helper function for db_rewrite_sql. diff -urpN drupal-6.x-dev-200707090006/includes/database.mysql-common.inc drupal-6.x-dev-clob-0.3/includes/database.mysql-common.inc --- drupal-6.x-dev-200707090006/includes/database.mysql-common.inc 2007-06-27 04:24:19.000000000 +0800 +++ drupal-6.x-dev-clob-0.3/includes/database.mysql-common.inc 2007-07-09 11:48:17.000000000 +0800 @@ -27,7 +27,7 @@ * you may also pass a single array containing the query arguments. * * Valid %-modifiers are: %s, %d, %f, %b (binary data, do not enclose - * in '') and %%. + * in ''), %c (character large object) and %%. * * NOTE: using this syntax will cast NULL and FALSE values to decimal 0, * and TRUE values to decimal 1. @@ -217,6 +217,9 @@ function db_type_map() { 'blob:big' => 'LONGBLOB', 'blob:normal' => 'BLOB', + 'clob:big' => 'LONGTEXT', + 'clob:normal' => 'TEXT', + 'datetime:normal' => 'DATETIME', ); return $map; @@ -462,7 +465,95 @@ function db_last_insert_id($table, $fiel } /** + * Helper function for update Binary Large Object value. + * + * @param $table + * Table to update. + * @param $values + * Values to update, in array format. Columns and values pairs. + * @param $where + * Update condition. + * @param ... + * A variable number of arguments which are substituted into the query + * WHERE condition, using printf() syntax. Instead of a variable number + * of query arguments, you may also pass a single array containing the + * query arguments. + * + * Valid %-modifiers are: %s, %d, %f, %b (binary data, do not enclose + * in ''), %c (character large object) and %%. + * + * NOTE: %b and %c should input NULL as placeholder, and further more + * manually update its value by using db_update_blob() or db_update_clob(). + * + * NOTE: using this syntax will cast NULL and FALSE values to decimal 0, + * and TRUE values to decimal 1. + * + * @return + * _db_query() return value. + */ +function db_update_blob($table, $values, $where, $args) { + $args = is_array($args) ? $args : array($args); + if (isset($args[0]) and is_array($args[0])) { // 'All arguments in one array' syntax + $args = $args[0]; + } + _db_query_callback($args, TRUE); + $where = preg_replace_callback(DB_QUERY_REGEXP, '_db_query_callback', $where); + + $arr = array(); + foreach ($values as $key => $value) { + $arr[] = $key . " = " . db_encode_blob($value); + } + + $query = 'UPDATE ' . db_prefix_tables($table) . ' SET ' . implode(', ', $arr) . ' WHERE ' . $where; + return _db_query($query); +} + +/** + * Helper function for update Character Large Object value. + * + * @param $table + * Table to update. + * @param $values + * Values to update, in array format. Columns and values pairs. + * @param $where + * Update condition. + * @param ... + * A variable number of arguments which are substituted into the query + * WHERE condition, using printf() syntax. Instead of a variable number + * of query arguments, you may also pass a single array containing the + * query arguments. + * + * Valid %-modifiers are: %s, %d, %f, %b (binary data, do not enclose + * in ''), %c (character large object) and %%. + * + * NOTE: %b and %c should input NULL as placeholder, and further more + * manually update its value by using db_update_blob() or db_update_clob(). + * + * NOTE: using this syntax will cast NULL and FALSE values to decimal 0, + * and TRUE values to decimal 1. + * + * @return + * _db_query() return value. + */ +function db_update_clob($table, $values, $where, $args) { + $args = is_array($args) ? $args : array($args); + if (isset($args[0]) and is_array($args[0])) { // 'All arguments in one array' syntax + $args = $args[0]; + } + _db_query_callback($args, TRUE); + $where = preg_replace_callback(DB_QUERY_REGEXP, '_db_query_callback', $where); + + $arr = array(); + foreach ($values as $key => $value) { + $arr[] = $key . " = '" . db_escape_string($value) . "'"; + } + + $query = 'UPDATE ' . db_prefix_tables($table) . ' SET ' . implode(', ', $arr) . ' WHERE ' . $where; + return _db_query($query); +} + +/** * @} End of "ingroup schemaapi". */ -?> \ No newline at end of file +?> diff -urpN drupal-6.x-dev-200707090006/includes/database.mysqli.inc drupal-6.x-dev-clob-0.3/includes/database.mysqli.inc --- drupal-6.x-dev-200707090006/includes/database.mysqli.inc 2007-06-05 20:13:20.000000000 +0800 +++ drupal-6.x-dev-clob-0.3/includes/database.mysqli.inc 2007-07-09 11:47:21.000000000 +0800 @@ -253,7 +253,10 @@ function db_affected_rows() { * using printf() syntax. The query arguments can be enclosed in one * array instead. * Valid %-modifiers are: %s, %d, %f, %b (binary data, do not enclose - * in '') and %%. + * in ''), %c (character large object) and %%. + * + * NOTE: %b and %c should input NULL as placeholder, and further more + * manually update its value by using db_update_blob() or db_update_clob(). * * NOTE: using this syntax will cast NULL and FALSE values to decimal 0, * and TRUE values to decimal 1. @@ -303,7 +306,10 @@ function db_query_range($query) { * using printf() syntax. The query arguments can be enclosed in one * array instead. * Valid %-modifiers are: %s, %d, %f, %b (binary data, do not enclose - * in '') and %%. + * in ''), %c (character large object) and %%. + * + * NOTE: %b and %c should input NULL as placeholder, and further more + * manually update its value by using db_update_blob() or db_update_clob(). * * NOTE: using this syntax will cast NULL and FALSE values to decimal 0, * and TRUE values to decimal 1. diff -urpN drupal-6.x-dev-200707090006/includes/database.mysql.inc drupal-6.x-dev-clob-0.3/includes/database.mysql.inc --- drupal-6.x-dev-200707090006/includes/database.mysql.inc 2007-06-05 20:13:20.000000000 +0800 +++ drupal-6.x-dev-clob-0.3/includes/database.mysql.inc 2007-07-09 11:47:55.000000000 +0800 @@ -255,7 +255,10 @@ function db_affected_rows() { * using printf() syntax. The query arguments can be enclosed in one * array instead. * Valid %-modifiers are: %s, %d, %f, %b (binary data, do not enclose - * in '') and %%. + * in ''), %c (character large object) and %%. + * + * NOTE: %b and %c should input NULL as placeholder, and further more + * manually update its value by using db_update_blob() or db_update_clob(). * * NOTE: using this syntax will cast NULL and FALSE values to decimal 0, * and TRUE values to decimal 1. @@ -305,7 +308,10 @@ function db_query_range($query) { * using printf() syntax. The query arguments can be enclosed in one * array instead. * Valid %-modifiers are: %s, %d, %f, %b (binary data, do not enclose - * in '') and %%. + * in ''), %c (character large object) and %%. + * + * NOTE: %b and %c should input NULL as placeholder, and further more + * manually update its value by using db_update_blob() or db_update_clob(). * * NOTE: using this syntax will cast NULL and FALSE values to decimal 0, * and TRUE values to decimal 1. diff -urpN drupal-6.x-dev-200707090006/includes/database.pgsql.inc drupal-6.x-dev-clob-0.3/includes/database.pgsql.inc --- drupal-6.x-dev-200707090006/includes/database.pgsql.inc 2007-07-05 16:48:57.000000000 +0800 +++ drupal-6.x-dev-clob-0.3/includes/database.pgsql.inc 2007-07-09 11:47:01.000000000 +0800 @@ -120,7 +120,10 @@ function db_connect($url) { * you may also pass a single array containing the query arguments. * * Valid %-modifiers are: %s, %d, %f, %b (binary data, do not enclose - * in '') and %%. + * in ''), %c (character large object) and %%. + * + * NOTE: %b and %c should input NULL as placeholder, and further more + * manually update its value by using db_update_blob() or db_update_clob(). * * NOTE: using this syntax will cast NULL and FALSE values to decimal 0, * and TRUE values to decimal 1. @@ -287,7 +290,10 @@ function db_affected_rows() { * using printf() syntax. Instead of a variable number of query arguments, * you may also pass a single array containing the query arguments. * Valid %-modifiers are: %s, %d, %f, %b (binary data, do not enclose - * in '') and %%. + * in ''), %c (character large object) and %%. + * + * NOTE: %b and %c should input NULL as placeholder, and further more + * manually update its value by using db_update_blob() or db_update_clob(). * * NOTE: using this syntax will cast NULL and FALSE values to decimal 0, * and TRUE values to decimal 1. @@ -337,7 +343,10 @@ function db_query_range($query) { * using printf() syntax. The query arguments can be enclosed in one * array instead. * Valid %-modifiers are: %s, %d, %f, %b (binary data, do not enclose - * in '') and %%. + * in ''), %c (character large object) and %%. + * + * NOTE: %b and %c should input NULL as placeholder, and further more + * manually update its value by using db_update_blob() or db_update_clob(). * * NOTE: using this syntax will cast NULL and FALSE values to decimal 0, * and TRUE values to decimal 1. @@ -398,6 +407,96 @@ function db_escape_string($text) { } /** + * Helper function for update Binary Large Object value. + * + * @param $table + * Table to update. + * @param $values + * Values to update, in array format. Columns and values pairs. + * @param $where + * Update condition. + * @param ... + * A variable number of arguments which are substituted into the query + * WHERE condition, using printf() syntax. Instead of a variable number + * of query arguments, you may also pass a single array containing the + * query arguments. + * + * Valid %-modifiers are: %s, %d, %f, %b (binary data, do not enclose + * in ''), %c (character large object) and %%. + * + * NOTE: %b and %c should input NULL as placeholder, and further more + * manually update its value by using db_update_blob() or db_update_clob(). + * + * NOTE: using this syntax will cast NULL and FALSE values to decimal 0, + * and TRUE values to decimal 1. + * + * @return + * _db_query() return value. + */ +function db_update_blob($table, $values, $where) { + $args = func_get_args(); + array_shift($args); + if (isset($args[0]) and is_array($args[0])) { // 'All arguments in one array' syntax + $args = $args[0]; + } + _db_query_callback($args, TRUE); + $where = preg_replace_callback(DB_QUERY_REGEXP, '_db_query_callback', $where); + + $arr = array(); + foreach ($values as $key => $value) { + $arr[] = $key . " = " . db_encode_blob($value); + } + + $query = 'UPDATE ' . db_prefix_tables($table) . ' SET ' . implode(', ', $arr) . ' WHERE ' . $where; + return _db_query($query); +} + +/** + * Helper function for update Character Large Object value. + * + * @param $table + * Table to update. + * @param $values + * Values to update, in array format. Columns and values pairs. + * @param $where + * Update condition. + * @param ... + * A variable number of arguments which are substituted into the query + * WHERE condition, using printf() syntax. Instead of a variable number + * of query arguments, you may also pass a single array containing the + * query arguments. + * + * Valid %-modifiers are: %s, %d, %f, %b (binary data, do not enclose + * in ''), %c (character large object) and %%. + * + * NOTE: %b and %c should input NULL as placeholder, and further more + * manually update its value by using db_update_blob() or db_update_clob(). + * + * NOTE: using this syntax will cast NULL and FALSE values to decimal 0, + * and TRUE values to decimal 1. + * + * @return + * _db_query() return value. + */ +function db_update_clob($table, $values, $where) { + $args = func_get_args(); + array_shift($args); + if (isset($args[0]) and is_array($args[0])) { // 'All arguments in one array' syntax + $args = $args[0]; + } + _db_query_callback($args, TRUE); + $where = preg_replace_callback(DB_QUERY_REGEXP, '_db_query_callback', $where); + + $arr = array(); + foreach ($values as $key => $value) { + $arr[] = $key . " = '" . db_escape_string($value) . "'"; + } + + $query = 'UPDATE ' . db_prefix_tables($table) . ' SET ' . implode(', ', $arr) . ' WHERE ' . $where; + return _db_query($query); +} + +/** * Lock a table. * This function automatically starts a transaction. */ @@ -501,6 +600,9 @@ function db_type_map() { 'blob:big' => 'bytea', 'blob:normal' => 'bytea', + 'clob:big' => 'text', + 'clob:normal' => 'text', + 'datetime:normal' => 'timestamp', 'serial:tiny' => 'serial', diff -urpN drupal-6.x-dev-200707090006/modules/aggregator/aggregator.module drupal-6.x-dev-clob-0.3/modules/aggregator/aggregator.module --- drupal-6.x-dev-200707090006/modules/aggregator/aggregator.module 2007-07-05 17:07:03.000000000 +0800 +++ drupal-6.x-dev-clob-0.3/modules/aggregator/aggregator.module 2007-07-09 10:59:32.000000000 +0800 @@ -977,15 +977,17 @@ 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_query("UPDATE {aggregator_item} SET title = '%s', link = '%s', author = '%s', description = '%c', guid = '%s', timestamp = %d WHERE iid = %d", $edit['title'], $edit['link'], $edit['author'], NULL, $edit['guid'], $edit['timestamp'], $edit['iid']); + db_update_clob('{aggregator_item}', array('description' => $edit['description']), 'iid = %d', $edit['iid']); } else if ($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']); } else if ($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']); + db_query("INSERT INTO {aggregator_item} (fid, title, link, author, description, timestamp, guid) VALUES (%d, '%s', '%s', '%s', '%c', %d, '%s')", $edit['fid'], $edit['title'], $edit['link'], $edit['author'], NULL, $edit['timestamp'], $edit['guid']); $edit['iid'] = db_last_insert_id('aggregator_item', 'iid'); + db_update_clob('{aggregator_item}', array('description' => $edit['description']), 'iid = %d', $edit['iid']); // 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)) { diff -urpN drupal-6.x-dev-200707090006/modules/aggregator/aggregator.schema drupal-6.x-dev-clob-0.3/modules/aggregator/aggregator.schema --- drupal-6.x-dev-200707090006/modules/aggregator/aggregator.schema 2007-06-15 15:15:24.000000000 +0800 +++ drupal-6.x-dev-clob-0.3/modules/aggregator/aggregator.schema 2007-07-09 12:25:48.000000000 +0800 @@ -38,7 +38,7 @@ function aggregator_schema() { 'checked' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), 'link' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), 'description' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'), - 'image' => array('type' => 'text', 'not null' => TRUE, 'size' => 'medium'), + 'image' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'), 'etag' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), 'modified' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), 'block' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny') @@ -57,7 +57,7 @@ function aggregator_schema() { 'title' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), 'link' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), 'author' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'description' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'), + 'description' => array('type' => 'clob', 'not null' => TRUE, 'size' => 'big'), 'timestamp' => array('type' => 'int', 'not null' => FALSE), 'guid' => array('type' => 'varchar', 'length' => 255, 'not null' => FALSE) ), diff -urpN drupal-6.x-dev-200707090006/modules/block/block.module drupal-6.x-dev-clob-0.3/modules/block/block.module --- drupal-6.x-dev-200707090006/modules/block/block.module 2007-07-02 05:39:07.000000000 +0800 +++ drupal-6.x-dev-clob-0.3/modules/block/block.module 2007-07-09 11:02:03.000000000 +0800 @@ -538,8 +538,9 @@ function block_add_block_form_validate($ * Save the new custom block. */ function block_add_block_form_submit($form, &$form_state) { - db_query("INSERT INTO {boxes} (body, info, format) VALUES ('%s', '%s', %d)", $form_state['values']['body'], $form_state['values']['info'], $form_state['values']['format']); + db_query("INSERT INTO {boxes} (body, info, format) VALUES ('%c', '%s', %d)", NULL, $form_state['values']['info'], $form_state['values']['format']); $delta = db_last_insert_id('boxes', 'bid'); + db_update_clob('{boxes}', array('body' => $form_state['values']['body']), 'bid = %d', $delta); foreach (list_themes() as $key => $theme) { if ($theme->status) { @@ -620,7 +621,8 @@ function block_box_save($edit, $delta) { $edit['format'] = FILTER_FORMAT_DEFAULT; } - db_query("UPDATE {boxes} SET body = '%s', info = '%s', format = %d WHERE bid = %d", $edit['body'], $edit['info'], $edit['format'], $delta); + db_query("UPDATE {boxes} SET body = '%c', info = '%s', format = %d WHERE bid = %d", NULL, $edit['info'], $edit['format'], $delta); + db_update_clob('{boxes}', array('body' => $edit['body']), 'bid = %d', $delta); return TRUE; } diff -urpN drupal-6.x-dev-200707090006/modules/block/block.schema drupal-6.x-dev-clob-0.3/modules/block/block.schema --- drupal-6.x-dev-200707090006/modules/block/block.schema 2007-05-25 20:46:43.000000000 +0800 +++ drupal-6.x-dev-clob-0.3/modules/block/block.schema 2007-07-09 02:54:02.000000000 +0800 @@ -36,7 +36,7 @@ function block_schema() { $schema['boxes'] = array( 'fields' => array( 'bid' => array('type' => 'serial', 'not null' => TRUE), - 'body' => array('type' => 'text', 'not null' => FALSE, 'size' => 'big'), + 'body' => array('type' => 'clob', 'not null' => FALSE, 'size' => 'big'), 'info' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''), 'format' => array('type' => 'int', 'size' => 'small', 'not null' => TRUE, 'default' => 0) ), diff -urpN drupal-6.x-dev-200707090006/modules/comment/comment.module drupal-6.x-dev-clob-0.3/modules/comment/comment.module --- drupal-6.x-dev-200707090006/modules/comment/comment.module 2007-07-05 16:48:57.000000000 +0800 +++ drupal-6.x-dev-clob-0.3/modules/comment/comment.module 2007-07-09 11:03:08.000000000 +0800 @@ -741,7 +741,8 @@ function comment_save($edit) { if (!form_get_errors()) { 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_query("UPDATE {comments} SET status = %d, timestamp = %d, subject = '%s', comment = '%c', format = %d, uid = %d, name = '%s', mail = '%s', homepage = '%s' WHERE cid = %d", $edit['status'], $edit['timestamp'], $edit['subject'], NULL, $edit['format'], $edit['uid'], $edit['name'], $edit['mail'], $edit['homepage'], $edit['cid']); + db_update_clob('{comments}', array('comment' => $edit['comment']), 'cid = %d', $edit['cid']); _comment_update_node_statistics($edit['nid']); @@ -814,8 +815,9 @@ function comment_save($edit) { } $edit += array('mail' => '', 'homepage' => ''); - db_query("INSERT INTO {comments} (nid, pid, uid, subject, comment, format, hostname, timestamp, status, score, users, thread, name, mail, homepage) VALUES (%d, %d, %d, '%s', '%s', %d, '%s', %d, %d, %d, '%s', '%s', '%s', '%s', '%s')", $edit['nid'], $edit['pid'], $edit['uid'], $edit['subject'], $edit['comment'], $edit['format'], ip_address(), $edit['timestamp'], $status, $score, $users, $thread, $edit['name'], $edit['mail'], $edit['homepage']); + db_query("INSERT INTO {comments} (nid, pid, uid, subject, comment, format, hostname, timestamp, status, score, users, thread, name, mail, homepage) VALUES (%d, %d, %d, '%s', '%c', %d, '%s', %d, %d, %d, '%s', '%s', '%s', '%s', '%s')", $edit['nid'], $edit['pid'], $edit['uid'], $edit['subject'], NULL, $edit['format'], ip_address(), $edit['timestamp'], $status, $score, $users, $thread, $edit['name'], $edit['mail'], $edit['homepage']); $edit['cid'] = db_last_insert_id('comments', 'cid'); + db_update_clob('{comments}', array('comment' => $edit['comment']), 'cid = %d', $edit['cid']); _comment_update_node_statistics($edit['nid']); diff -urpN drupal-6.x-dev-200707090006/modules/comment/comment.schema drupal-6.x-dev-clob-0.3/modules/comment/comment.schema --- drupal-6.x-dev-200707090006/modules/comment/comment.schema 2007-06-15 15:15:24.000000000 +0800 +++ drupal-6.x-dev-clob-0.3/modules/comment/comment.schema 2007-07-09 12:31:11.000000000 +0800 @@ -9,14 +9,14 @@ function comment_schema() { 'nid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), 'uid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), 'subject' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => ''), - 'comment' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'), + 'comment' => array('type' => 'clob', 'not null' => TRUE, 'size' => 'big'), 'hostname' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''), 'timestamp' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), 'score' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'medium'), 'status' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'), 'format' => array('type' => 'int', 'size' => 'small', 'not null' => TRUE, 'default' => 0), 'thread' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE), - 'users' => array('type' => 'text', 'not null' => FALSE, 'size' => 'medium'), + 'users' => array('type' => 'text', 'not null' => FALSE, 'size' => 'big'), 'name' => array('type' => 'varchar', 'length' => 60, 'not null' => FALSE), 'mail' => array('type' => 'varchar', 'length' => 64, 'not null' => FALSE), 'homepage' => array('type' => 'varchar', 'length' => 255, 'not null' => FALSE) diff -urpN drupal-6.x-dev-200707090006/modules/contact/contact.module drupal-6.x-dev-clob-0.3/modules/contact/contact.module --- drupal-6.x-dev-200707090006/modules/contact/contact.module 2007-07-04 03:53:01.000000000 +0800 +++ drupal-6.x-dev-clob-0.3/modules/contact/contact.module 2007-07-09 11:06:24.000000000 +0800 @@ -241,13 +241,16 @@ function contact_admin_edit_submit($form } $form_state['values']['recipients'] = implode(',', $recipients); if (arg(3) == 'add') { - db_query("INSERT INTO {contact} (category, recipients, reply, weight, selected) VALUES ('%s', '%s', '%s', %d, %d)", $form_state['values']['category'], $form_state['values']['recipients'], $form_state['values']['reply'], $form_state['values']['weight'], $form_state['values']['selected']); + db_query("INSERT INTO {contact} (category, recipients, reply, weight, selected) VALUES ('%s', '%s', '%c', %d, %d)", $form_state['values']['category'], $form_state['values']['recipients'], NULL, $form_state['values']['weight'], $form_state['values']['selected']); + $cid = db_last_insert_id('contact', 'cid'); + db_update_clob('{contact}', array('reply' => $form_state['values']['reply']), 'cid = %d', $cid); drupal_set_message(t('Category %category has been added.', array('%category' => $form_state['values']['category']))); watchdog('mail', 'Contact form: category %category added.', array('%category' => $form_state['values']['category']), WATCHDOG_NOTICE, l(t('view'), 'admin/build/contact')); } else { - db_query("UPDATE {contact} SET category = '%s', recipients = '%s', reply = '%s', weight = %d, selected = %d WHERE cid = %d", $form_state['values']['category'], $form_state['values']['recipients'], $form_state['values']['reply'], $form_state['values']['weight'], $form_state['values']['selected'], $form_state['values']['cid']); + db_query("UPDATE {contact} SET category = '%s', recipients = '%s', reply = '%c', weight = %d, selected = %d WHERE cid = %d", $form_state['values']['category'], $form_state['values']['recipients'], NULL, $form_state['values']['weight'], $form_state['values']['selected'], $form_state['values']['cid']); + db_update_clob('{contact}', array('reply' => $form_state['values']['reply']), 'cid = %d', $form_state['values']['cid']); drupal_set_message(t('Category %category has been updated.', array('%category' => $form_state['values']['category']))); watchdog('mail', 'Contact form: category %category updated.', array('%category' => $form_state['values']['category']), WATCHDOG_NOTICE, l(t('view'), 'admin/build/contact')); } diff -urpN drupal-6.x-dev-200707090006/modules/contact/contact.schema drupal-6.x-dev-clob-0.3/modules/contact/contact.schema --- drupal-6.x-dev-200707090006/modules/contact/contact.schema 2007-06-15 15:15:24.000000000 +0800 +++ drupal-6.x-dev-clob-0.3/modules/contact/contact.schema 2007-07-09 12:31:58.000000000 +0800 @@ -6,8 +6,8 @@ function contact_schema() { 'fields' => array( 'cid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), 'category' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'recipients' => array('type' => 'text', 'not null' => TRUE, 'size' => 'medium'), - 'reply' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'), + 'recipients' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'), + 'reply' => array('type' => 'clob', 'not null' => TRUE, 'size' => 'big'), 'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny'), 'selected' => array('type' => 'int', 'not null' => TRUE, 'default' => 0, 'size' => 'tiny') ), diff -urpN drupal-6.x-dev-200707090006/modules/node/node.module drupal-6.x-dev-clob-0.3/modules/node/node.module --- drupal-6.x-dev-200707090006/modules/node/node.module 2007-07-05 16:48:57.000000000 +0800 +++ drupal-6.x-dev-clob-0.3/modules/node/node.module 2007-07-09 12:56:44.000000000 +0800 @@ -679,13 +679,14 @@ function node_save(&$node) { // Split off revisions data to another structure $revisions_table_values = array('nid' => &$node->nid, - 'title' => $node->title, 'body' => $node->body, - 'teaser' => $node->teaser, 'timestamp' => $node->changed, + 'title' => $node->title, 'body' => NULL, + 'teaser' => NULL, 'timestamp' => $node->changed, 'uid' => $user->uid, 'format' => $node->format); $revisions_table_types = array('nid' => '%d', - 'title' => "'%s'", 'body' => "'%s'", - 'teaser' => "'%s'", 'timestamp' => '%d', + 'title' => "'%s'", 'body' => "'%c'", + 'teaser' => "'%c'", 'timestamp' => '%d', 'uid' => '%d', 'format' => '%d'); + $revisions_table_clobs = array('body' => $node->body, 'teaser' => $node->teaser); if (!empty($node->log) || $node->is_new || (isset($node->revision) && $node->revision)) { // Only store the log message if there's something to store; this prevents // existing log messages from being unintentionally overwritten by a blank @@ -713,6 +714,7 @@ function node_save(&$node) { $revisions_query = 'INSERT INTO {node_revisions} ('. implode(', ', array_keys($revisions_table_types)) .') VALUES ('. implode(', ', $revisions_table_types) .')'; db_query($revisions_query, $revisions_table_values); $node->vid = db_last_insert_id('node_revisions', 'vid'); + db_update_clob('{node_revisions}', $revisions_table_clobs, 'vid = %d', $node->vid); $op = 'insert'; } else { @@ -727,6 +729,7 @@ function node_save(&$node) { $revisions_query = 'INSERT INTO {node_revisions} ('. implode(', ', array_keys($revisions_table_types)) .') VALUES ('. implode(', ', $revisions_table_types) .')'; db_query($revisions_query, $revisions_table_values); $node->vid = db_last_insert_id('node_revisions', 'vid'); + db_update_clob('{node_revisions}', $revisions_table_clobs, 'vid = %d', $node->vid); } else { $arr = array(); @@ -736,6 +739,7 @@ function node_save(&$node) { $revisions_table_values[] = $node->vid; $revisions_query = 'UPDATE {node_revisions} SET '. implode(', ', $arr) .' WHERE vid = %d'; db_query($revisions_query, $revisions_table_values); + db_update_clob('{node_revisions}', $revisions_table_clobs, 'vid = %d', $node->vid); $update_node = FALSE; } $op = 'update'; diff -urpN drupal-6.x-dev-200707090006/modules/node/node.schema drupal-6.x-dev-clob-0.3/modules/node/node.schema --- drupal-6.x-dev-200707090006/modules/node/node.schema 2007-07-04 03:42:14.000000000 +0800 +++ drupal-6.x-dev-clob-0.3/modules/node/node.schema 2007-07-09 12:56:02.000000000 +0800 @@ -73,8 +73,8 @@ function node_schema() { 'vid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), 'uid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), 'title' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), - 'body' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'), - 'teaser' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'), + 'body' => array('type' => 'clob', 'not null' => TRUE, 'size' => 'big'), + 'teaser' => array('type' => 'clob', 'not null' => TRUE, 'size' => 'big'), 'log' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'), 'timestamp' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), 'format' => array('type' => 'int', 'not null' => TRUE, 'default' => 0) diff -urpN drupal-6.x-dev-200707090006/modules/search/search.schema drupal-6.x-dev-clob-0.3/modules/search/search.schema --- drupal-6.x-dev-200707090006/modules/search/search.schema 2007-06-15 15:15:24.000000000 +0800 +++ drupal-6.x-dev-clob-0.3/modules/search/search.schema 2007-07-09 12:32:27.000000000 +0800 @@ -6,7 +6,7 @@ function search_schema() { 'fields' => array( 'sid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), 'type' => array('type' => 'varchar', 'length' => 16, 'not null' => FALSE), - 'data' => array('type' => 'text', 'not null' => TRUE, 'size' => 'medium') + 'data' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big') ), 'indexes' => array('sid_type' => array('sid', 'type')), ); diff -urpN drupal-6.x-dev-200707090006/modules/system/system.schema drupal-6.x-dev-clob-0.3/modules/system/system.schema --- drupal-6.x-dev-200707090006/modules/system/system.schema 2007-07-04 23:49:44.000000000 +0800 +++ drupal-6.x-dev-clob-0.3/modules/system/system.schema 2007-07-09 12:33:08.000000000 +0800 @@ -7,7 +7,7 @@ function system_schema() { 'bid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), 'token' => array('type' => 'varchar', 'length' => 64, 'not null' => TRUE), 'timestamp' => array('type' => 'int', 'not null' => TRUE), - 'batch' => array('type' => 'text', 'not null' => FALSE, 'size' => 'medium') + 'batch' => array('type' => 'text', 'not null' => FALSE, 'size' => 'big') ), 'primary key' => array('bid'), 'indexes' => array('token' => array('token')), @@ -146,7 +146,7 @@ function system_schema() { 'hostname' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''), 'timestamp' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), 'cache' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - 'session' => array('type' => 'text', 'not null' => FALSE, 'size' => 'medium') + 'session' => array('type' => 'text', 'not null' => FALSE, 'size' => 'big') ), 'primary key' => array('sid'), 'indexes' => array( @@ -187,7 +187,7 @@ function system_schema() { $schema['variable'] = array( 'fields' => array( 'name' => array('type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => ''), - 'value' => array('type' => 'text', 'not null' => TRUE, 'size' => 'medium'), + 'value' => array('type' => 'text', 'not null' => TRUE, 'size' => 'big'), ), 'primary key' => array('name'), ); diff -urpN drupal-6.x-dev-200707090006/modules/user/user.schema drupal-6.x-dev-clob-0.3/modules/user/user.schema --- drupal-6.x-dev-200707090006/modules/user/user.schema 2007-06-15 15:15:25.000000000 +0800 +++ drupal-6.x-dev-clob-0.3/modules/user/user.schema 2007-07-09 12:33:55.000000000 +0800 @@ -27,7 +27,7 @@ function user_schema() { 'fields' => array( 'pid' => array('type' => 'serial', 'not null' => TRUE), 'rid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0), - 'perm' => array('type' => 'text', 'not null' => FALSE, 'size' => 'medium'), + 'perm' => array('type' => 'text', 'not null' => FALSE, 'size' => 'big'), 'tid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0) ), 'primary key' => array('pid'), @@ -62,7 +62,7 @@ function user_schema() { 'language' => array('type' => 'varchar', 'length' => 12, 'not null' => TRUE, 'default' => ''), 'picture' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), 'init' => array('type' => 'varchar', 'length' => 64, 'not null' => FALSE, 'default' => ''), - 'data' => array('type' => 'text', 'not null' => FALSE, 'size' => 'medium') + 'data' => array('type' => 'text', 'not null' => FALSE, 'size' => 'big') ), 'indexes' => array( 'access' => array('access'),