Skip site navigation (1) Skip section navigation (2)

Re: bug in info.c file - incorrect SQL

From: "Jim Holliday" <jholliday(at)aurigin(dot)com>
To: "Jim Holliday" <jholliday(at)aurigin(dot)com>,<pgsql-odbc(at)postgresql(dot)org>
Subject: Re: bug in info.c file - incorrect SQL
Date: 2002-12-30 22:36:42
Message-ID: 56510AAEF435D240958D1CE8C6B1770AE09401@mailc03.aurigin.com (view raw or flat)
Thread:
Lists: pgsql-odbc
For the ODBC driver psqlodbc.dll version 7.02.0003 there is an error in
the info.c.  In 2 places the SQL contains an alias in the FROM clause
for the pg_namespace table and then references the table in the where
clause.  The below cut from the info.c file should replace all instances
on pg_namespace. in the where clause with pn.

	This should be done in both places.
	I modified this code, but was unable to compile a new version of
the odbc driver.
	 
	When you re-compile, could you reply email to me please.
	Thanks
	 
	>    sprintf(tables_query, "SELECT pt.tgargs, "
	>     "  pt.tgnargs, "
	>     "  pt.tgdeferrable, "
	>     "  pt.tginitdeferred, "
	>     "  pp1.proname, "
	>     "  pp2.proname, "
	>     "  pc.oid, "
	>     "  pc1.oid, "
	>     "  pc1.relname, "
	>     "  pn.nspname "
	>     "FROM pg_class pc, "
	>     "  pg_proc pp1, "
	>     "  pg_proc pp2, "
	>     "  pg_trigger pt1, "
	>     "  pg_trigger pt2, "
	>     "  pg_proc pp, "
	>     "  pg_trigger pt, "
	>     "  pg_class pc1, "
	>     "  pg_namespace pn "
	>     "WHERE pt.tgrelid = pc.oid "
	>     "AND pp.oid = pt.tgfoid "
	>     "AND pt1.tgconstrrelid = pc.oid "
	>     "AND pp1.oid = pt1.tgfoid "
	>     "AND pt2.tgfoid = pp2.oid "
	>     "AND pt2.tgconstrrelid = pc.oid "
	>     "AND ((pc.relname='%s') "
	>     "AND (pg_namespace.oid = pc.relnamespace) "
	>     "AND (pg_namespace.nspname = '%s') "
	>     "AND (pp.proname LIKE '%%ins') "
	>     "AND (pp1.proname LIKE '%%upd') "
	>     "AND (pp2.proname LIKE '%%del') "
	>     "AND (pt1.tgrelid=pt.tgconstrrelid) "
	>     "AND (pt1.tgconstrname=pt.tgconstrname) "
	>     "AND (pt2.tgrelid=pt.tgconstrrelid) "
	>     "AND (pt2.tgconstrname=pt.tgconstrname) "
	>     "AND (pt.tgconstrrelid=pc1.oid) "
	>     "AND (pc1.relnamespace=pn.oid))",
	>     fk_table_needed, schema_needed);
	>   }
	


Attachment: winmail.dat
Description: application/ms-tnef (5.6 KB)

Responses

pgsql-odbc by date

Next:From: Martin_HurstDate: 2002-12-31 14:06:18
Subject: ODBC - adding missing FROM clause entry
Previous:From: Hiroshi InoueDate: 2002-12-28 00:24:58
Subject: Re: Crash when calling SQLSetDescField

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group