Re: pgbench's expression parsing & negative numbers

2018-09-27 Thread Andres Freund
Hi, On 2018-09-26 22:38:41 +0200, Fabien COELHO wrote: > > > +"9223372036854775808" { > > > + /* yuk: special handling for minint */ > > > + return MAXINT_PLUS_ONE_CONST; > > > + } > > > > Yikes, do we really

Re: pgbench's expression parsing & negative numbers

2018-09-26 Thread Fabien COELHO
Hello Andres, +"9223372036854775808" { + /* yuk: special handling for minint */ + return MAXINT_PLUS_ONE_CONST; + } Yikes, do we really need this? If we dealt with - in the lexer, we sh

Re: pgbench's expression parsing & negative numbers

2018-09-26 Thread Andres Freund
Hi, On 2018-08-10 10:24:29 +0200, Fabien COELHO wrote: > diff --git a/src/bin/pgbench/exprscan.l b/src/bin/pgbench/exprscan.l > index 5c1bd88128..e8faea3857 100644 > --- a/src/bin/pgbench/exprscan.l > +++ b/src/bin/pgbench/exprscan.l > @@ -191,16 +191,26 @@ notnull [Nn][Oo][Tt][Nn]

Re: pgbench's expression parsing & negative numbers

2018-08-16 Thread Andres Freund
Hi, On 2018-08-16 17:28:06 +0200, Fabien COELHO wrote: > > The new status of this patch is: Ready for Committer > > Ok, thanks. Let's see what committers think about it. > > Andres, are you still interested in overflow detection and handling? Yes. I'll try to look at it at some point not too f

Re: pgbench's expression parsing & negative numbers

2018-08-16 Thread Fabien COELHO
Hello Ibrar, The new status of this patch is: Ready for Committer Ok, thanks. Let's see what committers think about it. Andres, are you still interested in overflow detection and handling? -- Fabien.

Re: pgbench's expression parsing & negative numbers

2018-08-16 Thread Ibrar Ahmed
Patch is good to go from my side. The new status of this patch is: Ready for Committer

Re: pgbench's expression parsing & negative numbers

2018-08-10 Thread Fabien COELHO
Hello, The following review has been posted through the commitfest application: make installcheck-world: not tested Implements feature: tested, passed Spec compliant: tested, passed Documentation:not tested Patch does not apply cleanly on the master branch, anyways

Re: pgbench's expression parsing & negative numbers

2018-08-08 Thread Ibrar Ahmed
The following review has been posted through the commitfest application: make installcheck-world: not tested Implements feature: tested, passed Spec compliant: tested, passed Documentation:not tested Patch does not apply cleanly on the master branch, anyways I managed

Re: pgbench's expression parsing & negative numbers

2018-07-19 Thread Fabien COELHO
I'll come up with a patch for that sometime soon. ISTM that you have not sent any patch on the subject, otherwise I would have reviewed it. Maybe I could do one some time later, unless you think that I should not. Here is a patch which detects pgbench overflows on int & double constants,

Re: pgbench's expression parsing & negative numbers

2018-07-13 Thread Fabien COELHO
Hello Andres, I'll come up with a patch for that sometime soon. ISTM that you have not sent any patch on the subject, otherwise I would have reviewed it. Maybe I could do one some time later, unless you think that I should not. Here is a patch which detects pgbench overflows on int & doub

Re: pgbench's expression parsing & negative numbers

2018-03-07 Thread Fabien COELHO
Hello Andres, working on overflow correctness in pg I noticed that pgbench isn't quite there. Indeed. I assume it won't matter terribly often, but the way it parses integers makes it incorrect for, at least, the negativemost number. [...] but that unfortunately means that the sign is no in

Re: pgbench's expression parsing & negative numbers

2017-12-14 Thread Fabien COELHO
Hello, - I do not think that updating pgbench arithmetic for managing integer overflows is worth Andres Freund time. My guess is that most script would not trigger client-side overflows, so the change would be a no-op in practice. It might not be if you view it in isolation (althoug

Re: pgbench's expression parsing & negative numbers

2017-12-14 Thread Andres Freund
Hi, On 2017-12-14 10:41:04 +0100, Fabien COELHO wrote: > - I do not think that updating pgbench arithmetic for managing integer >overflows is worth Andres Freund time. My guess is that most >script would not trigger client-side overflows, so the change would >be a no-op in practice.

Re: pgbench's expression parsing & negative numbers

2017-12-14 Thread Fabien COELHO
Hello Andres, There are some overflow checking with div and double to int cast, which were added because of previous complaints, but which are not very useful to me. I think handling it inconsistently is the worst of all worlds. Hmmm... I cannot say that inconsistency is a good thing, that

Re: pgbench's expression parsing & negative numbers

2017-12-12 Thread Andres Freund
On 2017-12-12 07:21:21 +0100, Fabien COELHO wrote: > > Hello Andres, > > > working on overflow correctness in pg I noticed that pgbench isn't quite > > there. I assume it won't matter terribly often, but the way it parses > > integers makes it incorrect for, at least, the negativemost number. >

Re: pgbench's expression parsing & negative numbers

2017-12-11 Thread Fabien COELHO
Hello Andres, working on overflow correctness in pg I noticed that pgbench isn't quite there. I assume it won't matter terribly often, but the way it parses integers makes it incorrect for, at least, the negativemost number. It directly parses the integer input using: {digit}+

pgbench's expression parsing & negative numbers

2017-12-11 Thread Andres Freund
Hi, working on overflow correctness in pg I noticed that pgbench isn't quite there. I assume it won't matter terribly often, but the way it parses integers makes it incorrect for, at least, the negativemost number. It directly parses the integer input using: {digit}+{