summaryrefslogtreecommitdiff
path: root/modules/system
diff options
context:
space:
mode:
authorGábor Hojtsy <gabor@hojtsy.hu>2007-12-07 11:55:13 +0000
committerGábor Hojtsy <gabor@hojtsy.hu>2007-12-07 11:55:13 +0000
commit83e77b37356dee07bbd1333c775970e0118997aa (patch)
tree56ac573de3034df915f176733baa5dc2e28c2d35 /modules/system
parent5d8cf1b865b1a926957bbc8802618dad08506fe0 (diff)
downloadbrdo-83e77b37356dee07bbd1333c775970e0118997aa.tar.gz
brdo-83e77b37356dee07bbd1333c775970e0118997aa.tar.bz2
#198461 by chx: use a simple subquery instead of iterating through all nodes and updating the term_node table one-by-one, which easily caused a timeout on sites with lots of term-node associations
Diffstat (limited to 'modules/system')
-rw-r--r--modules/system/system.install6
1 files changed, 1 insertions, 5 deletions
diff --git a/modules/system/system.install b/modules/system/system.install
index 682f76a36..c89294220 100644
--- a/modules/system/system.install
+++ b/modules/system/system.install
@@ -1628,11 +1628,7 @@ function system_update_6001() {
db_add_primary_key($ret, 'term_node', array('vid', 'tid', 'nid'));
db_add_index($ret, 'term_node', 'vid', array('vid'));
- // Update all entries with the current revision number.
- $nodes = db_query('SELECT nid, vid FROM {node}');
- while ($node = db_fetch_object($nodes)) {
- db_query('UPDATE {term_node} SET vid = %d WHERE nid = %d', $node->vid, $node->nid);
- }
+ db_query('UPDATE {term_node} t SET vid = (SELECT vid FROM {node} n WHERE t.nid = n.nid)');
return $ret;
}