pgsql: tablefunc: Reject negative number of tuples passed to normal_ran
В списке pgsql-committers по дате отправления:
| От | Peter Eisentraut |
|---|---|
| Тема | pgsql: tablefunc: Reject negative number of tuples passed to normal_ran |
| Дата | |
| Msg-id | E1khvp1-0002nB-An@gemulon.postgresql.org обсуждение |
| Список | pgsql-committers |
tablefunc: Reject negative number of tuples passed to normal_rand() The function converted the first argument i.e. the number of tuples to return into an unsigned integer which turns out to be huge number when a negative value is passed. This causes the function to take much longer time to execute. Instead, reject a negative value. (If someone really wants to generate many more result rows, they should consider adding a bigint or numeric variant.) While at it, improve SQL test to test the number of tuples returned by this function. Author: Ashutosh Bapat <ashutosh.bapat@2ndquadrant.com> Discussion: https://www.postgresql.org/message-id/CAG-ACPW3PUUmSnM6cLa9Rw4BEC5cEMKjX8Gogc8gvQcT3cYA1A@mail.gmail.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/f73999262ed6c40d9a7c3d7cccec7143d4d15287 Modified Files -------------- contrib/tablefunc/expected/tablefunc.out | 11 +++++++---- contrib/tablefunc/sql/tablefunc.sql | 4 +++- contrib/tablefunc/tablefunc.c | 9 ++++++++- 3 files changed, 18 insertions(+), 6 deletions(-)
В списке pgsql-committers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера