? profiles/simpletest ? 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.6 diff -u -p -r1.6 schema.inc --- includes/database/mysql/schema.inc 13 Nov 2008 20:52:13 -0000 1.6 +++ includes/database/mysql/schema.inc 27 Nov 2008 04:30:23 -0000 @@ -135,6 +135,10 @@ class DatabaseSchema_mysql extends Datab return $field; } + /** + * This maps a generic data type in combination with its data size + * to the engine-specific data type. + */ public function getFieldTypeMap() { // Put :normal last so it gets preserved by array_flip. This makes // it much easier for modules (such as schema.module) to map @@ -143,6 +147,14 @@ class DatabaseSchema_mysql extends Datab 'varchar:normal' => 'VARCHAR', 'char:normal' => 'CHAR', + // Based on maximum cross database compatibility concern, some rules + // for using Drupal text type: + // - Always assume text:big storage capacity as maximum 4000 characters + // only. + // - Text type should function with the following SQL command: + // "ORDER BY", "GROUP BY", "SELECT ... DISTINCT" and + // "SELECT ... UNIQUE". + // - For storage capacity greater than 4000, use blob instead. 'text:tiny' => 'TINYTEXT', 'text:small' => 'TINYTEXT', 'text:medium' => 'MEDIUMTEXT', @@ -169,6 +181,14 @@ class DatabaseSchema_mysql extends Datab 'numeric:normal' => 'DECIMAL', + // Based on maximum cross database compatibility concern, some rules + // for using Drupal blob type: + // - Usually support GB-scale storage capacity. + // - Blob type should NOT function with the following SQL command: + // "ORDER BY", "GROUP BY", "SELECT ... DISTINCT" and + // "SELECT ... UNIQUE". + // - Always utilize drupal_write_record(), db_insert(), db_update(), + // db_merge() and db_delete() for blob operation. 'blob:big' => 'LONGBLOB', 'blob:normal' => 'BLOB', Index: includes/database/pgsql/schema.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/database/pgsql/schema.inc,v retrieving revision 1.3 diff -u -p -r1.3 schema.inc --- includes/database/pgsql/schema.inc 26 Nov 2008 13:42:25 -0000 1.3 +++ includes/database/pgsql/schema.inc 27 Nov 2008 04:30:23 -0000 @@ -131,50 +131,65 @@ class DatabaseSchema_pgsql extends Datab return $field; } - /** * This maps a generic data type in combination with its data size * to the engine-specific data type. */ - function getFieldTypeMap() { + public function getFieldTypeMap() { // Put :normal last so it gets preserved by array_flip. This makes // it much easier for modules (such as schema.module) to map // database types back into schema types. - $map = array( - 'varchar:normal' => 'varchar', - 'char:normal' => 'character', - - 'text:tiny' => 'text', - 'text:small' => 'text', - 'text:medium' => 'text', - 'text:big' => 'text', - 'text:normal' => 'text', - - 'int:tiny' => 'smallint', - 'int:small' => 'smallint', - 'int:medium' => 'int', - 'int:big' => 'bigint', - 'int:normal' => 'int', - - 'float:tiny' => 'real', - 'float:small' => 'real', - 'float:medium' => 'real', - 'float:big' => 'double precision', - 'float:normal' => 'real', - - 'numeric:normal' => 'numeric', - - 'blob:big' => 'bytea', - 'blob:normal' => 'bytea', - - 'datetime:normal' => 'timestamp', - - 'serial:tiny' => 'serial', - 'serial:small' => 'serial', - 'serial:medium' => 'serial', - 'serial:big' => 'bigserial', - 'serial:normal' => 'serial', - ); + static $map = array( + 'varchar:normal' => 'VARCHAR', + 'char:normal' => 'CHARACTER', + + // Based on maximum cross database compatibility concern, some rules + // for using Drupal text type: + // - Always assume text:big storage capacity as maximum 4000 characters + // only. + // - Text type should function with the following SQL command: + // "ORDER BY", "GROUP BY", "SELECT ... DISTINCT" and + // "SELECT ... UNIQUE". + // - For storage capacity greater than 4000, use blob instead. + 'text:tiny' => 'TEXT', + 'text:small' => 'TEXT', + 'text:medium' => 'TEXT', + 'text:big' => 'TEXT', + 'text:normal' => 'TEXT', + + 'serial:tiny' => 'SERIAL', + 'serial:small' => 'SERIAL', + 'serial:medium' => 'SERIAL', + 'serial:big' => 'BIGSERIAL', + 'serial:normal' => 'SERIAL', + + 'int:tiny' => 'SMALLINT', + 'int:small' => 'SMALLINT', + 'int:medium' => 'INT', + 'int:big' => 'BIGINT', + 'int:normal' => 'INT', + + 'float:tiny' => 'REAL', + 'float:small' => 'REAL', + 'float:medium' => 'REAL', + 'float:big' => 'DOUBLE PRECISION', + 'float:normal' => 'REAL', + + 'numeric:normal' => 'NUMERIC', + + // Based on maximum cross database compatibility concern, some rules + // for using Drupal blob type: + // - Usually support GB-scale storage capacity. + // - Blob type should NOT function with the following SQL command: + // "ORDER BY", "GROUP BY", "SELECT ... DISTINCT" and + // "SELECT ... UNIQUE". + // - Always utilize drupal_write_record(), db_insert(), db_update(), + // db_merge() and db_delete() for blob operation. + 'blob:big' => 'BYTEA', + 'blob:normal' => 'BYTEA', + + 'datetime:normal' => 'TIMESTAMP', + ); return $map; } Index: modules/aggregator/aggregator.install =================================================================== RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.install,v retrieving revision 1.19 diff -u -p -r1.19 aggregator.install --- modules/aggregator/aggregator.install 15 Nov 2008 13:01:04 -0000 1.19 +++ modules/aggregator/aggregator.install 27 Nov 2008 04:30:23 -0000 @@ -229,8 +229,8 @@ function aggregator_schema() { 'description' => 'Author of the feed item.', ), 'description' => array( - 'type' => 'text', - 'not null' => TRUE, + 'type' => 'blob', + 'not null' => FALSE, 'size' => 'big', 'description' => 'Body of the feed item.', ), @@ -256,6 +256,11 @@ function aggregator_schema() { } /** + * @defgroup updates-6.x-to-7.x Aggregator updates from 6.x to 7.x + * @{ + */ + +/** * Add hash column to aggregator_feed table. */ function aggregator_update_7000() { @@ -263,3 +268,17 @@ 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' => FALSE, 'size' => 'big')); + return $ret; +} + +/** + * @} End of "defgroup updates-6.x-to-7.x" + * The next series of updates should start at 8000. + */ Index: modules/comment/comment.install =================================================================== RCS file: /cvs/drupal/drupal/modules/comment/comment.install,v retrieving revision 1.27 diff -u -p -r1.27 comment.install --- modules/comment/comment.install 15 Nov 2008 13:01:05 -0000 1.27 +++ modules/comment/comment.install 27 Nov 2008 04:30:23 -0000 @@ -109,6 +109,15 @@ 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' => FALSE, 'size' => 'big')); + return $ret; +} + +/** * @} End of "defgroup updates-6.x-to-7.x" * The next series of updates should start at 8000. */ @@ -151,8 +160,8 @@ function comment_schema() { 'description' => 'The comment title.', ), 'comment' => array( - 'type' => 'text', - 'not null' => TRUE, + 'type' => 'blob', + 'not null' => FALSE, 'size' => 'big', 'description' => 'The comment body.', ), Index: modules/dblog/dblog.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/dblog/dblog.admin.inc,v retrieving revision 1.8 diff -u -p -r1.8 dblog.admin.inc --- modules/dblog/dblog.admin.inc 19 Jul 2008 07:44:45 -0000 1.8 +++ modules/dblog/dblog.admin.inc 27 Nov 2008 04:30:23 -0000 @@ -108,10 +108,11 @@ function dblog_top($type) { array('data' => t('Message'), 'field' => 'message') ); - $result = pager_query("SELECT COUNT(wid) AS count, message, variables FROM {watchdog} WHERE type = '%s' GROUP BY message, variables " . tablesort_sql($header), 30, 0, "SELECT COUNT(DISTINCT(message)) FROM {watchdog} WHERE type = '%s'", $type); + $result = pager_query("SELECT COUNT(wid) AS count, message FROM {watchdog} WHERE type = %s GROUP BY message " . tablesort_sql($header), 30, 0, "SELECT COUNT(DISTINCT(message)) FROM {watchdog} WHERE type = %s", $type); $rows = array(); while ($dblog = db_fetch_object($result)) { + $dblog->variables = db_query("SELECT variables FROM {watchdog} WHERE message = :message", array(':message' => $dblog->message))->fetchField(); $rows[] = array($dblog->count, truncate_utf8(_dblog_format_message($dblog), 56, TRUE, TRUE)); } Index: modules/dblog/dblog.install =================================================================== RCS file: /cvs/drupal/drupal/modules/dblog/dblog.install,v retrieving revision 1.10 diff -u -p -r1.10 dblog.install --- modules/dblog/dblog.install 15 Nov 2008 13:01:05 -0000 1.10 +++ modules/dblog/dblog.install 27 Nov 2008 04:30:23 -0000 @@ -49,8 +49,8 @@ function dblog_schema() { 'description' => 'Text of log message to be passed into the t() function.', ), 'variables' => array( - 'type' => 'text', - 'not null' => TRUE, + 'type' => 'blob', + 'not null' => FALSE, 'size' => 'big', 'description' => 'Serialized array of variables that match the message string and that is passed into the t() function.', ), @@ -106,6 +106,11 @@ function dblog_schema() { } /** + * @defgroup updates-6.x-to-7.x Database logging updates from 6.x to 7.x + * @{ + */ + +/** * Allow NULL values for links. */ function dblog_update_7001() { @@ -123,3 +128,17 @@ function dblog_update_7002() { db_add_index($ret, 'watchdog', 'uid', array('uid')); return $ret; } + +/** + * Remap {watchdog}.variables as BLOB type. + */ +function dblog_update_7003() { + $ret = array(); + db_change_field($ret, 'watchdog', 'variables', 'variables', array('type' => 'blob', 'not null' => FALSE, 'size' => 'big')); + return $ret; +} + +/** + * @} End of "defgroup updates-6.x-to-7.x" + * The next series of updates should start at 8000. + */ Index: modules/node/node.install =================================================================== RCS file: /cvs/drupal/drupal/modules/node/node.install,v retrieving revision 1.8 diff -u -p -r1.8 node.install --- modules/node/node.install 15 Nov 2008 13:01:08 -0000 1.8 +++ modules/node/node.install 27 Nov 2008 04:30:24 -0000 @@ -241,14 +241,14 @@ function node_schema() { ), 'body' => array( 'description' => 'The body of this version.', - 'type' => 'text', - 'not null' => TRUE, + 'type' => 'blob', + 'not null' => FALSE, 'size' => 'big', ), 'teaser' => array( 'description' => 'The teaser of this version.', - 'type' => 'text', - 'not null' => TRUE, + 'type' => 'blob', + 'not null' => FALSE, 'size' => 'big', ), 'log' => array( @@ -398,5 +398,15 @@ function node_update_7000() { } /** + * Remap {node_revisions}.body and {node_revisions}.teaser as BLOB type. + */ +function node_update_7001() { + $ret = array(); + db_change_field($ret, 'node_revisions', 'body', 'body', array('type' => 'blob', 'not null' => FALSE, 'size' => 'big')); + db_change_field($ret, 'node_revisions', 'teaser', 'teaser', array('type' => 'blob', 'not null' => FALSE, 'size' => 'big')); + return $ret; +} + +/** * End of 6.x to 7.x updates */ Index: modules/system/system.install =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.install,v retrieving revision 1.288 diff -u -p -r1.288 system.install --- modules/system/system.install 25 Nov 2008 13:16:39 -0000 1.288 +++ modules/system/system.install 27 Nov 2008 04:30:24 -0000 @@ -520,7 +520,7 @@ function system_schema() { ), 'batch' => array( 'description' => 'A serialized array containing the processing data for the batch.', - 'type' => 'text', + 'type' => 'blob', 'not null' => FALSE, 'size' => 'big', ), @@ -3143,6 +3143,15 @@ function system_update_7015() { } /** + * Remap {batch}.batch as BLOB type. + */ +function system_update_7016() { + $ret = array(); + db_change_field($ret, 'batch', 'batch', 'batch', array('type' => 'blob', 'not null' => FALSE, 'size' => 'big')); + return $ret; +} + +/** * @} End of "defgroup updates-6.x-to-7.x" * The next series of updates should start at 8000. */