DERBY-6330: Simplify StringBuffer use, as they are mutable

Patch contributed by Dave Brosius.


git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1521816 13f79535-47bb-0310-9956-ffa450edef68
DERBY-6315: Improve test coverage of org.apache.derby.impl.io.InputStreamFile

This patch was contributed by Ahsan Shamsudeen (ahsan dot competition at gmail dot com)

This patch removes the unused method StorageFile.length().

The length method is removed from the StorageFile interface, as well as
from the InputStreamFile, JarDBFile, and CorruptFile implementations.

The method was not called anywhere, and removing it simplifies this area
of the Derby code.


git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1523334 13f79535-47bb-0310-9956-ffa450edef68
DERBY-5866( testFiringConstraintOrder(org.apache.derbyTesting.functionTests.tests.lang.TriggerTest) junit.framework.AssertionFailedError:matching triggers need to be fired in order creation:1,NO CASCADE BEFORE,DELETE,ROW )

Move the cleanup code from tearDown() to setup() so that if a test fixture fails, we will have the left over wombat database with the schema and data used by the failing fixture for further debugging.





git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1523501 13f79535-47bb-0310-9956-ffa450edef68
DERBY-5866( testFiringConstraintOrder(org.apache.derbyTesting.functionTests.tests.lang.TriggerTest)junit.framework.AssertionFailedError: matching triggers need to be fired in order creation:1,NO CASCADE BEFORE,DELETE,ROW)

As per Knut's recommendation, moving cleanup of TRIGGER_INFO back to tearDown(). Otherwise, the info from the last test case in TriggerTest won't be released until the JVM terminates. I don't expect it to take up a huge amount of memory, but with the big number of tests in suites.All unreleased data structures could accumulate and cause OOME.



git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1523821 13f79535-47bb-0310-9956-ffa450edef68
DERBY-534: Support use of the WHEN clause in CREATE TRIGGER statements

Add the WHEN clause syntax to the grammar and wire it together with the
existing partial code for the WHEN clause.

Make RowTriggerExecutor and StatementTriggerExecutor execute the WHEN
clause and use the result to decide whether the trigger action should
be executed.

Add some basic positive tests for the currently supported subset of the
functionality.

git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1523965 13f79535-47bb-0310-9956-ffa450edef68
DERBY-6346: Dump wrapped Java exceptions to derby.log; tests passed cleanly on derby-6346-01-aa-logJavaException.diff.

git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1524026 13f79535-47bb-0310-9956-ffa450edef68
DERBY-6346: Fix LEFT JOIN involving a table with a generated column; tests passed cleanly on derby-6346-02-aa-generateNullForLeftJoins.diff.

git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1524194 13f79535-47bb-0310-9956-ffa450edef68
DERBY-3155: Remove spurious comma from grammar production for multiple WHEN [NOT] MATCHED clauses in MERGE statement; tests ran cleanly on derby-3155-02-ag-fixParserWarning.diff.

git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1524432 13f79535-47bb-0310-9956-ffa450edef68
DERBY-6349 DaylightSavingTest - java.security.AccessControlException



git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1524579 13f79535-47bb-0310-9956-ffa450edef68
DERBY-534: Support use of the WHEN clause in CREATE TRIGGER statements

Move common logic for executing WHEN clause and trigger action to the
base class GenericTriggerExecutor. In addition to reducing code
duplication, the change makes row triggers reuse the prepared
statement for the WHEN clause (same as it already does for the trigger
action), and it makes statement triggers not leave the before and
after result sets open if the WHEN clause evaluates to false.

git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1524645 13f79535-47bb-0310-9956-ffa450edef68
DERBY-6338; Remove Profile attribute from jar file manifests
  removing the Profile=compact2 lines added with DERBY-5955.


git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1525061 13f79535-47bb-0310-9956-ffa450edef68
DERBY-534: Add a disabled test case for NPE with subquery in WHEN clause

git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1525819 13f79535-47bb-0310-9956-ffa450edef68
ServerPropertiesTest prints .java.net.SocketException: Connection reset to console but test passes 

Remove e.printStackTrace() of error if log writer is null, unless derby.drda.debug is true



git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1526172 13f79535-47bb-0310-9956-ffa450edef68
DERBY-6351: Syntax error on equal transition table name and correlation name in statement trigger

Change how CreateTriggerNode.bindReferencesClause() checks for the
lack of a correlation name. Instead of checking it indirectly (and
unreliably) by seeing if the table name matches the base table name,
check directly if the correlation name is null.

git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1526406 13f79535-47bb-0310-9956-ffa450edef68
DERBY-534: Support use of the WHEN clause in CREATE TRIGGER statements

Allow references to transition variables and transition tables in the
WHEN clause. To support this, a new column WHENCLAUSETEXT is added to
the SYS.SYSTRIGGERS table, and a corresponding field is added to the
TriggerDescriptor class.

The logic that transforms triggered SQL statements to internal syntax
for accessing the transition variables and transition tables (via Java
method calls and VTIs) is reused on the WHEN clause text so that the
same transformation happens there.

Upgrade logic is added so that the new column in SYS.SYSTRIGGERS will
be created when a database is upgraded from an older version. The WHEN
clause is now disabled in the parser when running in soft upgrade
mode. An upgrade test case checks that the WHEN clause can only be
used in a hard-upgraded database, and that a reasonable error is
raised otherwise.