Re: extend pgbench expressions with functions
От | Robert Haas |
---|---|
Тема | Re: extend pgbench expressions with functions |
Дата | |
Msg-id | CA+TgmoYdKHk2qe22=_EXC8-0W6XO8c4v4sWL17UVV=hAVBFrfQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: extend pgbench expressions with functions (Fabien COELHO <coelho@cri.ensmp.fr>) |
Ответы |
Re: extend pgbench expressions with functions
|
Список | 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 по дате отправления: