pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ludek Finstrle <luf@pzkagis.cz>
To: pgsql-odbc@postgresql.org
Subject: ODBC driver failure
Date: Mon, 5 Dec 2005 16:16:46 +0100
Message-ID: <20051205151646.GA16162@soptik.pzkagis.cz> (raw)

Hello,

ODBC driver fail (raise exception) with these steps:
1) SQLPrepare (SELECT relname FROM pg_class WHERE relname != ?)
2) SQLExecute

I found the bug and fix it. Patch is attached.

Regards

Luf

Attachments:

psqlodbc-bindparam_count_error.diff (text/plain, 1.2K) download diff -c psqlodbc.orig\convert.c psqlodbc\convert.c *** psqlodbc.orig\convert.c Wed Nov 30 13:44:14 2005 --- psqlodbc\convert.c Mon Dec 05 17:17:11 2005 *************** *** 1860,1873 **** } if (marker_count > 0) { ! CVT_APPEND_CHAR(qb, '('); ! for (i = 0; i < marker_count; i++) { ! if (i > 0) ! CVT_APPEND_STR(qb, ", "); ! CVT_APPEND_STR(qb, pgtype_to_name(stmt, ipdopts->parameters[i].PGType)); } - CVT_APPEND_CHAR(qb, ')'); } CVT_APPEND_STR(qb, " as "); for (qp->opos = 0; qp->opos < qp->stmt_len; qp->opos++) --- 1860,1883 ---- } if (marker_count > 0) { ! if (ipdopts && (ipdopts->allocated == marker_count)) { ! CVT_APPEND_CHAR(qb, '('); ! for (i = 0; i < marker_count; i++) ! { ! if (i > 0) ! CVT_APPEND_STR(qb, ", "); ! CVT_APPEND_STR(qb, pgtype_to_name(stmt, ipdopts->parameters[i].PGType)); ! } ! CVT_APPEND_CHAR(qb, ')'); ! } ! else ! { ! SC_set_error(stmt, STMT_COUNT_FIELD_INCORRECT, "The # of binded parameters < the # of parameter markers"); ! SC_set_sqlstate(stmt, "07002"); ! QB_Destructor(qb); ! return SQL_ERROR; } } CVT_APPEND_STR(qb, " as "); for (qp->opos = 0; qp->opos < qp->stmt_len; qp->opos++)

view thread (8+ messages)  latest in thread

Message-ID: <20051205151646.GA16162@soptik.pzkagis.cz>
Permalink:  ../20051205151646.GA16162@soptik.pzkagis.cz/
Also on:    postgresql.org/message-id/20051205151646.GA16162@soptik.pzkagis.cz

 ·  · 

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: luf@pzkagis.cz
  Subject: Re: ODBC driver failure
  In-Reply-To: <20051205151646.GA16162@soptik.pzkagis.cz>
  References: <20051205151646.GA16162@soptik.pzkagis.cz>

* 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