You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by he...@apache.org on 2022/04/11 09:20:59 UTC

svn commit: r1899738 - in /spamassassin/trunk/lib/Mail/SpamAssassin/BayesStore: PgSQL.pm SQL.pm

Author: hege
Date: Mon Apr 11 09:20:59 2022
New Revision: 1899738

URL: http://svn.apache.org/viewvc?rev=1899738&view=rev
Log:
Fix _token_select_string as SQLite compatible

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

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/BayesStore/PgSQL.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/BayesStore/PgSQL.pm?rev=1899738&r1=1899737&r2=1899738&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/BayesStore/PgSQL.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/BayesStore/PgSQL.pm Mon Apr 11 09:20:59 2022
@@ -1073,6 +1073,20 @@ sub _put_tokens {
   return 1;
 }
 
+=head2 _token_select_string
+
+private instance (String) _token_select_string
+
+Description:
+This method returns the string to be used in SELECT statements to represent
+the token column.
+
+=cut
+
+sub _token_select_string {
+  return "token";
+}
+
 sub _quote_bytea {
   my ($str) = @_;
   my $buf = "";

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/BayesStore/SQL.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/BayesStore/SQL.pm?rev=1899738&r1=1899737&r2=1899738&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/BayesStore/SQL.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/BayesStore/SQL.pm Mon Apr 11 09:20:59 2022
@@ -2344,10 +2344,13 @@ Description:
 This method returns the string to be used in SELECT statements to represent
 the token column.
 
+The default is to use the SUBSTR function to pad the token out to 5 characters.
+
 =cut
 
 sub _token_select_string {
-  return "token";
+  # Use SQLite compatible RPAD alternative
+  return "SUBSTR(token || '     ', 1, 5)";
 }
 
 sub sa_die { Mail::SpamAssassin::sa_die(@_); }