pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Shachar Shemesh <psql@shemesh.biz>
To: Hiroshi Inoue <Inoue@tpf.co.jp>
Cc: pgsql-odbc@postgresql.org
Subject: Re: A few problems with the ODBC driver
Date: Wed, 02 Jul 2003 16:43:16 +0300 (IDT)
Message-ID: <1057153396.3f02e17478739@latenight.fiasco.org.il> (raw)

Quoting Hiroshi Inoue <Inoue@tpf.co.jp>:

> Maybe I found a cause.
> Please try the snapshot dll at 
> 	http://www.geocities.jp/inocchichichi/psqlodbc/ .
> 
I found the cause of the problem.

The SQLExecute command constructs a query in order to find the table. It forgot
to double quote the table name. As all the table names in my database are
uppercase, this caused the query to fail (PGSQL converts all unquoted ids to
lowercase), and the recordset was marked readonly.

Attached is a patch that fixes this problem. Forgive me if this is the wrong
place to post it. Let me know where I should post it.

                 Shachar

Attachments:

execute.diff (application/octet-stream, 667B) download Index: parse.c =================================================================== RCS file: /usr/local/cvsroot/psqlodbc/psqlodbc/parse.c,v retrieving revision 1.42 diff -u -r1.42 parse.c --- parse.c 23 Apr 2003 09:49:47 -0000 1.42 +++ parse.c 2 Jul 2003 13:37:44 -0000 @@ -927,7 +927,7 @@ * We also have to check as follows. */ sprintf(token, "select nspname from pg_namespace n, pg_class c" - " where c.relnamespace=n.oid and c.oid='%s'::regclass", ti[i]->name); + " where c.relnamespace=n.oid and c.oid='\"%s\"'::regclass", ti[i]->name); res = CC_send_query(conn, token, NULL, CLEAR_RESULT_ON_ABORT); if (res) {

view thread (7+ messages)

Message-ID: <1057153396.3f02e17478739@latenight.fiasco.org.il>
Permalink:  ../1057153396.3f02e17478739@latenight.fiasco.org.il/
Also on:    postgresql.org/message-id/1057153396.3f02e17478739@latenight.fiasco.org.il

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: psql@shemesh.biz, Inoue@tpf.co.jp
  Subject: Re: A few problems with the ODBC driver
  In-Reply-To: <1057153396.3f02e17478739@latenight.fiasco.org.il>
  References: <1057153396.3f02e17478739@latenight.fiasco.org.il>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox