diff options
author | webchick <webchick@24967.no-reply.drupal.org> | 2012-04-26 11:38:48 -0700 |
---|---|---|
committer | webchick <webchick@24967.no-reply.drupal.org> | 2012-04-26 11:38:48 -0700 |
commit | 71f3da793bef8191bb89642b90093166f88ddace (patch) | |
tree | ca72141cbadf2baec233c87d1fe013f48008ab44 /includes | |
parent | 6af9c29d6338cb634906b48819ea2840fe15ff3f (diff) | |
download | brdo-71f3da793bef8191bb89642b90093166f88ddace.tar.gz brdo-71f3da793bef8191bb89642b90093166f88ddace.tar.bz2 |
Issue #1536160 by drumm: Make update_fix_d7_block_deltas() faster.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/update.inc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/includes/update.inc b/includes/update.inc index d8ebd7ff1..6588fac00 100644 --- a/includes/update.inc +++ b/includes/update.inc @@ -410,15 +410,18 @@ function update_fix_d7_block_deltas(&$sandbox, $renamed_deltas, $moved_deltas) { // Initialize batch update information. $sandbox['progress'] = 0; $sandbox['last_user_processed'] = -1; - $sandbox['max'] = db_query("SELECT COUNT(*) FROM {users} WHERE data IS NOT NULL")->fetchField(); + $sandbox['max'] = db_query("SELECT COUNT(*) FROM {users} WHERE data LIKE :block", array( + ':block' => '%' . db_like(serialize('block')) . '%', + )) + ->fetchField(); } // Now do the batch update of the user-specific block visibility settings. $limit = 100; $result = db_select('users', 'u') ->fields('u', array('uid', 'data')) ->condition('uid', $sandbox['last_user_processed'], '>') + ->condition('data', '%' . db_like(serialize('block')) . '%', 'LIKE') ->orderBy('uid', 'ASC') - ->where('data IS NOT NULL') ->range(0, $limit) ->execute(); foreach ($result as $row) { |