Commit Graph

394 Commits (b97b4356162f495916df1612cde9df002a12deff)

Author SHA1 Message Date
Jason Petersen b97b435616
Change table_fkeys view to use information_schema 2017-06-09 16:06:31 -06:00
Jason Petersen dc5d2e5b9c
Change table_checks view to use information_schema 2017-06-09 16:06:31 -06:00
Jason Petersen 262a183023
Fix psql-dependent mx-metadata test 2017-06-09 16:06:31 -06:00
Jason Petersen f147c7a539
Fix psql-dependent mx-ddl test 2017-06-09 16:06:31 -06:00
Jason Petersen b031ac4bef
Fix psql-dependent xact-drop-shards test 2017-06-09 16:06:31 -06:00
Jason Petersen 81895b1692
Fix psql-dependent remove ref table test 2017-06-09 16:06:31 -06:00
Jason Petersen b73cbaa808
Fix psql-dependent upgrade ref table test 2017-06-09 16:06:31 -06:00
Jason Petersen b655ddfb55
Fix psql-dependent colocation tests 2017-06-09 16:06:31 -06:00
Jason Petersen 4ed2f653cd
Fix psql-dependent schema support tests 2017-06-09 16:06:31 -06:00
Jason Petersen a479dd5cd8
Fix psql-dependent worker ops tests 2017-06-09 16:06:31 -06:00
Jason Petersen 992c875e0a
Fix psql-dependent metadata sync tests
Ugh. These were… involved.
2017-06-09 16:06:31 -06:00
Jason Petersen 61d493000d
Fix psql-dependent modifying xact tests 2017-06-09 16:06:30 -06:00
Jason Petersen 1116805020
Fix psql-dependent add constraint tests
Some of these weren't even correct.
2017-06-09 16:03:33 -06:00
Jason Petersen 1ef60069b6
Fix psql-dependent DDL tests
Obviously lots of \d commands in this file.
2017-06-09 16:03:33 -06:00
Jason Petersen dee1db807f
Fix psql-dependent reference tests 2017-06-09 16:03:33 -06:00
Jason Petersen ad97e8d8f4
Fix psql-dependent constraint tests
Added a new view for fkeys and removed any \d commands which displayed
tables.
2017-06-09 16:03:33 -06:00
Jason Petersen 05ba20f78c
Fix psql-dependent name tests
Used the constraint view as needed and changed most \d commands to \di
or \dt list commands (which are identical in 9.5, 9.6, and 10).
2017-06-09 16:03:33 -06:00
Jason Petersen 60d15367ca
Add views to replace psql's \d as needed 2017-06-09 16:03:33 -06:00
Jason Petersen d7fe6b06f9
Update version-specific tests for PostgreSQL 10
Nitty-gritty, but it's all here.
2017-06-09 16:03:14 -06:00
Jason Petersen 67eca1d3f6
Shift version-specific files
Many tests now need 9.5-, 9.6-, and 10-specific output files. I've
"shifted" all such files. The mapping is:

  * No suffix: PostgreSQL 10
  * _0 suffix: PostgreSQL 9.6, or 9.x if no _1 present
  * _1 suffix: PostgreSQL 9.5

All tests output the version at the top, so it's clear which output
belongs to which version.
2017-06-09 16:03:14 -06:00
Jason Petersen 0d873b0758
Add pg_regress_multi support for PostgreSQL 10
We'll need to be able to run tests against PostgreSQL 10.
2017-06-09 16:03:13 -06:00
Marco Slot 70abfd29d2 Allow COPY after a multi-shard command
This change removes the XactModificationLevel check at the start of COPY
that was made redundant by consistently using GetPlacementConnection.
2017-06-09 13:54:58 +02:00
Jason Petersen 50501227e9
Add ORDER clause to subquery test missing it 2017-06-08 18:30:14 -06:00
Jason Petersen cc190a4af9
Remove tracked files from gitignore
Causes very hard-to-debug test failures.
2017-06-08 17:39:31 -06:00
jmunsch 1647d17a14 Clarify error message for local and distributed query plans. 2017-06-01 11:52:49 -07:00
Onder Kalaci df494c0403 Improve subquery pushdown regression tests
- Use native postgres function for composite key btree functions
  - Move explain tests to multi_explain.sql (get rid of .out _0.out files)
  - Get rid of input/output files for multi_subquery.sql by moving table creations
  - Update some comments
