diff options
author | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-05-12 11:42:42 +0000 |
---|---|---|
committer | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-05-12 11:42:42 +0000 |
commit | 4793c2e10ef0f45fe556d248b8d96aaa844dc6ef (patch) | |
tree | c435e2a22f2c41bf1a7b474e2d7bad15247200e1 /engine | |
parent | 865b852efb255c514017a7f0b5a845ee8b2f257b (diff) | |
download | elgg-4793c2e10ef0f45fe556d248b8d96aaa844dc6ef.tar.gz elgg-4793c2e10ef0f45fe556d248b8d96aaa844dc6ef.tar.bz2 |
Closes #1003: Using more efficient query
git-svn-id: https://code.elgg.org/elgg/trunk@3283 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine')
-rw-r--r-- | engine/lib/system_log.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/engine/lib/system_log.php b/engine/lib/system_log.php index 71996c8b3..8f546598f 100644 --- a/engine/lib/system_log.php +++ b/engine/lib/system_log.php @@ -245,15 +245,15 @@ $ts = $now - $offset;
// create table
- if (!update_data("CREATE TABLE {$CONFIG->dbprefix}system_log_$now as SELECT * from {$CONFIG->dbprefix}system_log WHERE time_created<=$ts"))
+ if (!update_data("CREATE TABLE {$CONFIG->dbprefix}system_log_$now as SELECT * from {$CONFIG->dbprefix}system_log WHERE time_created<$ts"))
return false;
- // alter table to engine
- if (!update_data("ALTER TABLE {$CONFIG->dbprefix}system_log_$now engine=archive"))
- return false;
-
// delete
- if (delete_data("DELETE from {$CONFIG->dbprefix}system_log WHERE id in (select id from {$CONFIG->dbprefix}system_log_$now)")===false) // Don't delete on time since we are running in a concurrent environment
+ if (delete_data("DELETE from {$CONFIG->dbprefix}system_log WHERE time_created<$ts)")===false) // Don't delete on time since we are running in a concurrent environment
+ return false; + + // alter table to engine + if (!update_data("ALTER TABLE {$CONFIG->dbprefix}system_log_$now engine=archive")) return false;
return true;
|