Bug 7941 - sql/txrep_sqlite.sql: typo in UPDATE trigger column name breaks txrep DB
Summary: sql/txrep_sqlite.sql: typo in UPDATE trigger column name breaks txrep DB
Status: RESOLVED FIXED
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: spamassassin (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: 4.0.0
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-06 00:37 UTC by Maciej S. Szmigiero
Modified: 2022-04-11 11:39 UTC (History)
3 users (show)



Attachment Type Modified Status Actions Submitter/CLA Status
show DBI prepare operation errors patch None Maciej S. Szmigiero [NoCLA]

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej S. Szmigiero 2021-11-06 00:37:56 UTC
sql/txrep_sqlite.sql has a typo in UPDATE trigger column name: [1] should be [2] (note the "hot" vs "hit").

This typo breaks UPDATE operations on txrep DBs created from that script.

While at it I would suggest applying the attached patch to "SQLBasedAddrList.pm" so errors like this one (happening at DBI prepare operation) are correctly handled and logged, instead of printing just [3] which doesn't give a clue what is wrong.

References:
[1]: WHEN NEW.last_hot < OLD.last_hit

[2]: WHEN NEW.last_hit < OLD.last_hit

[3]: Can't call method "execute" on an undefined value
Comment 1 Maciej S. Szmigiero 2021-11-06 00:38:33 UTC
Created attachment 5757 [details]
show DBI prepare operation errors
Comment 2 Henrik Krohns 2022-04-11 11:39:51 UTC
Thanks, there were many $sth checks missing.

Sending        trunk/lib/Mail/SpamAssassin/SQLBasedAddrList.pm
Sending        trunk/sql/txrep_sqlite.sql
Transmitting file data ..done
Committing transaction...
Committed revision 1899744.