> -----Original Message-----
> From: Joost Kraaijeveld [mailto:J.Kraaijeveld@Askesis.nl]
> Sent: 08 February 2005 09:03
> To: Dave Page; pgsql-odbc@postgresql.org
> Subject: RE: [ODBC] New release
>
> If someone can help me with understanding what the ODCB
> driver is doing I can try to find the solution for my problem
> as mailed earlier. This is really a showstopper problem for
> my application, so I really would like it to finish within
> the next couple of days.
Basically the driver doesn't understand functions in the FROM clause of
a query, and just assumes they are relations in pg_class. The patch
below works around this by simply ignoring the token altogether if there
is a bracket following it. This isn't ideal, but then we currently
ignore functions in the select list anyway from what I can see.
If you need a .dll to test, please let me know. Barring any objections,
I'll apply this in a day or two.
Regards, Dave
Index: parse.c
===================================================================
RCS file: /usr/local/cvsroot/psqlodbc/psqlodbc/parse.c,v
retrieving revision 1.47
diff -u -r1.47 parse.c
--- parse.c 21 Jul 2004 12:29:58 -0000 1.47
+++ parse.c 8 Feb 2005 15:23:41 -0000
@@ -682,9 +682,28 @@
if (!dquote)
{
if (token[0] == '(' ||
- token[0] == ')')
+ token[0] == ')')
continue;
+
+ /*
+ * Detect a function call that
looks like a table, eg.
+ * SELECT * FROM version()
+ *
+ * This needs work to properly
handle functions found in the from
+ * clause, but this at least
prevents nasty errors for now.
+ *
+ * DJP, 2005-01-08
+ */
+ if (ptr[0] == '(')
+ {
+ mylog("**** got function
= '%s%s'\n", token, ptr);
+ mylog("FIXME: functions
in the FROM clause are currently ignored!!\n");
+ continue;
+ }
}
+
+
+
if (!(stmt->ntab % TAB_INCR))
{
ti = (TABLE_INFO **) realloc(ti,
(stmt->ntab + TAB_INCR) * sizeof(TABLE_INFO *));