Re: DecodeShortURL fails with postgresql

2023-01-29 Thread John Hardin

On Sun, 29 Jan 2023, Benny Pedersen wrote:


Jan 29 01:02:00 localhost postgres[15177]: [11-3]   DELETE FROM 
short_url_cache
Jan 29 01:02:00 localhost postgres[15177]: [11-4]   WHERE short_url $1 
= AND created < CAST(EXTRACT(epoch FROM NOW()) AS INT) - 86400
Jan 29 05:40:38 localhost postgres[24315]: [11-1] 2023-01-29 04:40:38.502 UTC [24315] 
ERROR:  syntax error at or near "$1" at character 62


 I'm not an SQL expert. Can you give me more details on how to trigger
 the bug you are pointing out, what it does, and what is expected?


same here, i just report it


This bit:

WHERE short_url $1 = AND

...should probably be:

WHERE short_url = $1 AND


The basic expression syntax of SQL is the same as other (infix!) 
languages..




--
 John Hardin KA7OHZhttp://www.impsec.org/~jhardin/
 jhar...@impsec.org pgpk -a jhar...@impsec.org
 key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C  AF76 D822 E6E6 B873 2E79
---
  Maxim XI: Everything is air-droppable at least once.
---
 3 days until the 20th anniversary of the loss of STS-107 Columbia


Re: DecodeShortURL fails with postgresql

2023-01-28 Thread Benny Pedersen

Sidney Markowitz skrev den 2023-01-25 22:04:

Benny Pedersen wrote on 19/01/23 10:47 +13:00:


https://github.com/apache/spamassassin/blob/trunk/lib/Mail/SpamAssassin/Plugin/DecodeShortURLs.pm#L594-L601

only me testing postgresql ?


As I discovered from a recently discovered postgres-only bug, there
must not have been much use of postgres with trunk before 4.0.0 was
released and not much running of the tests with postgres. I'm in the
process of setting up some more automated testing on GitHub actions
machines that include the postgres tests.


a bit sad imho, today i get logged the query fails

Jan 29 01:02:00 localhost postgres[15177]: [11-1] 2023-01-29 
00:02:00.661 UTC [15177] ERROR:  syntax error at or near "$1" at 
character 62
Jan 29 01:02:00 localhost postgres[15177]: [11-2] 2023-01-29 
00:02:00.661 UTC [15177] STATEMENT:
Jan 29 01:02:00 localhost postgres[15177]: [11-3] 	DELETE FROM 
short_url_cache
Jan 29 01:02:00 localhost postgres[15177]: [11-4] 	WHERE 
short_url $1 = AND created < CAST(EXTRACT(epoch FROM NOW()) AS INT) - 
86400

Jan 29 01:02:00 localhost postgres[15177]: [11-5]
Jan 29 05:40:38 localhost postgres[24315]: [11-1] 2023-01-29 
04:40:38.502 UTC [24315] ERROR:  syntax error at or near "$1" at 
character 62
Jan 29 05:40:38 localhost postgres[24315]: [11-2] 2023-01-29 
04:40:38.502 UTC [24315] STATEMENT:
Jan 29 05:40:38 localhost postgres[24315]: [11-3] 	DELETE FROM 
short_url_cache
Jan 29 05:40:38 localhost postgres[24315]: [11-4] 	WHERE 
short_url $1 = AND created < CAST(EXTRACT(epoch FROM NOW()) AS INT) - 
86400

Jan 29 05:40:38 localhost postgres[24315]: [11-5]


I'm not an SQL expert. Can you give me more details on how to trigger
the bug you are pointing out, what it does, and what is expected?


same here, i just report it


I don't think that we have any tests in the test suite that cover use
of the cache with anything but default SQLite. It would be a good idea
to add test coverage for anything that has SQL queries.


as long its not redis i like it :)

bayes in redis have aswell ttl expire, but sqlite mysql postgresql have 
not




Benny Pedersen wrote on 19/01/23 14:04 +13:00:
good i can confirm that only the ttl expire fails, other things works 
as

i can see

is github not current trunk code btw ?, i just belive error exists in
line number as above


The GitHub mirror updates from svn trunk very quickly after any
commit. I haven't timed it, but have never looked at GitHub fast
enough to not see a commit I have made.


so it is in sync, but only in read only mode ?


Re: DecodeShortURL fails with postgresql

2023-01-25 Thread Sidney Markowitz

Benny Pedersen wrote on 19/01/23 10:47 +13:00:


https://github.com/apache/spamassassin/blob/trunk/lib/Mail/SpamAssassin/Plugin/DecodeShortURLs.pm#L594-L601

only me testing postgresql ?


As I discovered from a recently discovered postgres-only bug, there must 
not have been much use of postgres with trunk before 4.0.0 was released 
and not much running of the tests with postgres. I'm in the process of 
setting up some more automated testing on GitHub actions machines that 
include the postgres tests.


I'm not an SQL expert. Can you give me more details on how to trigger 
the bug you are pointing out, what it does, and what is expected?


I don't think that we have any tests in the test suite that cover use of 
the cache with anything but default SQLite. It would be a good idea to 
add test coverage for anything that has SQL queries.


Benny Pedersen wrote on 19/01/23 14:04 +13:00:

good i can confirm that only the ttl expire fails, other things works as
i can see

is github not current trunk code btw ?, i just belive error exists in
line number as above


The GitHub mirror updates from svn trunk very quickly after any commit. 
I haven't timed it, but have never looked at GitHub fast enough to not 
see a commit I have made.


 Sidney



Re: DecodeShortURL fails with postgresql

2023-01-18 Thread Benny Pedersen

Martin Gregorie skrev den 2023-01-19 00:45:

On Wed, 2023-01-18 at 22:47 +0100, Benny Pedersen wrote:


https://github.com/apache/spamassassin/blob/trunk/lib/Mail/SpamAssassin/Plugin/DecodeShortURLs.pm#L594-L601

only me testing postgresql ?



I'm using it with a self-written Perl data retrieval module that was
tested long ago, so not currently testing, but not yet using SA 4
either.


good i can confirm that only the ttl expire fails, other things works as 
i can see


is github not current trunk code btw ?, i just belive error exists in 
line number as above


Re: DecodeShortURL fails with postgresql

2023-01-18 Thread Martin Gregorie
On Wed, 2023-01-18 at 22:47 +0100, Benny Pedersen wrote:
> 
> https://github.com/apache/spamassassin/blob/trunk/lib/Mail/SpamAssassin/Plugin/DecodeShortURLs.pm#L594-L601
> 
> only me testing postgresql ?
> 
> 
I'm using it with a self-written Perl data retrieval module that was
tested long ago, so not currently testing, but not yet using SA 4
either.


Martin



DecodeShortURL fails with postgresql

2023-01-18 Thread Benny Pedersen



https://github.com/apache/spamassassin/blob/trunk/lib/Mail/SpamAssassin/Plugin/DecodeShortURLs.pm#L594-L601

only me testing postgresql ?