You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by rh...@apache.org on 2014/04/04 16:40:21 UTC
svn commit: r1584721 -
/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_11.java
Author: rhillegas
Date: Fri Apr 4 14:40:21 2014
New Revision: 1584721
URL: http://svn.apache.org/r1584721
Log:
DERBY-590: Attempt to fix upgrade tests which were broken by derby-590-15-aa-requireHardUpgrade.diff; commit derby-590-16-aa-adjustUpgradeTest.diff.
Modified:
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_11.java
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_11.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_11.java?rev=1584721&r1=1584720&r2=1584721&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_11.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_11.java Fri Apr 4 14:40:21 2014
@@ -51,6 +51,7 @@ public class Changes10_11 extends Upgrad
private static final String NOT_IMPLEMENTED = "0A000";
private static final String NO_ROWS_AFFECTED = "02000";
private static final String UNKNOWN_OPTIONAL_TOOL = "X0Y88";
+ private static final String UNRECOGNIZED_PROCEDURE = "42Y03";
//////////////////////////////////////////////////////////////////
//
@@ -414,6 +415,22 @@ public class Changes10_11 extends Upgrad
Properties properties = TestConfiguration.getSystemProperties();
if ( getBooleanProperty( properties, TestConfiguration.KEY_OMIT_LUCENE ) ) { return; }
+ Version initialVersion = new Version( getOldMajor(), getOldMinor(), 0, 0 );
+ Version firstVersionHavingBooleanType = new Version( 10, 7, 0, 0 );
+ Version firstVersionHavingOptionalTools = new Version( 10, 10, 0, 0 );
+
+ boolean hasBooleanDatatype = initialVersion.compareTo( firstVersionHavingBooleanType ) >= 0;
+ boolean hasOptionalTools = initialVersion.compareTo( firstVersionHavingOptionalTools ) >= 0;
+
+ String originalSQLState;
+ if ( !hasBooleanDatatype ) { originalSQLState = SYNTAX_ERROR; }
+ else if ( !hasOptionalTools ) { originalSQLState = UNRECOGNIZED_PROCEDURE; }
+ else { originalSQLState = UNKNOWN_OPTIONAL_TOOL; }
+
+ String softUpgradeSQLState;
+ if ( !hasOptionalTools ) { softUpgradeSQLState = UNRECOGNIZED_PROCEDURE; }
+ else { softUpgradeSQLState = HARD_UPGRADE_REQUIRED; }
+
String loadTool = "call syscs_util.syscs_register_tool( 'luceneSupport', true )";
String unloadTool = "call syscs_util.syscs_register_tool( 'luceneSupport', false )";
@@ -422,10 +439,10 @@ public class Changes10_11 extends Upgrad
{
case PH_CREATE:
case PH_POST_SOFT_UPGRADE:
- assertStatementError( UNKNOWN_OPTIONAL_TOOL, statement, loadTool );
+ assertStatementError( originalSQLState, statement, loadTool );
break;
case PH_SOFT_UPGRADE:
- assertStatementError( HARD_UPGRADE_REQUIRED, statement, loadTool );
+ assertStatementError( softUpgradeSQLState, statement, loadTool );
break;
case PH_HARD_UPGRADE:
statement.executeUpdate( loadTool );