From: Stefan Reiser <s.reiser@tu-braunschweig.de>
To: Kris Jurka <books@ejurka.com>
Cc: Dave Cramer <pg@fastcrypt.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: zelaine@amazon.com, pgsql-bugs@postgresql.org, List <pgsql-jdbc@postgresql.org>
Subject: Re: [BUGS] BUG #7766: Running a DML statement that affects more than 4 billion rows results in an exception
Date: Fri, 11 Jan 2013 18:36:02 +0100
Message-ID: <50F04D82.7020202@tu-braunschweig.de> (raw)
In-Reply-To: <alpine.BSO.2.00.1301111221410.28737@leary.csoft.net>
References: <E1Tlli5-0007tR-HO@wrigleys.postgresql.org>
<17929.1356108458@sss.pgh.pa.us>
<CADK3HH+JgxrrT7K7tbyHLT0pqqnmqQNoPC6keHV3uChRq1ah4w@mail.gmail.com>
<6059.1356121026@sss.pgh.pa.us>
<CADK3HHLaQ96jMrf4RLRpseADdFOwD0DxOp9xF4C2OiEOBzmroA@mail.gmail.com>
<50F03093.6060005@tu-braunschweig.de>
<CADK3HHJ+yARXuNY5SxSkhFuvQfkyrHYTsOhss6uASJ4A49JHfQ@mail.gmail.com>
<CADK3HH+o_RMO6DUv3H9j-Fd8drb2GrLr8aGTYpN06u_zxdtkCQ@mail.gmail.com>
<alpine.BSO.2.00.1301111221410.28737@leary.csoft.net>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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
--
Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-jdbc
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-jdbc@postgresql.org
Cc: s.reiser@tu-braunschweig.de, books@ejurka.com, pg@fastcrypt.com, tgl@sss.pgh.pa.us
Subject: Re: [BUGS] BUG #7766: Running a DML statement that affects more than 4 billion rows results in an exception
In-Reply-To: <50F04D82.7020202@tu-braunschweig.de>
References: <E1Tlli5-0007tR-HO@wrigleys.postgresql.org> <17929.1356108458@sss.pgh.pa.us> <CADK3HH+JgxrrT7K7tbyHLT0pqqnmqQNoPC6keHV3uChRq1ah4w@mail.gmail.com> <6059.1356121026@sss.pgh.pa.us> <CADK3HHLaQ96jMrf4RLRpseADdFOwD0DxOp9xF4C2OiEOBzmroA@mail.gmail.com> <50F03093.6060005@tu-braunschweig.de> <CADK3HHJ+yARXuNY5SxSkhFuvQfkyrHYTsOhss6uASJ4A49JHfQ@mail.gmail.com> <CADK3HH+o_RMO6DUv3H9j-Fd8drb2GrLr8aGTYpN06u_zxdtkCQ@mail.gmail.com> <alpine.BSO.2.00.1301111221410.28737@leary.csoft.net> <50F04D82.7020202@tu-braunschweig.de>
* 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