2017-05-30 14:05:15 +03:00
Burak Yucesoy aff6a3dcc4 Add tests for version check 2017-05-24 17:39:25 +03:00
Önder Kalacı 757f5be858 Merge branch 'master' into better_comment_for_tests 2017-05-22 10:58:21 +03:00
Onder Kalaci a5c12b968b Add comment to the regression test file to prevent any misunderstandings about
the usage of enable_router_execution GUC variable.
2017-05-22 10:39:32 +03:00
Burak Yucesoy 7a7c74cc87 Add tests for version checks 2017-05-22 09:53:29 +03:00
Jason Petersen cc45712144 Bump extension and configure PACKAGE versions
Actually getting this done before the next dev cycle begins.
2017-05-17 15:25:30 -06:00
Jason Petersen 791cdd7648
Limit sequence SELECT to last_value
Unbounded column output differs by version.
2017-05-16 11:05:34 -06:00
Jason Petersen 51137184d9
Suppress hash index warning
Irrelevant to the test.
2017-05-16 11:05:34 -06:00
Jason Petersen 97f8302c9c
Change version-sensitive tests to handle '10'
Previously assumed period in version; this makes tests future-proof.
2017-05-16 11:05:34 -06:00
Jason Petersen d6cccee5bc
Remove ALTER SEQUENCE from parallel groups
Removing these has no side effect, and in the (current) PostgreSQL 10,
an ERROR is printed during concurrent sequence modification.
2017-05-16 11:05:34 -06:00
Jason Petersen db11324ac7
Add unambiguous ORDER BY clauses to many tests
Queries which do not specify an order may arbitrarily change output
across PostgreSQL versions.
2017-05-16 11:05:34 -06:00
Jason Petersen b9bc3fdada
Update header comments to match new test names
Just keeping these in sync with the actual file name.
2017-05-16 11:05:33 -06:00
Jason Petersen 9f4a33eee1
Rename very long test files
In addition to not actually providing much information, these names can
cause problems in PostgreSQL 10.
2017-05-16 11:05:33 -06:00
Burak Yucesoy 577ffb2bf2 Add tests for non-default schema owner 2017-05-15 16:49:37 +03:00
Önder Kalacı a7c65a3ed8 Add 9.5 output file for isolation test (#1413)
With commit we add one additional regression test output file which
has some output syntax differences with its 9.6 equivalence.
2017-05-15 15:27:37 +03:00
Jason Petersen 05d42b01d3
Mark test failing in 9.5 as 'ignore'
This test was added this morning, but is failing in 9.5.
2017-05-12 15:00:42 -06:00
Burak Yucesoy 75d58cbf94
Travis merge jobs use custom-compiled PostgreSQL
With this commit, we start to use custom compiled PostgreSQL builds in
Travis for merge commits. This allows us to run isolation tests and
PostgreSQL's own regression tests along with our regression tests in
Travis.

Since manually compiling PostgreSQL takes more time and we also add new
tests, we only enable running these tests on merge commits.
2017-05-12 15:00:42 -06:00
Önder Kalacı 3adbbdcdcb Fix typo in the regression test (#1410) 2017-05-12 15:46:38 +03:00
Önder Kalacı e0257aecd9 Accept invalidation messages before accessing the metadata cache (#1406)
* Accept invalidation messages before accessing the metadata cache

This commit is crucial to prevent stale metadata reads from the
cache. Without this commit, some of the operations may use stale
metadata which could end up with various bugs such as crashes,
inconsistent/lost data etc.

As an example, consider that a COPY operation is blocked on shard
metadata lock. Another concurrent session updates the metadata and
invalidates the cache. However, since Citus doesn't accept invalidations,
COPY continues with the stale metadata once it acquires the lock.

With this commit, we make sure that invalidation messages are accepted
just before accessing the metadata cache and preventing any operation to
use stale metadata.

* Add isolation tests for placement changes and conccurrent operations

   - add node with reference table vs COPY/insert/update/DDL
   - repair shard vs COPY/insert/update/DDL
   - repair shard vs repair shard
2017-05-12 12:32:35 +03:00
Marco Slot 6f9e18de24 Ensure all preceding writes are visible in data migration 2017-05-11 09:42:12 +02:00
Önder Kalacı 3ec502b286 Add support for parametrized execution for subquery pushdown (#1356)
Distributed query planning for subquery pushdown is done on the original
query. This prevents the usage of external parameters on the execution.
To overcome this, we manually replace the parameters on the original
query.
2017-05-10 09:38:48 +03:00
Metin Doslu 37026dc351 Add truncate first isolation tests 2017-05-08 17:26:55 +02:00
Marco Slot a8f368fced Fix locking in master_drop_all_shards / master_apply_delete_command 2017-05-08 17:26:55 +02:00
Marco Slot 853f07dd33 Don't change query tree of DDL commands 2017-05-04 21:34:28 +02:00
Önder Kalacı b74ed3c8e1 Subqueries in where -- updated (#1372)
* Support for subqueries in WHERE clause

This commit enables subqueries in WHERE clause to be pushed down
by the subquery pushdown logic.

The support covers:
  - Correlated subqueries with IN, NOT IN, EXISTS, NOT EXISTS,
    operator expressions such as (>, <, =, ALL, ANY etc.)
  - Non-correlated subqueries with (partition_key) IN (SELECT partition_key ..)
    (partition_key) =ANY (SELECT partition_key ...)

Note that this commit heavily utilizes the attribute equivalence logic introduced
in the 1cb6a34ba8. In general, this commit mostly
adjusts the logical planner not to error out on the subqueries in WHERE clause.

* Improve error checks for subquery pushdown and INSERT ... SELECT

Since we allow subqueries in WHERE clause with the previous commit,
we should apply the same limitations to those subqueries.

With this commit, we do not iterate on each subquery one by one.
Instead, we extract all the subqueries and apply the checks directly
on those subqueries. The aim of this change is to (i) Simplify the
code (ii) Make it close to the checks on INSERT .. SELECT code base.

* Extend checks for unresolved paramaters to include SubLinks

With the presence of subqueries in where clause (i.e., SubPlans on the
query) the existing way for checking unresolved parameters fail. The
reason is that the parameters for SubPlans are kept on the parent plan not
on the query itself (see primnodes.h for the details).

With this commit, instead of checking SubPlans on the modified plans
we start to use originalQuery, where SubLinks represent the subqueries
in where clause. The unresolved parameters can be found on the SubLinks.

* Apply code-review feedback

* Remove unnecessary copying of shard interval list

This commit removes unnecessary copying of shard interval list. Note
that there are no copyObject function implemented for shard intervals.
2017-05-01 17:20:21 +03:00