Commit Graph

673 Commits (6b7404f59c25deaa5a67d8791c4d8eb22e217696)

Author SHA1 Message Date
Onder Kalaci bbced1d704 Bugfix for deparsing INSERT..SELECT queries which involve constant values
This commit fixes a bug when the SELECT target list includes a constant
value.

Previous behaviour of target list re-ordering:
  * Iterate over the INSERT target list
    * If it includes a Var, find the corresponding SELECT entry
      and update its resno accordingly
    * If it does not include a Var (which we only considered to be
      DEFAULTs), generate a new SELECT target entry
  * If the processed target entry count in SELECT target list is less
    than the original SELECT target list (GROUP BY elements not included in
    the SELECT target entry), add them in the SELECT target list and
    update the resnos accordingly.
     * However, this step was leading to add the CONST SELECT target entries
       twice. The reason is that when CONST target list entries appear in the
       SELECT target list, the INSERT target list doesn't include a Var. Instead,
       it includes CONST as it does for DEFAULTs.

New behaviour of target list re-ordering:
  * Iterate over the INSERT target list
    * If it includes a Var, find the corresponding SELECT entry
      and update its resno accordingly
    * If it does not include a Var (which we consider to be
      DEFAULTs and CONSTs on the SELECT), generate a new SELECT
      target entry
  * If any target entry remains on the SELECT target list which are resjunk,
    (GROUP BY elements not included in the SELECT target entry), keep them
    in the SELECT target list by updating the resnos.
2016-12-01 10:41:56 +02:00
Murat Tuncer 6458de43f1 Merge pull request #1002 from citusdata/fix/395_filters_do_not_work
Add support for filter
2016-12-01 09:06:23 +02:00
Murat Tuncer 33375944d6 Add support for filters
Ensures filter clauses are stripped from master query, and pushed
down to worker queries.
2016-12-01 08:53:46 +03:00
Jason Petersen 6384a74a99 Merge pull request #1001 from citusdata/add_changelog_entry_for_6.0.1
Add 6.0.1 CHANGELOG entry

cr: @jasonmp85
2016-11-29 09:14:23 -07:00
Burak Yucesoy a7f0823318 Add 6.0.1 CHANGELOG entry
Couple fixes and improvements to existing behavior.
2016-11-29 08:05:36 -08:00
Marco Slot f2ee93b62f Merge pull request #976 from citusdata/fix-error-messa
Fixup unsupported error message
2016-11-26 11:19:27 +01:00
Sumedh Pathak b9cbb52c06 Change DDL error message to say "unsupported" instead of "supported" 2016-11-26 10:30:09 +01:00
Marco Slot 271b559e0a Merge pull request #975 from citusdata/sumedhpathak-readme-change
Update documentation link to 6.0
2016-11-26 10:28:45 +01:00
sumedhpathak 2df3dcb8bd Update documentation link to 6.0 2016-11-26 10:01:34 +01:00
Murat Tuncer 8f2e61dbfc Merge pull request #973 from citusdata/fix/964_pg_upgrade_catalog_tables
Fix failures during pg_upgrade
2016-11-11 17:33:43 -08:00
Murat Tuncer 9bc833f335 Fix failures during pg_upgrade
- fix error in CitusHasBeenLoaded()
- allow creation of pg_catalog tables during upgrade
2016-11-11 17:22:45 -08:00
Marco Slot 419ce3c2cd Merge pull request #979 from citusdata/bugfix/null_parameter
Pass down the correct type for null parameters
2016-11-11 16:57:06 -08:00
Marco Slot 40b1e8c039 Pass down the correct type for null parameters 2016-11-11 07:14:08 +01:00
Metin Döşlü ae0f1033d0 Merge pull request #974 from citusdata/fix/use_access_share_lock
Use AccessShareLock on the source table while creating a colocated table
2016-11-10 11:30:55 -08:00
Metin Doslu 670e2bc0dd Use AccessShareLock on the source table while creating a colocated table
While creating a colocated table, we don't want the source table to be dropped.
However, using a ShareLock blocks DML statements on the source table, and
using AccessShareLock is enough to prevent DROP. Therefore, we just loosened
the lock to AccessShareLock.
2016-11-10 09:17:05 -08:00
Eren Başak 4bcbbd554e Merge pull request #955 from citusdata/master_add_node_column_defs
Add Column Definition List for Output Columns for master_add_node
2016-11-07 15:02:36 -08:00
Eren Basak 4c5b97995a Add Column Definition List for Output Columns for master_add_node
This change allows seeing the names of columns of `master_add_node`,
using `SELECT * FROM master_add_node(...)` by specifying output
columns in UDF definition.
2016-11-07 14:08:58 -08:00
Jason Petersen 6d35c878ed Bump CHANGELOG release dates
Oops.
2016-11-07 09:51:18 -07:00
Jason Petersen 139845466d Merge pull request #950 from citusdata/changelog-6.0
CHANGELOG changes

