diff options
author | Dries Buytaert <dries@buytaert.net> | 2007-08-12 16:12:00 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2007-08-12 16:12:00 +0000 |
commit | c17499b6fe5e9b388d09151d2c3525976fde065c (patch) | |
tree | 0203a1d7f6cbeba58fc2056ae4f6c6caa30119d0 /modules/system/system.install | |
parent | b134b023e11902ceae12f3ab861da1f0a2fdbdbd (diff) | |
download | brdo-c17499b6fe5e9b388d09151d2c3525976fde065c.tar.gz brdo-c17499b6fe5e9b388d09151d2c3525976fde065c.tar.bz2 |
- Patch #163191 by hswong3i: removed db_num_rows() for compatibility with Oracle and DB2. Also a performance improvement. (Correct version this time.)
Diffstat (limited to 'modules/system/system.install')
-rw-r--r-- | modules/system/system.install | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/modules/system/system.install b/modules/system/system.install index a1ab612d2..e0aa4d35e 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -1428,9 +1428,9 @@ function system_update_159() { $ret = array(); $result = db_query_range("SELECT * FROM {old_revisions} WHERE done = 0 AND type IN ('page', 'story', 'poll', 'book', 'forum', 'blog') ORDER BY nid DESC", 0, 20); - $result_rows = db_result(db_query_range("SELECT COUNT(*) FROM {old_revisions} WHERE done = 0 AND type IN ('page', 'story', 'poll', 'book', 'forum', 'blog') ORDER BY nid DESC", 0, 20)); + $num_rows = db_result(db_query_range("SELECT COUNT(*) FROM {old_revisions} WHERE done = 0 AND type IN ('page', 'story', 'poll', 'book', 'forum', 'blog') ORDER BY nid DESC", 0, 20)); - if ($result_rows) { + if ($num_rows) { $vid = db_next_id('{node_revisions}_vid'); while ($node = db_fetch_object($result)) { $revisions = unserialize($node->revisions); @@ -1520,7 +1520,7 @@ function system_update_159() { } } - if ($result_rows < 20) { + if ($num_rows < 20) { $ret[] = update_sql('ALTER TABLE {old_revisions} DROP done'); } else { @@ -2169,6 +2169,7 @@ function system_update_179() { $limit = 20; $args = array_merge(array($_SESSION['system_update_179_uid'], $_SESSION['system_update_179_fid'], $_SESSION['system_update_179_uid']), $_SESSION['system_update_179_fields']); $result = db_query_range("SELECT fid, uid, value FROM {profile_values} WHERE ((uid = %d AND fid > %d) OR uid > %d) AND fid IN ". $_SESSION['system_update_179_field_string'] .' ORDER BY uid ASC, fid ASC', $args, 0, $limit); + $num_rows = 0; while ($field = db_fetch_object($result)) { $_SESSION['system_update_179_uid'] = $field->uid; $_SESSION['system_update_179_fid'] = $field->fid; @@ -2176,11 +2177,11 @@ function system_update_179() { if ($field->value !== FALSE) { db_query("UPDATE {profile_values} SET value = '%s' WHERE uid = %d AND fid = %d", $field->value, $field->uid, $field->fid); } - + $num_rows++; } // Done? - if (!$field) { + if ($num_rows == 0) { unset($_SESSION['system_update_179_uid']); unset($_SESSION['system_update_179_fid']); unset($_SESSION['system_update_179_max']); |