Commit Graph

1092 Commits (1116805020dcb44ab5394a72214419f15fafa14e)

Author SHA1 Message Date
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 38f25020e3
Address PostgreSQL 10's planned stmt changes
PostgreSQL appears to now stash the PlannedStmt somewhere within
ProcessUtility itself (per Marco), which results in a use-after-free
bug if we keep our old behavior of overriding the PlannedStmt's utility
statement with a copy with baked-in schema names.

The quickest fix is to just avoid this behavior altogether for
PostgreSQL 10. Because this area of code needs some attention anyhow
(i.e. we're not always doing the right things wrt schema name lookups
for our utility statements), Marco suggested this fix until we get to
a more comprehensive correction covering other utility commands.
2017-06-09 16:03:14 -06:00
Jason Petersen 87d1928f0c
Build PostgreSQL 10 in Travis
For now, I'm the HyperLogLog install, since no PostgreSQL 10 package
exists yet. The add_pg10 branch of citusdata/tools is where I've made
required Travis script changes.
2017-06-09 16:03:14 -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 dc2fe5a7da
Bring Citus changes to PostgreSQL 10 ruleutils
Didn't need any new code; just copied over changes from previous files.
2017-06-09 16:03:14 -06:00
Jason Petersen 4cb93bcd3b
Add pristine PostgreSQL 10 ruleutils file
We'll apply our changes shortly.
2017-06-09 16:03:14 -06:00
Jason Petersen d2d1d47150
Handle DoCopy changes
Requires a non-nULL ParseState in PostgreSQL 10, so we make one.
2017-06-09 16:03:14 -06:00
Jason Petersen 7cf2b48f64
Handle DefineRelation changes
Now accepts the original query string; passing NULL is fine.
2017-06-09 16:03:14 -06:00
Jason Petersen 39ed50c52f
Handle removal of deleteWhatDependsOn
Rather than a specific deleteWhatDependsOn, PostgreSQL 10 has a general
performDeletion call whose flags allow emulation of the old function.
2017-06-09 16:03:14 -06:00
Jason Petersen 90bf243904
Remove Node cast of authrole (now RoleSpec)
Rather than Node, the authrole field of CreateSchemaStmt is an actual
RoleSpec type. The cast to Node only makes sense before PostgreSQL 10.
2017-06-09 16:03:14 -06:00
Jason Petersen c0e2a25d92
Handle CreateSchemaCommand changes
Now expects a statement location and length, though passing -1 for both
preserves existing behavior.
2017-06-09 16:03:14 -06:00
Jason Petersen 3ca189ce08
Use new sequence struct field names
Bizarrely, PostgreSQL 10 renames all of Form_pg_sequence's fields.
2017-06-09 16:03:14 -06:00
Jason Petersen aba4f2eff3
Handle sequence metadata access changes
Sequences used to have a pretty weird representation: C code could read
their attributes by loading the single tuple stored in their relation.

Now each sequence has a corresponding tuple in pg_sequence, and there
are syscache entries for each, meaning we can (and must) use syscache
methods to look up attributes for sequences.
2017-06-09 16:03:14 -06:00
Jason Petersen 6fbfe33c51
Handle ExecEvalExprSwitchContext changes
Weirdly, this is one of the places PostgreSQL _removed_ an argument. We
only passed NULL anyways, so just removing it works.
2017-06-09 16:03:14 -06:00
Jason Petersen 6c48c93b6a
Backport get_all_actual_clauses
This is the sole PostgreSQL 10 change that "breaks" Citus; we use this
function and no alternative is available. Fortunately, it's small
enough to copy-paste.
2017-06-09 16:03:14 -06:00
Jason Petersen 59a4fb596c
Add new RTE types to CitusRTEKind
PostgreSQL 10 adds two new RTEKind values and compilation will complain
unless we handle them.
2017-06-09 16:03:14 -06:00
Jason Petersen 1d52af2492
Bump static assert
No changes needed; won't have to check again until 10.1, or whatever
that version ends up being called.
2017-06-09 16:03:14 -06:00
Jason Petersen d5e636b84d
Preserve behavior of self dependency recording
recordDependencyOnSingleRelExpr now accepts a "ignore_self" flag to
disable recording self-dependencies. Passing "false" preserves existing
behavior.
2017-06-09 16:03:14 -06:00
Jason Petersen 6a4cd9965c
Handle pg_analyze_and_rewrite signature change
Now requires a RawStmt rather than any old Node. Methods to parse DDL
into a list of Nodes now return a list of RawStmts; the old Nodes we
expect are available as one of their fields. ParseTreeRawStmt is used
in PostgreSQL 10 to obtain the RawStmt itself; the behavior of the old
ParseTreeNode is preserved and it always returns a simple Node.
2017-06-09 16:03:14 -06:00
Jason Petersen b2319011fe
Specify column in owned sequence call
getOwnedSequences can now filter owned sequences by a specified column.
Passing InvalidAttrNumber preserves the original behavior of returning
all sequences owned by a specified relation.
2017-06-09 16:03:13 -06:00
Jason Petersen b1cf59e32a
Specify dependency type in seq. ownership check
sequenceIsOwned now accepts a dependency type, but simply passing
DEPENDENCY_AUTO preserves existing behavior.
2017-06-09 16:03:13 -06:00
Jason Petersen fdfcbaeb2a
Use new catalog modification wrappers
PostgreSQL 10 removes the ability to directly call CatalogUpdateIndexes
in favor of new CatalogTupleUpdate and CatalogTupleInsert calls, which
do this for us.
2017-06-09 16:03:13 -06:00
Jason Petersen cf7bfdb22b
Address various header changes
Certain PostgreSQL 10 changes require modifications to our includes:

  * pg_sequence's interace has been refactored into its own file
  * textToQualifiedNameList is now in utils/varlena.h
  * pg_getnameinfo_all is now in common/ip.h
  * stringToQualifiedNameList is now in utils/regproc.h
