While copying the Agg nodes copy the skip_trans value as well. If skip_trans is
not copied, it causes the transitioned results from datanodes to be transitioned
again, thus giving wrong aggregated results.
This commit adds pgxc_ctl documentation.
Fix for failing testcase inherit.sql. It has following changes
1. Added ORDER BY clause to make sure that the query result is always the same.
2. The test uses temporary objects which do not work with 2PC in PostgreSQL.
   Used GUC to allow using 2PC with temporary objects.
3. Updated the original expected output file with the changed plans in XC.
Fix for failing testcase truncate.sql.
1. Used replicated tables, which were referenced by other tables and the primary
keys and foreign keys couldn't reside on same node, if the table would have been
distributed.
2. Triggers are now supported. Corrected the expected output in alternate output
file accordingly.
TRUNCATE statement with RESTART IDENTITY clause is not supported in this
release. Error out when TRUNCATE with RESTART IDENTITY is specified. Alternate
expected output is updated with error message and consequences of the same.
Original patch by Nikhil Sontakke.
Fix for test case combocid.sql.
The relation being used for the test is distributed by replication
so that the test produces consistent output on all configurations.
Fix for test case plpgsql.sql
1. Some order by clauses were added to make sure test cases produces
   consistent results.
2. By mistake expected output of some tests was wrong, corected that too.
If there an unshippable expression in the targetlist of the inner relation (the
side which contributes NULL columns for the unmatched columns) of an OUTER join,
the unshippable expression gets projected at the coordinator. At the time of
projection, it's not possible to judge which side of the join expression comes
from and whether it should be NULL (in case of unmatched row) or non-NULL (in
case of matched row). Hence in such cases, join should not be shippable. That
way, the join will be evaluated at the coordinator and NULL or non-NULL values
will be projected based on the join quals.
Fix for test case copy2.sql
Test was failing because of some missing order by clauses.
Also some changes were done to make sure that the alternate expected output
comes closer to the expected output.
Still there are some changes between the two that need to be taken care of.
The changes are because FOR EACH ROW triggers are not fired on coordinators
and there is some missing quotes issue as well.
Once these issues are resolved the alternate expected output file can be removed.
Fix for test case xc_copy

The intention of the test case is to make sure that
quoted table names work fine in COPY FROM.
This test can be performed with a single data row in the table
to make sure that the results are consistent on all
cluster configurations.
Fix for test case xc_returning

The tables should be created on a well defined set of nodes
to make sure that ctid returning test cases return
consistent output on all cluster configurations.
Fix for test case xc_misc.sql

A SELECT FOR UPDATE on a replicated table was being shipped by
mistake to all datanodes in a cluster with no primary node.
The problem was in function pgxc_FQS_find_datanodes.
The if condition to call GetPreferredReplicationNode
was only checking read relation access type, read for update was missing.
The result was that in case of read for update on a replicated table
in a cluster with no primary node, the query was being shipped to all
datanodes since the call to GetPreferredReplicationNode got skipped.
The fix was to add an additional check in the if condition.
In addition the patch adds assertions at places where GetRelationNodes
is called and a read for update on a replicated table is not expected.
This is a fix to incorrect get_next of the sequence.

Nikhil Sontakke provided the patch.
DROP NODE has to be an allowed statement, otherwise trying
to acquire an advisory lock on the node to be droped fails.
This commit reflects some more fix to pgxc_ctl for beta.

Added very simple command to check if there's any tables
involved by the datanode to remove.
This commit fixes a bug so that local work files are removed when
not needed.
This commit fixes the bug 3611326, back up sequence information to
GTM slave.

Andrei Martsinchuyk provided the patch.
This commit fixes two issues of pgxc_ctl.

1. defaultDatabase variable was not used in several places.
   Database name as describled "postgres" was replaced with refeernce
   to the variable defaultDatabase.

2. help and version option handling were missing.  Fixed.
Fix for test tsearch.
1. Added collate clause to some queries where row order differed depending upon
locale.
2. A table with unique constaint is converted to replicated to avoid failure
because of constraint.
Fix the explain outputs of xc_sort and xc_FQS_join to be independent of
number of nodes in the XC cluster where tests are being run.
Original patch by Koichi Suzuki.