http://bugzilla.spamassassin.org/show_bug.cgi?id=3331





------- Additional Comments From [EMAIL PROTECTED]  2004-08-11 14:32 -------
Subject: Re:  [review] Bayes option to keep original token as db data (not 
key). 

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


> > why the @bindings temp copy in the @@ -1033,9 +1036,10 @@ change?
> 
> The tok_touch code used to update the raw_token so I had made bindings
> dynamic, then I removed that since a) tok_touch is never actually
> called and it wasn't easily done in tok_touch_all and b) wasn't really
> necessary.  However, I left the dynamic nature of the bindings in,
> just in case there was some future use.
> 
> I could back it out if it bothers folks.

No -- just wondering why a temporary copy was used in that one function.
I can see in the other function that uses it, it does chnage the contents
of @bindings, but in that one function, it just uses it as-is, like so:

@@ -1025,6 +1026,8 @@
 
   return 0 unless (defined($self->{_dbh}));
 
+  my @bindings;
+
   # shortcut, will only update atime for the token if the atime is less than
   # what we are updating to
   my $sql = "UPDATE bayes_token
@@ -1033,9 +1036,10 @@
                 AND token = ?
                 AND atime < ?";
 
- -  my $rows = $self->{_dbh}->do($sql, undef, $atime, $self->{_userid},
- -                            $token, $atime);
+  @bindings = ($atime, $self->{_userid}, $token, $atime);
 
+  my $rows = $self->{_dbh}->do($sql, undef, @bindings);
+
   unless (defined($rows)) {
     dbg("bayes: tok_touch: SQL Error: ".$self->{_dbh}->errstr());
     return 0;


note that the assignment to @bindings comes immediately before its
only use in that fn, so it seems superfluous to use it there
instead of just 

   my $rows = $self->{_dbh}->do($sql, undef,
                $atime, $self->{_userid}, $token, $atime);

> > +   (my $unpacked_token, $raw_token) = split(/\s+/, $token, 2);
> > 
> > split (/ /, ...) would probably be faster, if you can make that assumption.
> > ditto in the @@ -1594,14 change.
> 
> The backup format has \t between the elements, however I've seen some
> unpack(H*) tokens with spaces at the end, so we need to check for 1 or
> more whitespaces.

ok.  shame ;)

- --j.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Exmh CVS

iD8DBQFBGpCAQTcbUG5Y7woRAmQhAKCtlPyStdh0jSR3aPJAsKBq3DOf1gCgxDSc
FbN2/rGmsmR06ZD15FHCst4=
=vJfV
-----END PGP SIGNATURE-----





------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.

Reply via email to