? sites/default/modules ? sites/default/settings.php Index: includes/form.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/form.inc,v retrieving revision 1.289 diff -u -p -r1.289 form.inc --- includes/form.inc 27 Sep 2008 19:47:42 -0000 1.289 +++ includes/form.inc 8 Oct 2008 17:52:07 -0000 @@ -2568,8 +2568,10 @@ function batch_process($redirect = NULL, // Initiate db storage in order to get a batch id. We have to provide // at least an empty string for the (not null) 'token' column. - db_query("INSERT INTO {batch} (token, timestamp) VALUES ('', %d)", REQUEST_TIME); - $batch['id'] = db_last_insert_id('batch', 'bid'); + $batch['id'] = db_insert('batch')->fields(array( + 'token' => '', + 'timestamp' => time(), + ))->execute(); // Now that we have a batch id, we can generate the redirection link in // the generic error message. @@ -2577,7 +2579,10 @@ function batch_process($redirect = NULL, $batch['error_message'] = $t('Please continue to the error page', array('@error_url' => url($url, array('query' => array('id' => $batch['id'], 'op' => 'finished'))))); // Actually store the batch data and the token generated form the batch id. - db_query("UPDATE {batch} SET token = '%s', batch = '%s' WHERE bid = %d", drupal_get_token($batch['id']), serialize($batch), $batch['id']); + db_update('batch')->fields(array( + 'token' => drupal_get_token($batch['id']), + 'batch' => serialize($batch) + ))->condition('bid', $batch['id'])->execute(); drupal_goto($batch['url'], 'op=start&id=' . $batch['id']); } Index: modules/system/system.install =================================================================== RCS file: /cvs/drupal/drupal/modules/system/system.install,v retrieving revision 1.269 diff -u -p -r1.269 system.install --- modules/system/system.install 27 Sep 2008 20:16:17 -0000 1.269 +++ modules/system/system.install 8 Oct 2008 17:52:08 -0000 @@ -535,7 +535,7 @@ function system_schema() { ), 'batch' => array( 'description' => t('A serialized array containing the processing data for the batch.'), - 'type' => 'text', + 'type' => 'blob', 'not null' => FALSE, 'size' => 'big', ), @@ -3048,6 +3048,16 @@ function system_update_7010() { } /** + * Remap {batch}.batch as BLOB type. + */ +function system_update_7011() { + $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. */