8 Commits

Author SHA1 Message Date
Mats Kindahl
777c599a34 Do not segfault on large histogram() parameters
There is a bug in `width_bucket()` causing an overflow and subsequent
NaN value as a result of dividing with `+inf`. The NaN value is
interpreted as an integer and hence generates an index out of range for
the buckets.

This commit fixes this by generating an error rather than
segfaulting for bucket indexes that are out of range.
2023-03-28 12:47:02 +02:00
Sven Klemm
6bce5da97b Fix segfault in ts_hist_sfunc
Since the number of buckets of the histogram function is an argument
to the function call it is possible to initialize the histogram
state with a lower number than actually needed in further calls
leading to a segfault. This patch changes the memory access to use
the number the state was initialized with instead of the number
passed to the call. This also changes the function to error when
the passed number differs from the initialized state.
2021-11-02 14:13:07 +01:00
Sven Klemm
6f4cfc8886 Add missing ORDER BY to flaky tests
Add missing ORDER BY clause to queries in histogram_test,
compression_hypertable, and continuous_aggs_refresh test.
2021-03-01 06:52:36 +01:00
Sven Klemm
f89fd07c5b Remove year from SQL file license text
This changes the license text for SQL files to be identical
with the license text for C files.
2019-01-13 23:30:22 +01:00
Joshua Lockerman
20ec6914c0 Add license headers to SQL files and test code 2018-10-29 13:28:19 -04:00
Erik Nordström
500563ffe5 Add support for PostgreSQL 10
The extension now works with PostgreSQL 10, while
retaining compatibility with version 9.6.

PostgreSQL 10 has numerous internal changes to functions and
APIs, which necessitates various glue code and compatibility
wrappers to seamlessly retain backwards compatiblity with older
versions.

Test output might also differ between versions. In particular,
the psql client generates version-specific output with `\d` and
EXPLAINs might differ due to new query optimizations. The test
suite has been modified as follows to handle these issues. First,
tests now use version-independent functions to query system
catalogs instead of using `\d`. Second, changes have been made to
the test suite to be able to verify some test outputs against
version-dependent reference files.
2017-11-10 09:44:20 +01:00
Matvey Arye
543a75f865 Refactor regression tests
This commit moves a lot of test setup logic to runner.sh. Also
passes the right commands to the regression infrastructure to create
appropriate users and run tests as a regular user.
2017-10-05 15:56:33 -04:00
Sarah Pan
6232f98edc Add histogram function.
A rebase with only minor modifications from commit e80720dd9b412a31d1079533323d0b01231926e3
2017-09-15 12:27:18 -04:00