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

Re: CommitFest status summary 2010-01-27

From: Boszormenyi Zoltan <zb(at)cybertec(dot)at>
To: Greg Smith <greg(at)2ndquadrant(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: CommitFest status summary 2010-01-27
Date: 2010-02-11 12:13:24
Message-ID: 4B73F464.8050506@cybertec.at (view raw or flat)
Thread:
Lists: pgsql-hackers
Hi,

Boszormenyi Zoltan írta:
> Greg Smith írta:
>   
>> 4) Investigate and be explicit about the potential breakage here both
>> for libpq clients and at least one additional driver too.  If I saw a
>> demonstration that this didn't break the JDBC driver, for example, I'd
>> feel a lot better about the patch.
>>     
> ... (JDBC discussed to be non-vulnerable)
> The question is whether new versions of psqlODBC and the old
> ones shipped in unixODBC handle the change well.
>   

I looked at the unixODBC PG driver sources. Both the "old" and "new"
versions return rowcount for STMT_TYPE_SELECT as the number of
tuples returned, it doesn't look at the command status. But they both seems
to be broken for INSERTs, as the source interprets the number found
after the first ' ' (space) character, they would return 0 for WITHOUT OIDS
case. I am talking about these files:
    unixODBC-x.y.z/Drivers/PostgreSQL/results.c
    unixODBC-x.y.z/Drivers/Postgre7.1/results.c
Look at the SQLRowCount() function.

The current psqlODBC driver versions do it in a similar way.
They don't look at the actual command tag, if there is a space character
in the command status string after trimming it, the string after the space
gets interpreted with atoi(). This code also ignores that INSERT returns
2 values, the first value will be returned for rowcount.

This means that the more recent ODBC drivers seem to start returning
rowcount for utility SELECTs with this protocol change.
I haven't tested it though.

So, the latest JDBC won't change behaviour without code changes,
ODBC may or may not, depending on the version.

Best regards,
Zoltán Böszörményi

-- 
Bible has answers for everything. Proof:
"But let your communication be, Yea, yea; Nay, nay: for whatsoever is more
than these cometh of evil." (Matthew 5:37) - basics of digital technology.
"May your kingdom come" - superficial description of plate tectonics

----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
http://www.postgresql.at/


In response to

pgsql-hackers by date

Next:From: Heikki LinnakangasDate: 2010-02-11 12:20:01
Subject: Re: Parameter name standby_mode
Previous:From: Bart SamwelDate: 2010-02-11 12:09:33
Subject: Re: Avoiding bad prepared-statement plans.

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