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

2013-01-12 Thread Vitalii Tymchyshyn
It's -2, see http://docs.oracle.com/javase/1.4.2/docs/api/constant-values.html#java.sql.Statement.SUCCESS_NO_INFO 2013/1/12 Dave Cramer > Well my bet is the actual value of Statement.SUCCESS_NO_INFO is negative. > My understanding of the code is that it will not throw the exception unless > the

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

2013-01-12 Thread Dave Cramer
Well my bet is the actual value of Statement.SUCCESS_NO_INFO is negative. My understanding of the code is that it will not throw the exception unless there is a real parse error. Dave Dave Cramer dave.cramer(at)credativ(dot)ca http://www.credativ.ca On Sat, Jan 12, 2013 at 5:06 AM, Péter Kovác

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

2013-01-12 Thread Péter Kovács
But being designed for batch updates, is Statement.SUCCESS_NO_INFO appropriate in the context of plain updates? I think the value of Statement.SUCCESS_NO_INFO is supposed to be opaque. What if it happens to be 3, for example? Client code will think three rows have been affected. Conversely, if you

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

2013-01-12 Thread Dave Cramer
Well since it returns an int and it's impossible to return > 2^32 in an int then we will be returning Statement.SUCCESS_NO_INFO Dave Dave Cramer dave.cramer(at)credativ(dot)ca http://www.credativ.ca On Sat, Jan 12, 2013 at 4:27 AM, Péter Kovács wrote: > I mean what value this method will retu

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

2013-01-12 Thread Péter Kovács
I mean what value this method will return for an update statement affecting, say, five billion rows? But I may misunderstand something. On Jan 12, 2013 9:57 AM, "Dave Cramer" wrote: > Peter, > > Can you be more specific about your concerns ? > > Dave > > Dave Cramer > > dave.cramer(at)credativ(do

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

2013-01-12 Thread Dave Cramer
Peter, Can you be more specific about your concerns ? Dave Dave Cramer dave.cramer(at)credativ(dot)ca http://www.credativ.ca On Sat, Jan 12, 2013 at 3:25 AM, Péter Kovács wrote: > And what about > http://docs.oracle.com/javase/6/docs/api/java/sql/Statement.html#getUpdateCount()? > > P. > On

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

2013-01-12 Thread Péter Kovács
And what about http://docs.oracle.com/javase/6/docs/api/java/sql/Statement.html#getUpdateCount()? P. On Jan 11, 2013 2:20 PM, "Dave Cramer" wrote: > Ok, this is much more difficult than I thought. > > Turns out that there are at least two interfaces that expect an int not a > long. > > BatchUpda

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

2013-01-11 Thread Dave Cramer
Good points to both. Thank you both for reviewing. Dave Dave Cramer dave.cramer(at)credativ(dot)ca http://www.credativ.ca On Fri, Jan 11, 2013 at 12:36 PM, Stefan Reiser wrote: > Kris Jurka schrieb: > > >> On Fri, 11 Jan 2013, Dave Cramer wrote: >> >> Ok, I've pushed this fix into master >

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

2013-01-11 Thread Stefan Reiser
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

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

2013-01-11 Thread Kris Jurka
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 thr

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

2013-01-11 Thread Kris Jurka
On Fri, 11 Jan 2013, Stefan Reiser wrote: > What about returning Statement.SUCCESS_NO_INFO as it says in > http://docs.oracle.com/javase/6/docs/api/java/sql/BatchUpdateException.html#getUpdateCounts%28%29 > and > http://docs.oracle.com/javase/6/docs/api/java/sql/Statement.html#executeBatch%28%29

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

2013-01-11 Thread Dave Cramer
Ok, I've pushed this fix into master On Fri, Jan 11, 2013 at 10:38 AM, Dave Cramer wrote: > SUCCESS_NO_INFO Dave Cramer dave.cramer(at)credativ(dot)ca http://www.credativ.ca

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

2013-01-11 Thread Dave Cramer
Yes, that seems like a much better approach. I'm guessing SUCCESS_NO_INFO is < 0 and an int. I can't wait for the error reports (arguments) Dave Dave Cramer dave.cramer(at)credativ(dot)ca http://www.credativ.ca On Fri, Jan 11, 2013 at 10:32 AM, Stefan Reiser wrote: > One thought: > > What ab

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

2013-01-11 Thread Stefan Reiser
One thought: What about returning Statement.SUCCESS_NO_INFO as it says in http://docs.oracle.com/javase/6/docs/api/java/sql/BatchUpdateException.html#getUpdateCounts%28%29 and http://docs.oracle.com/javase/6/docs/api/java/sql/Statement.html#executeBatch%28%29 ? It seems better to report no numb

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

2013-01-11 Thread Dave Cramer
Ok, this is much more difficult than I thought. Turns out that there are at least two interfaces that expect an int not a long. BatchUpdateException executeBatch I'm thinking the only option here is to report INT_MAX as opposed to failing. Thoughts ? Dave Dave Cramer dave.cramer(at)credativ

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

2012-12-21 Thread Tom Lane
Dave Cramer writes: > So an unsigned long won't fit inside a java long either, but hopefully it > will never be necessary. That would be a huge number of changes. I think we'll all be safely dead by the time anybody manages to process 2^63 rows in one PG command ;-). If you can widen the value f

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

2012-12-21 Thread Dave Cramer
Thanks Tom. So an unsigned long won't fit inside a java long either, but hopefully it will never be necessary. That would be a huge number of changes. Dave Dave Cramer dave.cramer(at)credativ(dot)ca http://www.credativ.ca On Fri, Dec 21, 2012 at 11:47 AM, Tom Lane wrote: > zela...@amazon.c

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

2012-12-21 Thread Tom Lane
zela...@amazon.com writes: > The following bug has been logged on the website: > Bug reference: 7766 > Logged by: Zelaine Fong > Email address: zela...@amazon.com > PostgreSQL version: 8.4.0 > Operating system: Linux > Description: > The updateCount field in the Result

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

2012-12-21 Thread zelaine
The following bug has been logged on the website: Bug reference: 7766 Logged by: Zelaine Fong Email address: zela...@amazon.com PostgreSQL version: 8.4.0 Operating system: Linux Description: The updateCount field in the ResultHandler interface in Java is defined as an