2017-06-09 16:03:13 -06:00
Jason Petersen 300349e646
Handle BeginCopyFrom changes
BeginCopyFrom now accepts a ParseState and callback argument, but it's
again fine to just NULL out both arguments.
2017-06-09 16:03:13 -06:00
Jason Petersen caaaa2c9f7
Handle makeDefElem changes
makeDefElem now requires the token location, but simply passing -1 to
signify "unknown" is sufficient.
2017-06-09 16:03:13 -06:00
Jason Petersen 3c507e7399
Handle LWLockRegisterTranche changes
The initialization of a custom lock tranche is somewhat simplified in
PostgreSQL 10: now a name and identifier are sufficient.
2017-06-09 16:03:13 -06:00
Jason Petersen 0b4b9aa5a9
Add PG_WAIT_EXTENSION to Read/WriteFile calls
Read/WriteFile adds the same "wait_event_info" argument, so I've added
a PG_WAIT_EXTENSION to all these calls as well.
2017-06-09 16:03:13 -06:00
Jason Petersen 4610978c10
Add PG_WAIT_EXTENSION to WaitLatchOrSocket calls
WaitLatchOrSocket now accepts a "wait_event_info" argument for use by
pg_stat. Extensions appear to mostly just pass "PG_WAIT_EXTENSION", so
that's what I've done.
2017-06-09 16:03:13 -06:00
Jason Petersen 603b9cf3c4
Handle ProcessUtility changes
PostgreSQL 10's ProcessUtility now requires a PlannedStmt with its
utilityStmt field set to what we used to pass directly.

In addition, it receives a QueryEnvironment reference, altogether new
but apparently OK to NULL out for now.

This adds a wrapper to adapt to the new style and fixes all callers.
2017-06-09 16:03:13 -06:00
Jason Petersen a34e9e30d7
Rename PartitionKey to DistPartitionKey
PostgreSQL 10 adds a PartitionKey symbol which conflicts with ours.
2017-06-09 16:03:13 -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
Jason Petersen 3a397c66ca
Modify configure to permit PostgreSQL 10
Can't very well compile for the new version if configure won't let us!
2017-06-09 16:03:13 -06:00
Marco Slot d3e0742b8d Merge pull request #1441 from citusdata/remove_copy_xact_check
Allow COPY after a multi-shard command
2017-06-09 14:19:06 +02: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
Brian Cloutier 38fea7fe66 Add instructions for using citus_indent (#1434) 2017-06-05 13:21:47 +03:00
Metin Döşlü a7c94cb36d Merge pull request #1431 from jmunsch/jmunsch_errmsg
Update to errmsg for mixed location insert into
2017-06-02 10:48:49 +03:00
jmunsch 1647d17a14 Clarify error message for local and distributed query plans. 2017-06-01 11:52:49 -07:00
Jason Petersen a1e44328b2
Add 6.2.2 CHANGELOG entry 2017-05-31 17:02:41 -06:00
Jason Petersen eaa9dabad1
Add 6.1.2 CHANGELOG entry 2017-05-31 17:02:24 -06:00
Andres Freund 5d0db7a9dd Merge pull request #1438 from citusdata/fix_shard_move_lock
Don't take a table lock in ForeignConstraintGetReferencedTableId
2017-05-31 15:26:19 -07:00
Marco Slot f1d804180b Don't take a table lock in ForeignConstraintGetReferencedTableId 2017-05-31 11:15:21 +02:00
Önder Kalacı 0e3369a863 Merge pull request #1389 from citusdata/improve_subquery_reg_tests
Improve subquery pushdown regression tests
2017-05-30 14:18:37 +03:00