postgresql/contrib/tablefunc
Peter Eisentraut f73999262e 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
2020-11-25 15:30:18 +01:00
..
data Have crosstab variants treat NULL rowid as a category in its own right, 2007-11-10 05:00:41 +00:00
expected tablefunc: Reject negative number of tuples passed to normal_rand() 2020-11-25 15:30:18 +01:00
sql tablefunc: Reject negative number of tuples passed to normal_rand() 2020-11-25 15:30:18 +01:00
.gitignore Support "make check" in contrib 2011-04-25 22:27:11 +03:00
Makefile Remove support for upgrading extensions from "unpackaged" state. 2020-02-19 16:59:14 -05:00
tablefunc--1.0.sql Throw a useful error message if an extension script file is fed to psql. 2011-10-12 15:45:03 -04:00
tablefunc.c tablefunc: Reject negative number of tuples passed to normal_rand() 2020-11-25 15:30:18 +01:00
tablefunc.control Mark some contrib modules as "trusted". 2020-02-13 15:02:35 -05:00
tablefunc.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00