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.
Fix for bug 3613598.
If a table has multiple triggers, either fire all of them on datanode, or fire
all of them on coordinator. If one or more triggers are not shippable to
datanode, fire all of the triggers on coordinator, else fire them on datanode.
This is required because we need to execute triggers in alphabetical order.

Also, statement triggers are now fired only on coordinator, even if the
statement is FQSed, or even if the trigger function is shippable.
Change names of a couple of variables realted to
command id exchange mechanism to more general names.
Fix for test case with.sql

There were two issues making the test to fail.
1. Updates to partition column were possible using syntax like
   WITH t AS (UPDATE y SET a=a+1 RETURNING *) SELECT * FROM t
   The patch blocks this syntax.

2. For a WITH query that updates a table in the main query and
   inserts a row in the same table in the WITH query we need to use
   command ID communication to remote nodes in order to
   maintain global data visibility.
   Similarly a WITH query that deletes from a parent table in the
   main query & inserts a row in the child table in the WITH query
   we need to use command ID communication to remote nodes in order
   to maintain global data visibility.
This commit adds gtm capability to backup its restart point according
to CREATE BARRIER statement.

Runs without GTM-Proxy now.