>>   
>> $key,$sessionData->{'UnixTimestamp'},$sessionData->{'UnixTimestamp'},$whitelist
>>
>>   
>>     
>>>  I'm at a loss here, I cannot see how that query can fail, especially
>>>  with a syntax-like error.
>>>     
>>>       
>> After playing with it a bit today I believe the problem is you should be 
>> using $sessionData->{'Timestamp'} instead of 
>> $sessionData->{'UnixTimestamp'} otherwise you are getting uninitialised 
>> values in the SQL and hence it bombs...
>>
>> BUT I still cannot get the format you are using to work.  Instead I 
>> tried this and it seems to work
>>
>> $sth = DBDo("
>>   INSERT INTO greylisting_autowhitelist
>>     (TrackKey,Added,LastSeen,Comment)
>>   VALUES
>>     
>> (".DBQuote($key).",".$sessionData->{'Timestamp'}.",".$sessionData->{'Timestamp'}.",".DBQuote($whitelist).")
>> ");
>>
>>
>>
>>   
>>     
> You're right, bug found. This is against v2.0.7 , can you confirm it works?
>
>   

Revert fix-usage-of-dbdo.patch
Apply attached.

-N

Index: cbp/dblayer.pm
===================================================================
--- cbp/dblayer.pm	(revision 465)
+++ cbp/dblayer.pm	(working copy)
@@ -116,13 +116,13 @@
 # Args: <command statement>
 sub DBDo
 {
-	my $command = shift;
+	my ($command,@params) = @_;
 
 
 	# Prepare query
 	my $sth;
-	if (!($sth = $dbh->do($command))) {
-		setError("Error executing command: ".$dbh->Error());
+	if (!($sth = $dbh->do($command,@params))) {
+		setError("Error executing command '$command': ".$dbh->Error());
 		return undef;	
 	}
 
_______________________________________________
Users mailing list
[email protected]
http://lists.policyd.org/mailman/listinfo/users

Reply via email to