Re: New release

From: "Dave Page" <dpage(at)vale-housing(dot)co(dot)uk>
To: "Joost Kraaijeveld" <J(dot)Kraaijeveld(at)Askesis(dot)nl>, <pgsql-odbc(at)postgresql(dot)org>
Subject: Re: New release
Date: 2005-02-08 15:25:49
Message-ID: E7F85A1B5FF8D44C8A1AF6885BC9A0E45289B4@ratbert.vale-housing.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

> -----Original Message-----
> From: Joost Kraaijeveld [mailto:J(dot)Kraaijeveld(at)Askesis(dot)nl]
> Sent: 08 February 2005 09:03
> To: Dave Page; pgsql-odbc(at)postgresql(dot)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 *));

Browse pgsql-odbc by date

  From Date Subject
Next Message Justin Cranford 2005-02-08 16:47:08 v07.03.0200: Make errors if configured --with-odbcver=0x0100
Previous Message Joost Kraaijeveld 2005-02-08 09:02:46 Re: New release