You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by mm...@apache.org on 2007/09/28 20:43:40 UTC

svn commit: r580455 - /spamassassin/trunk/lib/Mail/SpamAssassin/BayesStore/SQL.pm

Author: mmartinec
Date: Fri Sep 28 11:43:40 2007
New Revision: 580455

URL: http://svn.apache.org/viewvc?rev=580455&view=rev
Log:
simplified SELECT FROM bayes_token to be able to use index, see bug 5661

Modified:
    spamassassin/trunk/lib/Mail/SpamAssassin/BayesStore/SQL.pm

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/BayesStore/SQL.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/BayesStore/SQL.pm?rev=580455&r1=580454&r2=580455&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/BayesStore/SQL.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/BayesStore/SQL.pm Fri Sep 28 11:43:40 2007
@@ -241,7 +241,7 @@
   my $sql = "SELECT count(*)
                FROM bayes_token
               WHERE id = ?
-                AND (? - atime) > ?";
+                AND atime < ?";
 
   my $sth = $self->{_dbh}->prepare_cached($sql);
     
@@ -251,7 +251,7 @@
   }
 
   for (my $i = 1; $i <= $max_expire_mult; $i<<=1) {
-    my $rc = $sth->execute($self->{_userid}, $newest_atime, $start * $i);
+    my $rc = $sth->execute($self->{_userid}, $newest_atime - $start * $i);
 
     unless ($rc) {
       dbg("bayes: calculate_expire_delta: SQL error: ".$self->{_dbh}->errstr());