Re: [BUGS] BUG #7766: Running a DML statement that affects more than 4 billion rows results in an exception

From: Stefan Reiser <s(dot)reiser(at)tu-braunschweig(dot)de>
To: Kris Jurka <books(at)ejurka(dot)com>
Cc: Dave Cramer <pg(at)fastcrypt(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, zelaine(at)amazon(dot)com, pgsql-bugs(at)postgresql(dot)org, List <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: [BUGS] BUG #7766: Running a DML statement that affects more than 4 billion rows results in an exception
Date: 2013-01-11 17:36:02
Message-ID: 50F04D82.7020202@tu-braunschweig.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-jdbc

Kris Jurka schrieb:
>
> On Fri, 11 Jan 2013, Dave Cramer wrote:
>
>> Ok, I've pushed this fix into master
>>
> You've made any failure to parse the affected row count return
> SUCCESS_NO_INFO. Shouldn't you change the integer parsing to a long
> parsing and only modify the response if the value is > INT_MAX while still
> throwing an exception if we get something that is truly undecipherable?
>
> Kris Jurka
>
>
Dave,
I'm completely unfamiliar with the driver's code, so I better won't take
part in the further discussion -- just one thing: Now "insert_oid" won't
be assigned correctly when the assignment of update_count fails:

[QueryExecutorImpl.java]
try
{
update_count = Integer.parseInt(status.substring(1 +
status.lastIndexOf(' ')));
if (status.startsWith("INSERT"))
insert_oid = Long.parseLong(status.substring(1 +
status.indexOf(' '),
status.lastIndexOf(' ')));
}
catch (NumberFormatException nfe)
{
update_count=Statement.SUCCESS_NO_INFO;
}

better be something like this: ?

try
{
update_count = Integer.parseInt(status.substring(1 +
status.lastIndexOf(' ')));
}
catch (NumberFormatException nfe)
{
update_count=Statement.SUCCESS_NO_INFO;
}
try {
if (status.startsWith("INSERT"))
insert_oid = Long.parseLong(status.substring(1 +
status.indexOf(' '),
status.lastIndexOf(' ')));
} catch ( ...
// don't know what expected behaviour should be ...
}

regards
Stefan Reiser

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Dave Cramer 2013-01-11 18:03:19 Re: [JDBC] BUG #7766: Running a DML statement that affects more than 4 billion rows results in an exception
Previous Message Kris Jurka 2013-01-11 17:23:18 Re: [BUGS] BUG #7766: Running a DML statement that affects more than 4 billion rows results in an exception

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2013-01-11 18:03:19 Re: [JDBC] BUG #7766: Running a DML statement that affects more than 4 billion rows results in an exception
Previous Message Kris Jurka 2013-01-11 17:23:18 Re: [BUGS] BUG #7766: Running a DML statement that affects more than 4 billion rows results in an exception