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 2011/11/03 20:04:33 UTC
svn commit: r1197272 -
/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_9.java
Author: rhillegas
Date: Thu Nov 3 19:04:32 2011
New Revision: 1197272
URL: http://svn.apache.org/viewvc?rev=1197272&view=rev
Log:
DERBY-5486: Remove useless tests which are causing instabilities in the nightly test runs.
Modified:
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_9.java
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_9.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_9.java?rev=1197272&r1=1197271&r2=1197272&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_9.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/Changes10_9.java Thu Nov 3 19:04:32 2011
@@ -156,149 +156,4 @@ public class Changes10_9 extends Upgrade
assertEquals( expectedRowCount, actualRowCount );
}
- /**
- * Make sure that generator-based identity columns don't break upgrade/downgrade.
- * See DERBY-4437. Originally, this behavior was backported to 10.8.2. However, the behavior
- * was backed out of 10.8.2.
- */
- public void testIdentity10_8_2() throws Exception
- {
- Statement s = createStatement();
-
- boolean supportsSequences = oldAtLeast( 10, 6 );
-
- switch ( getPhase() )
- {
- case PH_CREATE: // create with old version
- s.execute( "create table t_identity1_4437( a int, b int generated always as identity )" );
- s.execute( "insert into t_identity1_4437( a ) values ( 100 )" );
- vetIdentityValues_4437( s, "t_identity1_4437", 1, 2 );
-
- if ( supportsSequences )
- {
- s.execute( "create sequence seq1_4437" );
- vetSequenceValue( s, "seq1_4437", -2147483648, -2147483643 );
- }
-
- break;
-
- case PH_SOFT_UPGRADE: // boot with new version and soft-upgrade
- s.execute( "insert into t_identity1_4437( a ) values ( 200 )" );
- vetIdentityValues_4437( s, "t_identity1_4437", 2, 22 );
-
- s.execute( "create table t_identity2_4437( a int, b int generated always as identity )" );
- s.execute( "insert into t_identity2_4437( a ) values ( 100 )" );
- vetIdentityValues_4437( s, "t_identity2_4437", 1, 21 );
-
- if ( supportsSequences )
- {
- vetSequenceValue( s, "seq1_4437", -2147483643, -2147483623 );
-
- s.execute( "create sequence seq2_4437" );
- vetSequenceValue( s, "seq2_4437", -2147483648, -2147483628 );
- }
-
- break;
-
- case PH_POST_SOFT_UPGRADE: // soft-downgrade: boot with old version after soft-upgrade
- s.execute( "insert into t_identity1_4437( a ) values ( 300 )" );
- vetIdentityValues_4437( s, "t_identity1_4437", 3, 4 );
-
- s.execute( "insert into t_identity2_4437( a ) values ( 200 )" );
- vetIdentityValues_4437( s, "t_identity2_4437", 2, 3 );
-
- if ( supportsSequences )
- {
- vetSequenceValue( s, "seq1_4437", -2147483642, -2147483637 );
- vetSequenceValue( s, "seq2_4437", -2147483647, -2147483642 );
- }
-
- break;
-
- case PH_HARD_UPGRADE: // boot with new version and hard-upgrade
- s.execute( "insert into t_identity1_4437( a ) values ( 400 )" );
- vetIdentityValues_4437( s, "t_identity1_4437", 4, 24 );
-
- s.execute( "insert into t_identity2_4437( a ) values ( 300 )" );
- vetIdentityValues_4437( s, "t_identity2_4437", 3, 23 );
-
- if ( supportsSequences )
- {
- vetSequenceValue( s, "seq1_4437", -2147483637, -2147483617 );
- vetSequenceValue( s, "seq2_4437", -2147483642, -2147483622 );
- }
-
- break;
- }
-
- s.close();
- }
- private void vetIdentityValues_4437( Statement s, String tableName, int expectedRowCount, int expectedSyscolumnsValue ) throws Exception
- {
- vetTable( s, tableName, expectedRowCount );
-
- ResultSet rs = s.executeQuery
- (
- "select c.autoincrementvalue\n" +
- "from sys.syscolumns c, sys.systables t\n" +
- "where t.tablename = '" + tableName.toUpperCase() + "'\n" +
- "and t.tableid = c.referenceid\n" +
- "and c.columnname = 'B'"
- );
- rs.next();
- int actualSyscolumnsValue = rs.getInt( 1 );
- vetValues( expectedSyscolumnsValue, actualSyscolumnsValue );
- rs.close();
- }
- private void vetSequenceValue( Statement s, String sequenceName, int expectedSequenceValue, int expectedSyssequencesValue ) throws Exception
- {
- ResultSet rs = s.executeQuery( "values ( next value for " + sequenceName + " )" );
- rs.next();
- int actualSequenceValue = rs.getInt( 1 );
- vetValues( expectedSequenceValue, actualSequenceValue );
- rs.close();
-
- rs = s.executeQuery
- (
- "select currentvalue\n" +
- "from sys.syssequences\n" +
- "where sequencename = '" + sequenceName.toUpperCase() + "'\n"
- );
- rs.next();
- int actualSyssequencesValue = rs.getInt( 1 );
- vetValues( expectedSyssequencesValue, actualSyssequencesValue );
- rs.close();
- }
- private void vetTable( Statement s, String tableName, int expectedRowCount ) throws Exception
- {
- int actualRowCount = 0;
- int lastValue = 0;
-
- ResultSet rs = s.executeQuery( "select * from " + tableName + " order by a" );
-
- while( rs.next() )
- {
- actualRowCount++;
-
- int currentValue = rs.getInt( 2 );
- if ( actualRowCount > 1 )
- {
- assertTrue( currentValue > lastValue );
- }
- lastValue = currentValue;
- }
- rs.close();
-
- vetValues( expectedRowCount, actualRowCount );
- }
- private void vetValues( int expected, int actual ) throws Exception
- {
- assertEquals
- (
- getOldVersionString(),
- expected,
- actual
- );
- }
-
}