From: Heikki Linnakangas <hlinnakangas@vmware.com>
To: Faith, Jeremy <jfaith@tycoint.com>
To: pgsql-odbc@postgresql.org <pgsql-odbc@postgresql.org>
Subject: Re: SQL_CURSOR_TYPE prepare execute issue
Date: Fri, 16 Jan 2015 23:24:49 +0200
Message-ID: <54B981A1.9090808@vmware.com> (raw)
In-Reply-To: <55BAADA01D8C504993894EAEA7517CF80D94E0@003FCH1MPN2-002.003f.mgd2.msft.net>
References: <55BAADA01D8C504993894EAEA7517CF80D07AD@003FCH1MPN2-002.003f.mgd2.msft.net>
<54B5A38B.4030306@vmware.com>
<55BAADA01D8C504993894EAEA7517CF80D08BD@003FCH1MPN2-002.003f.mgd2.msft.net>
<54B79C0A.8010703@vmware.com>
<55BAADA01D8C504993894EAEA7517CF80D103F@003FCH1MPN2-002.003f.mgd2.msft.net>
<54B7E3B7.4030707@vmware.com>
<55BAADA01D8C504993894EAEA7517CF80D94E0@003FCH1MPN2-002.003f.mgd2.msft.net>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-odbc>
On 01/16/2015 09:21 PM, Faith, Jeremy wrote:
> Don't worry about the '-1' test I was just trying to determine, in the server side prepare case, if it was adding quotes i.e. the string I was supplying already had single quotes and was not accepted.
>
> I've had a quick look at the new patches.
>
> patch 0001
> To be extra extra careful maybe valid_int_literal() should check 'len' before accessing the first byte and second bytes of 'str' in case len is 0 or 1. This may not be necessary it depends on where 'str' comes from.
Ah, you're right. Fixed.
> Otherwise the patch looks fine but maybe you should add a couple of test cases for SQL_SMALLINT.
Added.
> patch 0002
> In convert.c you have added the comment and line
> /* XXX: should we use param_pgtype here instead? */
> *pgType = sqltype_to_bind_pgtype(conn, param_sqltype);
> this really requires someone with more in depth knowledge than I have.
I don't fully understand that either. It's not clear to me when
param_pgtype is set, and where the value comes from. I decided to ignore
it for now, which makes on which datatype is chosen simpler, and I think
is closer to the old behaviour.
> Again maybe a couple of test cases for SQL_SMALLINT.
Added.
> I have done a few very quick tests myself and have not found anything wrong so far.
>
> Looks like I opened up a can of worms here, oops, but the end result should be more secure and more consistent with regards to the server side and client side prepare behaviour, which is good. Also your helping people out by forcing integer comparison more often.
> I will try to do some more testing next week.
Thanks, I've pushed these changes now.
- Heikki
--
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc
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: hlinnakangas@vmware.com, jfaith@tycoint.com
Subject: Re: SQL_CURSOR_TYPE prepare execute issue
In-Reply-To: <54B981A1.9090808@vmware.com>
References: <55BAADA01D8C504993894EAEA7517CF80D07AD@003FCH1MPN2-002.003f.mgd2.msft.net> <54B5A38B.4030306@vmware.com> <55BAADA01D8C504993894EAEA7517CF80D08BD@003FCH1MPN2-002.003f.mgd2.msft.net> <54B79C0A.8010703@vmware.com> <55BAADA01D8C504993894EAEA7517CF80D103F@003FCH1MPN2-002.003f.mgd2.msft.net> <54B7E3B7.4030707@vmware.com> <55BAADA01D8C504993894EAEA7517CF80D94E0@003FCH1MPN2-002.003f.mgd2.msft.net> <54B981A1.9090808@vmware.com>
* 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