2013-09-14 17:12:10 +00:00
|
|
|
$OpenBSD: patch-src_pgsql_drv_c,v 1.7 2013/09/14 17:12:13 landry Exp $
|
|
|
|
chunk 2; fix runtime w/ pg > 9.1
|
|
|
|
from http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=694942
|
|
|
|
http://sourceforge.net/p/dspam/bug-tracker/141/
|
|
|
|
chunk1: http://sourceforge.net/p/dspam/bug-tracker/112/
|
|
|
|
--- src/pgsql_drv.c.orig Wed Apr 11 20:48:33 2012
|
|
|
|
+++ src/pgsql_drv.c Fri Sep 6 10:37:25 2013
|
|
|
|
@@ -1537,7 +1537,7 @@ _ds_set_signature (DSPAM_CTX * CTX, struct _ds_spam_si
|
|
|
|
}
|
2008-12-11 00:46:01 +00:00
|
|
|
|
|
|
|
snprintf (scratch, sizeof (scratch),
|
2013-09-14 17:12:10 +00:00
|
|
|
- "INSERT INTO dspam_signature_data (uid,signature,length,created_on,data) VALUES (%d,'%s',%lu,CURRENT_DATE,'",
|
|
|
|
+ "INSERT INTO dspam_signature_data (uid,signature,length,created_on,data) VALUES (%d,'%s',%lu,CURRENT_DATE, E'",
|
|
|
|
(int) p->pw_uid, sig_esc, (unsigned long) SIG->length);
|
|
|
|
free(sig_esc);
|
2008-12-11 00:46:01 +00:00
|
|
|
buffer_cat (query, scratch);
|
2013-09-14 17:12:10 +00:00
|
|
|
@@ -3082,6 +3082,12 @@ PGconn *_pgsql_drv_connect(DSPAM_CTX *CTX)
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
+ if (PQserverVersion(dbh) >= 90100)
|
|
|
|
+ {
|
|
|
|
+ PGresult *result = PQexec(dbh, "SET standard_conforming_strings TO off;");
|
|
|
|
+ if (result)
|
|
|
|
+ PQclear(result);
|
|
|
|
+ }
|
|
|
|
return dbh;
|
2005-10-26 06:18:38 +00:00
|
|
|
|
2013-09-14 17:12:10 +00:00
|
|
|
FAILURE:
|