cr: @sumedhpathak
2016-11-07 09:49:14 -07:00
Jason Petersen 915107b580 Add 6.0.0 CHANGELOG entry
For the upcoming release.
2016-11-07 09:41:08 -07:00
Jason Petersen c0be80ea56 Add 5.2.2 CHANGELOG entry
Many fixes and improvements to existing behavior.
2016-11-07 09:41:08 -07:00
Marco Slot 5d4de7965d Merge pull request #941 from citusdata/bugfix/repair_deadlock
Avoid master_copy_shard_placement after modification deadlock
2016-11-03 10:57:32 +01:00
Marco Slot 28a1a88e9c Disallow SendCommandListToWorkerInSingleTransaction when modifications have occurred 2016-11-02 12:26:56 +01:00
Marco Slot 7b0fb743b0 Merge pull request #939 from citusdata/bugfix/colocated_multi_shards
Use co-located shard ID in multi-shard transactions
2016-11-02 11:18:46 +01:00
Marco Slot 1d3caceda4 Use co-located shard ID in multi_shard_transaction 2016-11-02 11:01:19 +01:00
Jason Petersen a9c958c847 Merge pull request #929 from citusdata/fix_create_index_if_not_exists
Avoid error during CREATE INDEX IF NOT EXISTS

cr: @jasonmp85
2016-11-01 17:11:39 -06:00
Samay Sharma 69bd7fc8de Avoid error during CREATE INDEX IF NOT EXISTS
Previously, we threw an error when we ran CREATE INDEX IF NOT EXISTS
with an already existing index. This change enables expected behavior by
checking if the statement has IF NOT EXISTS before throwing the error.
We also ensure that we don't execute the command on the workers, if an
index already exists on the master.
2016-11-01 14:51:19 -07:00
Burak Yücesoy e4fefcab65 Merge pull request #937 from citusdata/fix_typo_in_error_message
Fix typo in error message
2016-11-01 17:04:53 +02:00
Burak Yucesoy 0e7d753b1f Fix typo in error message 2016-11-01 16:58:27 +02:00
Burak Yücesoy cf593e9678 Merge pull request #936 from citusdata/fix_foreign_constraint_replication_factor_message
Change error message we displayed for foreign constraints if RF > 1
2016-11-01 15:57:46 +02:00
Burak Yucesoy dbe717780c Change error message we displayed for foreign constraints if RF > 1
At the moment, we do not support foreign constraints if replication factor is greater
than 1. However foreign constraints can be used in cloud with high availability option.
Therefore we do not want to create an impression such that foreign constraints with
high availability is not supported at all. We call users to action with this error
message.
2016-11-01 15:47:19 +02:00
Marco Slot 64c7d68bf7 Merge pull request #928 from citusdata/fix_drop_shards
Always CASCADE while dropping a shard
2016-11-01 10:35:35 +01:00
Önder Kalacı 34fa711b14 Always CASCADE while dropping a shard 2016-11-01 10:16:34 +01:00
Brian Cloutier 762468f0e3 Copy raw_parse_tree before using it
Address citusdata/citus#922.

