On Thu, 22 May 2003 =?iso-8859-1?Q?innuendo-nh@libero.it?= wrote:
> I have just found a bug in the latest jdbc driver.
>
> The error is in the class org.postgresql.jdbc2.AbstractJdbc2ResultSet
>
> the method parseQuery() has a bug:
There are a number of problems with this method. It is a very simple
function trying to do a very complicated task. I noted this in
the following message in December...
What could really use some work is the parseQuery method in
org.postgresql.jdbc2.AbstractJdbc2ResultSet. When determining if a
ResultSet can be updated it does not check that all colums of the result
set aren't derived columns. The check to make sure it is a single table
is not particularly good. It fails on things like:
SELECT CURRENT_TIMESTAMP;
SELECT a AS from FROM t;
SELECT a FROM t1 LEFT JOIN t2 ON (t1.id=t2.id);
SELECT a FROM t1 UNION SELECT a FROM t2;
I'm not sure how much this can be improved without building a full blown
parser into the driver.