From 83e77b37356dee07bbd1333c775970e0118997aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Hojtsy?= Date: Fri, 7 Dec 2007 11:55:13 +0000 Subject: #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 --- modules/system/system.install | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'modules/system/system.install') 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; } -- cgit v1.2.3