Patch for DBD-Pg-0.69..

From: Michael J Schout <mschout(at)gkg(dot)net>
To: questions(at)postgresql(dot)org, hackers(at)postgresql(dot)org
Subject: Patch for DBD-Pg-0.69..
Date: 1998-04-16 01:46:01
Message-ID: 353562D9.9666387E@gkg.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi everyone.

I have made a patch to DBD-Pg-0.69 so that queries that contain the
casing operator "::" work with DBD::Pg v0.69. Without this patch, any
query with teh casting operator in it will not run. I could not wait
for a fix from the author for this, so I made the change myself.
Anyways, in case anyone else is strugling with this, the following patch
made against DBD-Pg-0.69 seems to do the trick for me.

Thought I would post this up in case anyone else would like to try it.

Mike
diff -uNr DBD-Pg-0.69.orig/dbdimp.c DBD-Pg-0.69/dbdimp.c
--- DBD-Pg-0.69.orig/dbdimp.c Fri Mar 6 15:58:50 1998
+++ DBD-Pg-0.69/dbdimp.c Wed Apr 15 20:37:15 1998
@@ -447,6 +447,19 @@
*dest++ = *src++;
continue;
}
+
+ /*
+ * The above loop will not copy "::" for casting. This
+ * works around that by copying a colon if it followed by or
+ * is preceded by another colon.
+ * Michael schout, 4/15/1998 (mschout(at)gkg(dot)net)
+ */
+ if (*src == ':' && (*(src-1) == ':' || *(src+1) == ':'))
+ {
+ *dest++ = *src++;
+ continue;
+ }
+
start = dest; /* save name inc colon */
*dest++ = *src++;
if (*start == '?') { /* X/Open standard */

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1998-04-16 03:55:25 HAVING clause and 6.3.2 release
Previous Message Tom Lane 1998-04-15 21:38:31 Re: [HACKERS] Anyone working on asynchronous NOTIFY reception?