Fixes a segfault in PG's installcheck caused by our reuse of
raw_parse_tree when handling EXPLAIN EXECUTE.
2016-10-27 18:25:49 +03:00
Önder Kalacı 70bb08fbd9 Merge pull request #921 from citusdata/fix_execution_of_insert_select_bug
Improve error semantics for INSERT..SELECT
2016-10-27 14:17:13 +03:00
Onder Kalaci b8ad613325 Improve error semantics for INSERT..SELECT
With this commit, we error out if a worker query cannot be executed
on all placements of a target insert shard interval.
2016-10-27 14:09:05 +03:00
Andres Freund 97798c0b2b Merge pull request #917 from citusdata/isolationtester
Basic Isolationtester infrastructure including some basic tests.
2016-10-27 04:03:37 -07:00
Andres Freund 499f8b9096 Simple isolationtester dml vs. repair tests. 2016-10-27 00:31:41 -07:00
Andres Freund 664341a2ad Add very basic isolationtester infrastructure including a trivial test. 2016-10-27 00:31:41 -07:00
Andres Freund 258cfba7ce Identify build and source directory of postgres we're compiling against.
That's useful when trying to rely on files only present in source and/or
build directories, not in the normal installation. E.g. the
isolationtester binary, or the valgrind suppression files.
2016-10-27 00:31:41 -07:00
Andres Freund fa6d217dcb Don't try to shutdown servers that have not been started in regression tests.
This avoids spurious output from failing shutdowns and uninitialized
variable warnings if pg_regress_multi.pl fails before starting servers.
2016-10-27 00:31:41 -07:00
Metin Döşlü 5efa176da9 Merge pull request #920 from citusdata/fix/error_on_different_shard_placement_count
Error on different shard placement counts
2016-10-26 18:54:08 +03:00
Metin Doslu 16218413d0 Error on different shard placement count
In ErrorIfShardPlacementsNotColocated(), while checking if shards are colocated,
error out if matching shard intervals have different number of shard placements.
2016-10-26 18:46:05 +03:00
Önder Kalacı 7551533fd2 Merge pull request #919 from citusdata/add_stub_for_repair_shards
Add stub for Copy shard placement
2016-10-26 18:05:54 +03:00
Onder Kalaci dc1b8b3e18 Add stub for Copy shard placement
This commit does not change the current behaviour, but, helps to implement
enterprise feature without any version changes.
2016-10-26 17:57:55 +03:00
Metin Döşlü cba13b4cc9 Merge pull request #915 from citusdata/add_mark_tables_colocated
Add mark_tables_colocated() to update colocation groups
2016-10-26 17:37:29 +03:00
Metin Doslu 520e7e3cb2 Add mark_tables_colocated() to update colocation groups
Added a new UDF, mark_tables_colocated(), to colocate tables with the same
configuration (shard count, shard replication count and distribution column type).
2016-10-26 17:29:03 +03:00
Andres Freund 71dbd5aea5 Merge pull request #916 from citusdata/bugfix/prepstate
Re-acquire metadata locks in RouterExecutorStart
2016-10-26 06:54:13 -07:00
Marco Slot 7a606f1c1d Re-acquire metadata locks in RouterExecutorStart 2016-10-26 14:34:59 +02:00
Brian Cloutier c7e722e624 Fix segfault during EXPLAIN EXECUTE
Fix citusdata/citus#886

The way postgres' explain hook is designed means that our hook is never
called during EXPLAIN EXECUTE. So, we special-case EXPLAIN EXECUTE by
catching it in the utility hook.  We then replace the EXECUTE with the
original query and pass it back to Citus.
2016-10-26 15:18:42 +03:00