Re: extend pgbench expressions with functions
От | Fabien COELHO |
---|---|
Тема | Re: extend pgbench expressions with functions |
Дата | |
Msg-id | alpine.DEB.2.10.1603090822170.25393@sto обсуждение исходный текст |
Ответ на | Re: extend pgbench expressions with functions (Robert Haas <robertmhaas@gmail.com>) |
Ответы |
Re: extend pgbench expressions with functions
|
Список | pgsql-hackers |
Hello Robert, Here is a v35 b & c. > 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. I'm not sure what is "not acceptable" as it "totally breaks the error handling" in the above code. I assumed that you want to check that sscanf can read what sprintf generated when handling "\set". I'd guess that libc would be broken if it was the case. I've made pgbench check that it is not. If it was something else, you have to spell it out for me. > Extra space. [...] Another extra space. Indeed. > - 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. It just looked better to me. > + setIntValue(retval, i < 0? -i: i); > > Not project style. Indeed. > Please fix the whitespace damage git diff --check complains about, "git diff -check" does not seem to complain on the full v35-b. > and check for other places where you haven't followed project style. I've found some more instances of "& ref". -- Fabien.
В списке pgsql-hackers по дате отправления: