[spambayes-bugs] [ spambayes-Patches-756413 ] Add a SQL-based storage class

SourceForge.net noreply at sourceforge.net
Wed Aug 6 23:05:45 EDT 2003


Patches item #756413, was opened at 2003-06-18 16:23
Message generated for change (Comment added) made by anadelonbrin
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=498105&aid=756413&group_id=61702

Category: None
Group: None
>Status: Closed
>Resolution: Accepted
Priority: 1
Submitted By: Tony Meyer (anadelonbrin)
Assigned to: Tony Meyer (anadelonbrin)
Summary: Add a SQL-based storage class

Initial Comment:
The attached patches add a SQL based storage class 
that can be used via pop3proxy.  It assumes that the 
user has mySQL and MySQLdb installed, and has already 
set up the table as suggested on the spambayes mailing 
list.

There is a great deal of room for improvement here.  In 
particular, having a separate table for the tokens is 
probably a waste (as discussed somewhat abstractly on 
the list).

If anyone wants an SQL solution, here it is.  This should 
be able to be patched into the current cvs for a 
reasonable while yet.

If you do end up using this, please let the list know.  If a 
suitably large number of people do (at least 2!), then it 
could be checked in to the main code.

----------------------------------------------------------------------

>Comment By: Tony Meyer (anadelonbrin)
Date: 2003-08-07 17:05

Message:
Logged In: YES 
user_id=552329

A much better version, partly based on this, but more based 
on Skip's great SQLClassifier base case is now in cvs.

----------------------------------------------------------------------

Comment By: Skip Montanaro (montanaro)
Date: 2003-06-19 12:03

Message:
Logged In: YES 
user_id=44345

"diff -c oldfile newfile" should be sufficient to generate a patch
that will be more forgiving of slight changes to the files being
patched.  I don't know if the patch command will even accept
plain diffs.



----------------------------------------------------------------------

Comment By: Tony Meyer (anadelonbrin)
Date: 2003-06-19 11:43

Message:
Logged In: YES 
user_id=552329

Is there a diff how-to somewhere?  I looked for one a while 
back, but couldn't find anything (apart from the manual for 
diff itself).  I was just guessing...

The connect call connects to the mySQL server.  The USE 
command just after that connects to the appropriate 
database.  I haven't used mySQLdb much, so I don't know for 
sure this is the correct way to do it, but it did work.

The base class is a good idea.  I'll do this if I ever put this in 
the main code.

----------------------------------------------------------------------

Comment By: Skip Montanaro (montanaro)
Date: 2003-06-18 23:54

Message:
Logged In: YES 
user_id=44345

A couple quick observations without having tried the code:
* the diffs all seem to be reversed and are not context
  diffs, so it will be tough to apply them if the surrounding
  code changes at all

* don't you need to specify a database name in the connect
  call?

* maybe it should be called MySQLClassifier to admit other
  SQL implementations later.  For the short term, perhaps
  a dummy SQLClassifier could inherit from classifier.Classifier
  and be the base class for MySQLClassifier.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=498105&aid=756413&group_id=61702



More information about the Spambayes-bugs mailing list