Re: Add generate_series(numeric, numeric)
От | Ali Akbar |
---|---|
Тема | Re: Add generate_series(numeric, numeric) |
Дата | |
Msg-id | CACQjQLpHYymSnF4prwaJN3Wa9ppfEtDTqR0BNVuQ0FjeUgTVNw@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Add generate_series(numeric, numeric) (Marti Raudsepp <marti@juffo.org>) |
Ответы |
Re: Add generate_series(numeric, numeric)
|
Список | pgsql-hackers |
2014-10-06 22:51 GMT+07:00 Marti Raudsepp <marti@juffo.org>:
That's fine I think, it's just for tracking who made the changes in
the CommitFest app. What actually matters is what you write in the
"Author" field, which could contain all 3 names separated by commas.
Ok. Added to commitfest: https://commitfest.postgresql.org/action/patch_view?id=1591
> the one that tests values just before numeric overflow
Actually I don't know if that's too useful. I think you should add a
test case that causes an error to be thrown.
Actually i added the test case because in the code, when adding step into current for the last value, i expected it to overflow:
/* increment current in preparation for next iteration */
add_var(&fctx->current, &fctx->step, &fctx->current);
add_var(&fctx->current, &fctx->step, &fctx->current);
where in the last calculation, current is 9 * 10^131071. Plus 10^131071, it will be 10^131072, which i expected to overflow numeric type (in the doc, numeric's range is "up to 131072 digits before the decimal point").
In attached patch, i narrowed the test case to produce smaller result.
Also, I noticed that there are a few trailing spaces in the patch that
should be removed:
+generate_series_numeric(PG_FUNCTION_ARGS)
...
+ if (NUMERIC_IS_NAN(start_num) || NUMERIC_IS_NAN(finish_num))
...
+ if (PG_NARGS() == 3)
...
+ if (NUMERIC_IS_NAN(step_num))
Ah, didn't see it. Thanks. Fixed in this patch.
Regards,
--
Ali Akbar
Ali Akbar
Вложения
В списке pgsql-hackers по дате отправления: