27 Commits

Author SHA1 Message Date
Sven Klemm
b95e93a651 Run regresscheck-shared on PG13
This patch enables the regresscheck-shared testsuite to run on PG13
2021-02-10 12:59:39 +01:00
Erik Nordström
36c1cd849a Fix corruption in gapfill plan
This change fixes a bug with gapfill that caused certain query plans
to fail with the error "could not find pathkey item to sort". This was
caused by a corruption in the query plan which happened as a result of
removing the last two arguments to the `time_bucket_gapfill` function
expression during query planning. Since the function expression was
modified via a reference to the original query plan tree, it affected
also the expression in the target list. When the planner couldn't
match the target list with the corresponding equivalence member (which
still included the two removed arguments), the error was generated.

The original reason for removing the two arguments was to avoid
passing them on to `time_bucket`, which is called internally by
`time_bucket_gapfill`. However, the last to arguments aren't passed on
anyway, so it isn't necessary to modify the original argument list.

Fixes #2232
2021-01-27 23:41:54 +01:00
Mats Kindahl
b1dc0305d3 Fix path to dist_gapfill
The `TEST_OUTPUT_DIR` for shared tests `dist_gapfill` is incorrect
inside the test file (when called from `pg_regress`) because
`TEST_OUTPUT_DIR` is set to the parent directory rather than the
subdirectory.

This commit fixes the paths in `dist_gapfill`.
2021-01-22 22:18:18 +01:00
Ruslan Fomkin
3448bcf2af Move gapfill tests into using shared database 2020-12-15 13:16:53 +01:00
Mats Kindahl
9b5f20dd74 Fix ABI check build dependencies and tests
Some tests contain code that only work if the build is based on a Git
clone, which caused these tests to fail when Git was not available.
This commit splits out those tests and only enabling them if Git is
found and Git information can be retrieved.
2020-12-07 18:10:26 +01:00
Sven Klemm
dc913ef0d4 Fix DecompressChunk path generation
The non-parallel pathes generated by DecompressChunk were
incorrectly marked as parallel_safe even when the child scan
was not parallel aware. Leading to incorrect query results
when those pathes were used in a parallel plan.
Additionaly DecompressChunk code didnt set total_table_pages on
PlannerInfo leading to an assertion failure in BitmapHeapscan
path creation.
2020-10-19 22:10:12 +02:00
Sven Klemm
87f78b4844 Move distributed insert tests to shared test
Change the distributed insert test to shared test so it can run in
parallel and doesn't require dedicated distributed setup.
2020-10-13 14:22:17 +02:00
Dmitry Simonenko
a51aa6d04b Move enterprise features to community
This patch removes enterprise license support and moves
move_chunk() function under community license (TSL).

Licensing validation code been reworked and simplified.
Previously used timescaledb.license_key guc been renamed to
timescaledb.license.

This change also makes testing code more strict against
used license. Apache test suite now can test only apache-licensed
functions.

Fixes #2359
2020-09-30 15:14:17 +03:00
Sven Klemm
a218532941 Fix cross-platform explain output differences
Enforce index scan for queries that would produce different output
between 32bit and 64bit platform to make explain output for
constraint_exclusion_prepared, ordered_append and ordered_append_join
test output consistent across platforms.
2020-09-10 19:26:40 +02:00
Sven Klemm
6ad98a45bb Move license change test to regresscheck-shared 2020-08-29 23:15:20 +02:00
Sven Klemm
6874076a85 Split ordered_append test into 2 tests
This patch separates the ordered append join tests from the other
ordered append tests. It also adds additional constraints to some
queries to speed them up. These changes result in a 3x speedup for
regresscheck-shared.
2020-08-12 21:46:31 +02:00
Sven Klemm
f61818f3a7 Limit resultsets for constraint_exclusion_prepared test
This patches limits the resultset for the constraint exclusion test
with prepared statements to make them run in a more reasonable time.
2020-08-12 21:46:31 +02:00
Sven Klemm
02d715f216 Add distributed hypertable to regresscheck-shared
This patch sets up a distributed hypertable in the regresscheck-shared
environment to enable running distributed tests.
2020-08-12 21:46:31 +02:00
gayyappan
9f13fb9906 Add functions for compression stats
Add chunk_compression_stats and hypertable_compression_stats
functions to get before/after compression sizes
2020-08-03 10:19:55 -04:00
Sven Klemm
68ba6e073c Add regresscheck-shared sql files to license check
This adds the directories used by regresscheck-shared to the license
check and adds a license where it is currently missing.
2020-07-03 13:00:36 +02:00
Sven Klemm
9c49a47fbb Fix handling of PlaceHolderVar in DecompressChunk
When the relation targetlist of the uncompressed chunk contained
PlaceHolderVars the construction of the relation targetlist of
the compressed chunk would fail with an error. This patch changes
the behaviour to recurse into those PlaceHolderVar.
2020-07-02 14:07:39 +02:00
Sven Klemm
65b3a0a991 Constify TIMESTAMPTZ OP INTERVAL in constraints
Constify expressions of the following form in WHERE clause:

column OP timestamptz - interval
column OP timestamptz + interval
column OP interval + timestamptz

Iff interval has no month component.

Since the operators for timestamptz OP interval are marked
as stable they will not be constified during planning.
However, intervals without a month component can be safely
constified during planning as the result of those calculations
do not depend on the timezone setting.
2020-06-25 12:41:34 +02:00
Sven Klemm
ccbe67f94f Run regresscheck-shared tests in parallel
This patch changes regresscheck-shared to no longer run individual
tests serially but runs them in parallel instead.
2020-06-23 14:35:20 +02:00
Sven Klemm
157764c70e Remove dynamic version checks from SQL tests
The sql tests still had version checks and would run EXPLAIN
with different parameters depending on postgres version. Since
all supported postgres versions now support all the parameters
we use we can safely remove the version check.
2020-06-22 12:08:17 +02:00
Sven Klemm
3b88e10d51 Add ordered_append test output for PG12
This patch also fixes one query in the ordered append test that had
non-deterministic output.
2020-04-14 23:12:15 +02:00
Ruslan Fomkin
7a0d6e7c23 Fix compression order in a test
Add missing ORDER BY clause to sort chunks for compression in
deterministic order for the constraint exclusion test.
2020-04-14 23:12:15 +02:00
Sven Klemm
2ae4592930 Add real-time support to continuous aggregates
This PR adds a new mode for continuous aggregates that we name
real-time aggregates. Unlike the original this new mode will
combine materialized data with new data received after the last
refresh has happened. This new mode will be the default behaviour
for newly created continuous aggregates.

To upgrade existing continuous aggregates to the new behaviour
the following command needs to be run for all continuous aggregates

ALTER VIEW continuous_view_name SET (timescaledb.materialized_only=false);

To disable this behaviour for newly created continuous aggregates
and get the old behaviour the following command can be run

ALTER VIEW continuous_view_name SET (timescaledb.materialized_only=true);
2020-03-31 22:09:42 +02:00
Sven Klemm
08c3d9015f Change log level for cagg materialization messages
The log level used for continuous aggregate materialization messages
was INFO which is for requested information. Since there is no way to
control the behaviour externally INFO is a suboptimal choice because
INFO messages cannot be easily suppressed leading to irreproducable
test output. Even though time can be mocked to make output consistent
this is only available in debug builds.

This patch changes the log level of those messages to LOG, so
clients can easily control the ouput by setting client_min_messages.
2020-03-06 01:09:08 +01:00
Sven Klemm
6fe5ef3957 Move prepared statement queries to shared tests
This patch moves the prepared statement test to the shared tests so
they can be run on compressed hypertables as well.
2019-11-07 15:56:20 +01:00
Matvey Arye
7ae97088f3 Fix ordered append test for PG <10.4
Prior to PG 10.4, the costing for hashaggs was different (see
PG commit `1007b0`). We fix the tests not to change between the
old and new versions by disabling hashagg. We were not testing
for that anyway.
2019-10-29 19:02:58 -04:00
Matvey Arye
3070a89f01 Fix tests after concurrent merge
The merges of some recent PRs occurred concurrently and did not update
the test output. This fixes that issue.
2019-10-29 19:02:58 -04:00
Sven Klemm
819414df02 Add test infrastructure with shared tables
This PR adds test infrastructure for running tests with shared tables.
This allows having hypertables with specific configurations usable for
all tests. Since these tests also don't require creating a new database
for each test case some of the overhead of the normal tests is removed.
While this will lead to much faster query tests some tests will still
require their own database to test things, but most queres could be moved
to this infrastructure to improve test coverage and speed them up.
2019-10-29 19:02:58 -04:00