Re: extend pgbench expressions with functions - Mailing list pgsql-hackers

From Robert Haas
Subject Re: extend pgbench expressions with functions
Date
Msg-id CA+TgmoYdKHk2qe22=_EXC8-0W6XO8c4v4sWL17UVV=hAVBFrfQ@mail.gmail.com
Whole thread Raw
In response to Re: extend pgbench expressions with functions  (Fabien COELHO <coelho@cri.ensmp.fr>)
Responses Re: extend pgbench expressions with functions
List pgsql-hackers
On Tue, Mar 8, 2016 at 3:52 PM, Fabien COELHO <coelho@cri.ensmp.fr> wrote:
> [ new patch and assorted color commentary ]

This is not acceptable:

+                               /* guess double type (n for "inf",
"-inf" and "nan") */
+                               if (strchr(var, '.') != NULL ||
strchr(var, 'n') != NULL)
+                               {
+                                       double dv;
+                                       sscanf(var, "%lf", &dv);
+                                       setDoubleValue(retval, dv);
+                               }
+                               else
+                                       setIntValue(retval, strtoint64(var));

That totally breaks the error handling which someone carefully established here.

+                               PgBenchValue *varg = & vargs[0];

Extra space.

+                               if (!coerceToDouble(st, & vargs[0], &dval))
+                                       return false;

Another extra space.

-       int                     nargs = 0;
-       int64           iargs[MAX_FARGS];
-       PgBenchExprLink *l = args;
+       int                                     nargs = 0;
+       PgBenchValue            vargs[MAX_FARGS];
+       PgBenchExprLink    *l = args;

Completely unnecessary reindentation of the first and third lines.

+                                       setIntValue(retval, i < 0? -i: i);

Not project style.

Please fix the whitespace damage git diff --check complains about, and
check for other places where you haven't followed project style.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: pgbench small bug fix
Next
From: Robert Haas
Date:
Subject: Re: silent data loss with ext4 / all current versions