Commit 7e52847a authored by Dries's avatar Dries

- Patch #690746 by jbrown, Ognyan Kulev, Crell, MichaelCole, Damien Tournoud:...

- Patch #690746 by jbrown, Ognyan Kulev, Crell, MichaelCole, Damien Tournoud: text column type doesn't reliably hold serialized variables.
parent f56b384b
......@@ -512,7 +512,7 @@ function update_fix_d7_requirements() {
'description' => 'The queue name.',
),
'data' => array(
'type' => 'text',
'type' => 'blob',
'not null' => FALSE,
'size' => 'big',
'serialize' => TRUE,
......
......@@ -188,6 +188,11 @@ function block_install() {
->execute();
}
/**
* @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.
*
......@@ -389,8 +394,19 @@ function block_update_7004() {
}
/**
* Remove {cache_block}.headers column.
* Recreates cache_block table.
*
* Converts fields that hold serialized variables from text to blob.
* Removes 'headers' column.
*/
function block_update_7005() {
db_drop_field('cache_block', 'headers');
$schema = system_schema_cache_7054();
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.
*/
......@@ -38,7 +38,7 @@ function dblog_schema() {
'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.',
......@@ -118,6 +118,19 @@ function dblog_update_7003() {
db_change_field('watchdog', 'type', 'type', array('type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => ''));
}
/**
* Converts fields that store serialized variables from text to blob.
*/
function dblog_update_7004() {
$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.
......
......@@ -72,8 +72,8 @@ function field_schema() {
'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 @@ function field_schema() {
'default' => ''
),
'data' => array(
'type' => 'text',
'size' => 'medium',
'type' => 'blob',
'size' => 'big',
'not null' => TRUE,
'serialize' => TRUE,
),
......
......@@ -46,7 +46,7 @@ function filter_schema() {
'description' => 'Filter enabled status. (1 = enabled, 0 = disabled)',
),
'settings' => array(
'type' => 'text',
'type' => 'blob',
'not null' => FALSE,
'size' => 'big',
'serialize' => TRUE,
......@@ -422,6 +422,24 @@ function filter_update_7008() {
}
}
/**
* Converts fields that store serialized variables from text to blob.
*/
function filter_update_7009() {
$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 = system_schema_cache_7054();
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.
......
......@@ -86,7 +86,7 @@ function image_schema() {
),
'data' => array(
'description' => 'The configuration data for the effect.',
'type' => 'text',
'type' => 'blob',
'not null' => TRUE,
'size' => 'big',
'serialize' => TRUE,
......@@ -168,7 +168,7 @@ function image_update_7000() {
),
'data' => array(
'description' => 'The configuration data for the effect.',
'type' => 'text',
'type' => 'blob',
'not null' => TRUE,
'size' => 'big',
'serialize' => TRUE,
......@@ -183,6 +183,7 @@ function image_update_7000() {
'isid' => array('image_styles' => 'isid'),
),
);
db_create_table('cache_image', $schema['cache_image']);
db_create_table('image_styles', $schema['image_styles']);
db_create_table('image_effect', $schema['image_effects']);
......
......@@ -27,7 +27,7 @@ function rdf_schema() {
),
'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,
......
......@@ -220,7 +220,7 @@ function database_test_schema() {
),
'info' => array(
'description' => "The person's data in serialized form.",
'type' => 'text',
'type' => 'blob',
'serialize' => TRUE,
),
),
......
......@@ -511,7 +511,7 @@ function system_schema() {
),
'value' => array(
'description' => 'The value of the variable.',
'type' => 'text',
'type' => 'blob',
'not null' => TRUE,
'size' => 'big',
'translatable' => TRUE,
......@@ -546,7 +546,7 @@ function system_schema() {
),
'parameters' => array(
'description' => 'Parameters to be passed to the callback function.',
'type' => 'text',
'type' => 'blob',
'not null' => TRUE,
'size' => 'big',
),
......@@ -585,7 +585,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',
),
......@@ -913,12 +913,12 @@ function system_schema() {
),
'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(
......@@ -930,7 +930,7 @@ function system_schema() {
),
'access_arguments' => array(
'description' => 'A serialized array of arguments for the access callback.',
'type' => 'text',
'type' => 'blob',
'not null' => FALSE,
),
'page_callback' => array(
......@@ -942,7 +942,7 @@ function system_schema() {
),
'page_arguments' => array(
'description' => 'A serialized array of arguments for the page callback.',
'type' => 'text',
'type' => 'blob',
'not null' => FALSE,
),
'delivery_callback' => array(
......@@ -1112,7 +1112,7 @@ function system_schema() {
),
'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,
),
......@@ -1268,7 +1268,7 @@ function system_schema() {
'description' => 'The queue name.',
),
'data' => array(
'type' => 'text',
'type' => 'blob',
'not null' => FALSE,
'size' => 'big',
'serialize' => TRUE,
......@@ -1447,7 +1447,7 @@ function system_schema() {
),
'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 @@ function system_schema() {
),
'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,
),
),
......@@ -2454,12 +2454,95 @@ function system_update_7054() {
// Update: update_fix_d7_requirements() installs this version for cache_path
// already, so we don't include it in this particular update. It should be
// included in later updates though.
$cache_tables = array('cache', 'cache_filter', 'cache_form', 'cache_menu', 'cache_page');
foreach ($cache_tables as $table) {
db_drop_field($table, 'headers');
$cache_tables = array('cache', 'cache_form', 'cache_menu', 'cache_page');
$schema = system_schema_cache_7054();
foreach ($cache_tables as $table => $description) {
db_drop_table($table);
db_create_table($table, $schema);
}
}
/**
* Converts fields that store serialized variables from text to blob.
*/
function system_update_7055() {
$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.
......
......@@ -159,6 +159,11 @@ function _update_requirement_check($project, $type) {
return $requirement;
}
/**
* @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.
*/
......@@ -169,8 +174,19 @@ function update_update_7000() {
}
/**
* Remove {cache_update}.headers column.
* Recreates cache_update table.
*
* Converts fields that hold serialized variables from text to blob.
* Removes 'headers' column.
*/
function update_update_7001() {
db_drop_field('cache_update', 'headers');
$schema = system_schema_cache_7054();
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.
*/
......@@ -219,7 +219,7 @@ function user_schema() {
'description' => 'E-mail address used for initial account creation.',
),
'data' => array(
'type' => 'text',
'type' => 'blob',
'not null' => FALSE,
'size' => 'big',
'serialize' => TRUE,
......@@ -624,6 +624,21 @@ function user_update_7008() {
variable_set('user_register', USER_REGISTER_VISITORS);
}
}
/**
* Converts fields that store serialized variables from text to blob.
*/
function user_update_7009() {
$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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment