Index: includes/update.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/update.inc,v retrieving revision 1.54 diff -u -r1.54 update.inc --- includes/update.inc 8 Jun 2010 15:08:35 -0000 1.54 +++ includes/update.inc 18 Jun 2010 10:58:18 -0000 @@ -511,7 +511,7 @@ 'description' => 'The queue name.', ), 'data' => array( - 'type' => 'text', + 'type' => 'blob', 'not null' => FALSE, 'size' => 'big', 'serialize' => TRUE, Index: modules/block/block.install =================================================================== RCS file: /cvs/drupal/drupal/modules/block/block.install,v retrieving revision 1.41 diff -u -r1.41 block.install --- modules/block/block.install 19 May 2010 19:14:43 -0000 1.41 +++ modules/block/block.install 18 Jun 2010 10:58:18 -0000 @@ -189,6 +189,11 @@ } /** + * @defgroup updates-6.x-to-7.x Block updates from 6.x to 7.x + * @{ + */ + +/** * Set system.weight to a low value for block module. * * Block should go first so that other modules can alter its output @@ -389,8 +394,59 @@ } /** - * Remove {cache_block}.headers column. + * Recreates cache_block table. */ function block_update_7005() { - db_drop_field('cache_block', 'headers'); + // 'text' column type doesn't reliably hold serialized variables. Convert to 'blob'. See http://drupal.org/node/690746 + // 'headers' column is no longer used + + $schema = array( + 'description' => 'Generic cache table for caching things not separated out into their own tables. Contributed modules may also use this to store cached items.', + 'fields' => array( + 'cid' => array( + 'description' => 'Primary Key: Unique cache ID.', + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + ), + 'data' => array( + 'description' => 'A collection of data to cache.', + 'type' => 'blob', + 'not null' => FALSE, + 'size' => 'big', + ), + 'expire' => array( + 'description' => 'A Unix timestamp indicating when the cache entry should expire, or 0 for never.', + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + ), + 'created' => array( + 'description' => 'A Unix timestamp indicating when the cache entry was created.', + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + ), + 'serialized' => array( + 'description' => 'A flag to indicate whether content is serialized (1) or not (0).', + 'type' => 'int', + 'size' => 'small', + 'not null' => TRUE, + 'default' => 0, + ), + ), + 'indexes' => array( + 'expire' => array('expire'), + ), + 'primary key' => array('cid'), + ); + + db_drop_table('cache_block'); + db_create_table('cache_block', $schema); } + +/** + * @} End of "defgroup updates-6.x-to-7.x" + * The next series of updates should start at 8000. + */ Index: modules/dblog/dblog.install =================================================================== RCS file: /cvs/drupal/drupal/modules/dblog/dblog.install,v retrieving revision 1.21 diff -u -r1.21 dblog.install --- modules/dblog/dblog.install 28 Apr 2010 05:29:55 -0000 1.21 +++ modules/dblog/dblog.install 18 Jun 2010 10:58:18 -0000 @@ -38,7 +38,7 @@ 'description' => 'Text of log message to be passed into the t() function.', ), 'variables' => array( - 'type' => 'text', + 'type' => 'blob', 'not null' => TRUE, 'size' => 'big', 'description' => 'Serialized array of variables that match the message string and that is passed into the t() function.', @@ -119,6 +119,21 @@ } /** + * Converts serialized fields to blob. + */ +function dblog_update_7004() { + // 'text' column type doesn't reliably hold serialized variables. Convert to 'blob'. See http://drupal.org/node/690746 + + $spec = array( + 'type' => 'blob', + 'not null' => TRUE, + 'size' => 'big', + 'description' => 'Serialized array of variables that match the message string and that is passed into the t() function.', + ); + db_change_field('watchdog', 'variables', 'variables', $spec); +} + +/** * @} End of "defgroup updates-6.x-to-7.x" * The next series of updates should start at 8000. */ Index: modules/field/field.install =================================================================== RCS file: /cvs/drupal/drupal/modules/field/field.install,v retrieving revision 1.18 diff -u -r1.18 field.install --- modules/field/field.install 27 Mar 2010 05:52:49 -0000 1.18 +++ modules/field/field.install 18 Jun 2010 10:58:18 -0000 @@ -72,8 +72,8 @@ 'description' => '@TODO', ), 'data' => array( - 'type' => 'text', - 'size' => 'medium', + 'type' => 'blob', + 'size' => 'big', 'not null' => TRUE, 'serialize' => TRUE, 'description' => 'Serialized data containing the field properties that do not warrant a dedicated column.', @@ -143,8 +143,8 @@ 'default' => '' ), 'data' => array( - 'type' => 'text', - 'size' => 'medium', + 'type' => 'blob', + 'size' => 'big', 'not null' => TRUE, 'serialize' => TRUE, ), Index: modules/filter/filter.install =================================================================== RCS file: /cvs/drupal/drupal/modules/filter/filter.install,v retrieving revision 1.39 diff -u -r1.39 filter.install --- modules/filter/filter.install 10 Jun 2010 06:57:20 -0000 1.39 +++ modules/filter/filter.install 18 Jun 2010 10:58:18 -0000 @@ -46,7 +46,7 @@ 'description' => 'Filter enabled status. (1 = enabled, 0 = disabled)', ), 'settings' => array( - 'type' => 'text', + 'type' => 'blob', 'not null' => FALSE, 'size' => 'big', 'serialize' => TRUE, @@ -423,6 +423,67 @@ } /** + * Converts serialized fields to blob. + */ +function filter_update_7009() { + // 'text' column type doesn't reliably hold serialized variables. Convert to 'blob'. See http://drupal.org/node/690746 + + $spec = array( + 'type' => 'blob', + 'not null' => FALSE, + 'size' => 'big', + 'serialize' => TRUE, + 'description' => 'A serialized array of name value pairs that store the filter settings for the specific format.', + ); + db_change_field('filter', 'settings', 'settings', $spec); + + $schema = array( + 'description' => 'Generic cache table for caching things not separated out into their own tables. Contributed modules may also use this to store cached items.', + 'fields' => array( + 'cid' => array( + 'description' => 'Primary Key: Unique cache ID.', + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + ), + 'data' => array( + 'description' => 'A collection of data to cache.', + 'type' => 'blob', + 'not null' => FALSE, + 'size' => 'big', + ), + 'expire' => array( + 'description' => 'A Unix timestamp indicating when the cache entry should expire, or 0 for never.', + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + ), + 'created' => array( + 'description' => 'A Unix timestamp indicating when the cache entry was created.', + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + ), + 'serialized' => array( + 'description' => 'A flag to indicate whether content is serialized (1) or not (0).', + 'type' => 'int', + 'size' => 'small', + 'not null' => TRUE, + 'default' => 0, + ), + ), + 'indexes' => array( + 'expire' => array('expire'), + ), + 'primary key' => array('cid'), + ); + + db_drop_table('cache_filter'); + db_create_table('cache_filter', $schema); +} + +/** * @} End of "defgroup updates-6.x-to-7.x" * The next series of updates should start at 8000. */ Index: modules/image/image.install =================================================================== RCS file: /cvs/drupal/drupal/modules/image/image.install,v retrieving revision 1.8 diff -u -r1.8 image.install --- modules/image/image.install 9 Apr 2010 12:07:12 -0000 1.8 +++ modules/image/image.install 18 Jun 2010 10:58:18 -0000 @@ -86,7 +86,7 @@ ), 'data' => array( 'description' => 'The configuration data for the effect.', - 'type' => 'text', + 'type' => 'blob', 'not null' => TRUE, 'size' => 'big', 'serialize' => TRUE, Index: modules/rdf/rdf.install =================================================================== RCS file: /cvs/drupal/drupal/modules/rdf/rdf.install,v retrieving revision 1.3 diff -u -r1.3 rdf.install --- modules/rdf/rdf.install 26 Feb 2010 18:31:29 -0000 1.3 +++ modules/rdf/rdf.install 18 Jun 2010 10:58:18 -0000 @@ -27,7 +27,7 @@ ), 'mapping' => array( 'description' => 'The serialized mapping of the bundle type and fields to RDF terms.', - 'type' => 'text', + 'type' => 'blob', 'not null' => FALSE, 'size' => 'big', 'serialize' => TRUE, Index: modules/simpletest/tests/database_test.install =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/database_test.install,v retrieving revision 1.11 diff -u -r1.11 database_test.install --- modules/simpletest/tests/database_test.install 3 Mar 2010 08:40:25 -0000 1.11 +++ modules/simpletest/tests/database_test.install 18 Jun 2010 10:58:18 -0000 @@ -220,7 +220,7 @@ ), 'info' => array( 'description' => "The person's data in serialized form.", - 'type' => 'text', + 'type' => 'blob', 'serialize' => TRUE, ), ), Index: modules/system/system.install =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.install,v retrieving revision 1.476 diff -u -r1.476 system.install --- modules/system/system.install 17 Jun 2010 02:12:44 -0000 1.476 +++ modules/system/system.install 18 Jun 2010 10:58:18 -0000 @@ -511,7 +511,7 @@ ), 'value' => array( 'description' => 'The value of the variable.', - 'type' => 'text', + 'type' => 'blob', 'not null' => TRUE, 'size' => 'big', 'translatable' => TRUE, @@ -546,7 +546,7 @@ ), 'parameters' => array( 'description' => 'Parameters to be passed to the callback function.', - 'type' => 'text', + 'type' => 'blob', 'not null' => TRUE, 'size' => 'big', ), @@ -585,7 +585,7 @@ ), 'batch' => array( 'description' => 'A serialized array containing the processing data for the batch.', - 'type' => 'text', + 'type' => 'blob', 'not null' => FALSE, 'size' => 'big', ), @@ -914,12 +914,12 @@ ), 'load_functions' => array( 'description' => 'A serialized array of function names (like node_load) to be called to load an object corresponding to a part of the current path.', - 'type' => 'text', + 'type' => 'blob', 'not null' => TRUE, ), 'to_arg_functions' => array( 'description' => 'A serialized array of function names (like user_uid_optional_to_arg) to be called to replace a part of the router path with another string.', - 'type' => 'text', + 'type' => 'blob', 'not null' => TRUE, ), 'access_callback' => array( @@ -931,7 +931,7 @@ ), 'access_arguments' => array( 'description' => 'A serialized array of arguments for the access callback.', - 'type' => 'text', + 'type' => 'blob', 'not null' => FALSE, ), 'page_callback' => array( @@ -943,7 +943,7 @@ ), 'page_arguments' => array( 'description' => 'A serialized array of arguments for the page callback.', - 'type' => 'text', + 'type' => 'blob', 'not null' => FALSE, ), 'delivery_callback' => array( @@ -1113,7 +1113,7 @@ ), 'options' => array( 'description' => 'A serialized array of options to be passed to the url() or l() function, such as a query string or HTML attributes.', - 'type' => 'text', + 'type' => 'blob', 'not null' => FALSE, 'translatable' => TRUE, ), @@ -1269,7 +1269,7 @@ 'description' => 'The queue name.', ), 'data' => array( - 'type' => 'text', + 'type' => 'blob', 'not null' => FALSE, 'size' => 'big', 'serialize' => TRUE, @@ -1448,7 +1448,7 @@ ), 'session' => array( 'description' => 'The serialized contents of $_SESSION, an array of name/value pairs that persists across page requests by this session ID. Drupal loads $_SESSION from here at the start of each request and saves it at the end.', - 'type' => 'text', + 'type' => 'blob', 'not null' => FALSE, 'size' => 'big', ), @@ -1524,7 +1524,7 @@ ), 'info' => array( 'description' => "A serialized array containing information from the module's .info file; keys can include name, description, package, version, core, dependencies, dependents, and php.", - 'type' => 'text', + 'type' => 'blob', 'not null' => FALSE, ), ), @@ -2405,16 +2405,144 @@ } /** - * Remove {cache_*}.headers columns. + * Recreates cache tables. */ function system_update_7054() { - $cache_tables = array('cache', 'cache_filter', 'cache_form', 'cache_menu', 'cache_page', 'cache_path'); - foreach ($cache_tables as $table) { - db_drop_field($table, 'headers'); + // 'text' column type doesn't reliably hold serialized variables. Convert to 'blob'. See http://drupal.org/node/690746 + // 'headers' column is no longer used + + $schema = array( + 'description' => 'Generic cache table for caching things not separated out into their own tables. Contributed modules may also use this to store cached items.', + 'fields' => array( + 'cid' => array( + 'description' => 'Primary Key: Unique cache ID.', + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + ), + 'data' => array( + 'description' => 'A collection of data to cache.', + 'type' => 'blob', + 'not null' => FALSE, + 'size' => 'big', + ), + 'expire' => array( + 'description' => 'A Unix timestamp indicating when the cache entry should expire, or 0 for never.', + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + ), + 'created' => array( + 'description' => 'A Unix timestamp indicating when the cache entry was created.', + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + ), + 'serialized' => array( + 'description' => 'A flag to indicate whether content is serialized (1) or not (0).', + 'type' => 'int', + 'size' => 'small', + 'not null' => TRUE, + 'default' => 0, + ), + ), + 'indexes' => array( + 'expire' => array('expire'), + ), + 'primary key' => array('cid'), + ); + + foreach (array('', '_filter', '_form', '_menu', '_page', '_path') as $table) { + db_drop_table('cache' . $table); + db_create_table('cache' . $table, $schema); } } /** + * Converts serialized fields to blob. + */ +function system_update_7055() { + // 'text' column type doesn't reliably hold serialized variables. Convert to 'blob'. See http://drupal.org/node/690746 + + $spec = array( + 'description' => 'The value of the variable.', + 'type' => 'blob', + 'not null' => TRUE, + 'size' => 'big', + 'translatable' => TRUE, + ); + db_change_field('variable', 'value', 'value', $spec); + + $spec = array( + 'description' => 'Parameters to be passed to the callback function.', + 'type' => 'blob', + 'not null' => TRUE, + 'size' => 'big', + ); + db_change_field('actions', 'parameters', 'parameters', $spec); + + $spec = array( + 'description' => 'A serialized array containing the processing data for the batch.', + 'type' => 'blob', + 'not null' => FALSE, + 'size' => 'big', + ); + db_change_field('batch', 'batch', 'batch', $spec); + + $spec = array( + 'description' => 'A serialized array of function names (like node_load) to be called to load an object corresponding to a part of the current path.', + 'type' => 'blob', + 'not null' => TRUE, + ); + db_change_field('menu_router', 'load_functions', 'load_functions', $spec); + + $spec = array( + 'description' => 'A serialized array of function names (like user_uid_optional_to_arg) to be called to replace a part of the router path with another string.', + 'type' => 'blob', + 'not null' => TRUE, + ); + db_change_field('menu_router', 'to_arg_functions', 'to_arg_functions', $spec); + + $spec = array( + 'description' => 'A serialized array of arguments for the access callback.', + 'type' => 'blob', + 'not null' => FALSE, + ); + db_change_field('menu_router', 'access_arguments', 'access_arguments', $spec); + + $spec = array( + 'description' => 'A serialized array of arguments for the page callback.', + 'type' => 'blob', + 'not null' => FALSE, + ); + db_change_field('menu_router', 'page_arguments', 'page_arguments', $spec); + + $spec = array( + 'description' => 'A serialized array of options to be passed to the url() or l() function, such as a query string or HTML attributes.', + 'type' => 'blob', + 'not null' => FALSE, + 'translatable' => TRUE, + ); + db_change_field('menu_links', 'options', 'options', $spec); + + $spec = array( + 'description' => 'The serialized contents of $_SESSION, an array of name/value pairs that persists across page requests by this session ID. Drupal loads $_SESSION from here at the start of each request and saves it at the end.', + 'type' => 'blob', + 'not null' => FALSE, + 'size' => 'big', + ); + db_change_field('sessions', 'session', 'session', $spec); + + $spec = array( + 'description' => "A serialized array containing information from the module's .info file; keys can include name, description, package, version, core, dependencies, dependents, and php.", + 'type' => 'blob', + 'not null' => FALSE, + ); + db_change_field('system', 'info', 'info', $spec); +} + +/** * @} End of "defgroup updates-6.x-to-7.x" * The next series of updates should start at 8000. */ Index: modules/update/update.install =================================================================== RCS file: /cvs/drupal/drupal/modules/update/update.install,v retrieving revision 1.18 diff -u -r1.18 update.install --- modules/update/update.install 19 May 2010 19:14:43 -0000 1.18 +++ modules/update/update.install 18 Jun 2010 10:58:18 -0000 @@ -160,6 +160,11 @@ } /** + * @defgroup updates-6.x-to-7.x Filter updates from 6.x to 7.x + * @{ + */ + +/** * Create a queue to store tasks for requests to fetch available update data. */ function update_update_7000() { @@ -169,8 +174,59 @@ } /** - * Remove {cache_update}.headers column. + * Recreates cache_update table. */ function update_update_7001() { - db_drop_field('cache_update', 'headers'); + // 'text' column type doesn't reliably hold serialized variables. Convert to 'blob'. See http://drupal.org/node/690746 + // 'headers' column is no longer used + + $schema = array( + 'description' => 'Generic cache table for caching things not separated out into their own tables. Contributed modules may also use this to store cached items.', + 'fields' => array( + 'cid' => array( + 'description' => 'Primary Key: Unique cache ID.', + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '', + ), + 'data' => array( + 'description' => 'A collection of data to cache.', + 'type' => 'blob', + 'not null' => FALSE, + 'size' => 'big', + ), + 'expire' => array( + 'description' => 'A Unix timestamp indicating when the cache entry should expire, or 0 for never.', + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + ), + 'created' => array( + 'description' => 'A Unix timestamp indicating when the cache entry was created.', + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + ), + 'serialized' => array( + 'description' => 'A flag to indicate whether content is serialized (1) or not (0).', + 'type' => 'int', + 'size' => 'small', + 'not null' => TRUE, + 'default' => 0, + ), + ), + 'indexes' => array( + 'expire' => array('expire'), + ), + 'primary key' => array('cid'), + ); + + db_drop_table('cache_update'); + db_create_table('cache_update', $schema); } + +/** + * @} End of "defgroup updates-6.x-to-7.x" + * The next series of updates should start at 8000. + */ Index: modules/user/user.install =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user.install,v retrieving revision 1.50 diff -u -r1.50 user.install --- modules/user/user.install 10 Jun 2010 06:57:20 -0000 1.50 +++ modules/user/user.install 18 Jun 2010 10:58:18 -0000 @@ -219,7 +219,7 @@ 'description' => 'E-mail address used for initial account creation.', ), 'data' => array( - 'type' => 'text', + 'type' => 'blob', 'not null' => FALSE, 'size' => 'big', 'serialize' => TRUE, @@ -625,6 +625,22 @@ } } /** + * Converts serialized fields to blob. + */ +function user_update_7009() { + // 'text' column type doesn't reliably hold serialized variables. Convert to 'blob'. See http://drupal.org/node/690746 + + $spec = array( + 'type' => 'blob', + 'not null' => FALSE, + 'size' => 'big', + 'serialize' => TRUE, + 'description' => 'A serialized array of name value pairs that are related to the user. Any form values posted during user edit are stored and are loaded into the $user object during user_load(). Use of this field is discouraged and it will likely disappear in a future version of Drupal.', + ); + db_change_field('users', 'data', 'data', $spec); +} + +/** * @} End of "defgroup user-updates-6.x-to-7.x" * The next series of updates should start at 8000. */