db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mamta A. Satoor (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-6684) Failure in testDERBY5120NumRowsInSydependsForTrigger when upgrading from 10.11.1.0 to trunk
Date Tue, 12 Aug 2014 17:45:14 GMT

    [ https://issues.apache.org/jira/browse/DERBY-6684?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14094378#comment-14094378
] 

Mamta A. Satoor commented on DERBY-6684:
----------------------------------------

The test is failing because a drop table is being done on a table which is getting used in
a trigger. 
A table could be dropped even with a trigger dependency prior to Derby 10.11 but starting
10.11, as part of the fix for DERBY-2041(Trigger should register a dependency on tables and
columns used in its body), we keep such trigger dependencies in SYSDEPENDS and expect users
to drop the trigger first and then the table. A simple ij script below shows the expected
change in behavior between Derby releases.
create table ATDC_TAB1(c11 int, c12 int);
insert into ATDC_TAB1 values (1,11);
create table ATDC_BKUP1(c111 int, c112 int);
create trigger ATDC_TAB1_TRG1 after update 
	of C11 on ATDC_TAB1 REFERENCING old_table as old 
        for each statement 
       	MODE DB2SQL 
        insert into ATDC_BKUP1 select * from old;
--following DROP TABLE succeeds in 10.10 and earlier but fails in 10.11 and higher because
of trigger dependency.
drop table ATDC_BKUP1;

I will go ahead and fix the failing test. Thanks

> Failure in testDERBY5120NumRowsInSydependsForTrigger when upgrading from 10.11.1.0 to
trunk
> -------------------------------------------------------------------------------------------
>
>                 Key: DERBY-6684
>                 URL: https://issues.apache.org/jira/browse/DERBY-6684
>             Project: Derby
>          Issue Type: Bug
>          Components: Test
>    Affects Versions: 10.11.1.1
>            Reporter: Rick Hillegas
>            Assignee: Mamta A. Satoor
>
> I see the following error when running the upgrade tests on trunk with 10.11.1.0 as the
starting point of the trajectory:
> {noformat}
> There was 1 failure:
> 1) testDERBY5120NumRowsInSydependsForTrigger(org.apache.derbyTesting.functionTests.tests.upgradeTests.BasicSetup)junit.framework.ComparisonFailure:
Unexpected SQL state. expected:<[42Y5]5> but was:<[X0Y2]5>
> 	at org.apache.derbyTesting.junit.BaseJDBCTestCase.assertSQLState(BaseJDBCTestCase.java:876)
> 	at org.apache.derbyTesting.junit.BaseJDBCTestCase.assertSQLState(BaseJDBCTestCase.java:940)
> 	at org.apache.derbyTesting.junit.BaseJDBCTestCase.dropTable(BaseJDBCTestCase.java:1084)
> 	at org.apache.derbyTesting.junit.BaseJDBCTestCase.dropTable(BaseJDBCTestCase.java:1065)
> 	at org.apache.derbyTesting.functionTests.tests.upgradeTests.BasicSetup.preapreFortDERBY5120(BasicSetup.java:404)
> 	at org.apache.derbyTesting.functionTests.tests.upgradeTests.BasicSetup.testDERBY5120NumRowsInSydependsForTrigger(BasicSetup.java:487)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:118)
> 	at org.apache.derbyTesting.junit.BaseJDBCTestCase.runBareOverridable(BaseJDBCTestCase.java:440)
> 	at org.apache.derbyTesting.junit.BaseJDBCTestCase.runBare(BaseJDBCTestCase.java:457)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
> 	at junit.extensions.TestSetup.run(TestSetup.java:25)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
> 	at junit.extensions.TestSetup.run(TestSetup.java:25)
> 	at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
> 	at junit.extensions.TestSetup.run(TestSetup.java:25)
> 	at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
> 	at junit.extensions.TestSetup.run(TestSetup.java:25)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
> 	at junit.extensions.TestSetup.run(TestSetup.java:25)
> 	at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
> 	at junit.extensions.TestSetup.run(TestSetup.java:25)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
> 	at junit.extensions.TestSetup.run(TestSetup.java:25)
> 	at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
> 	at junit.extensions.TestSetup.run(TestSetup.java:25)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
> 	at junit.extensions.TestSetup.run(TestSetup.java:25)
> 	at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
> 	at junit.extensions.TestSetup.run(TestSetup.java:25)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
> 	at junit.extensions.TestSetup.run(TestSetup.java:25)
> 	at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
> 	at junit.extensions.TestSetup.run(TestSetup.java:25)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
> 	at junit.extensions.TestSetup.run(TestSetup.java:25)
> 	at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
> 	at junit.extensions.TestSetup.run(TestSetup.java:25)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
> 	at junit.extensions.TestSetup.run(TestSetup.java:25)
> 	at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
> 	at junit.extensions.TestSetup.run(TestSetup.java:25)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
> 	at junit.extensions.TestSetup.run(TestSetup.java:25)
> 	at junit.extensions.TestDecorator.basicRun(TestDecorator.java:24)
> 	at junit.extensions.TestSetup$1.protect(TestSetup.java:21)
> 	at junit.extensions.TestSetup.run(TestSetup.java:25)
> Caused by: java.sql.SQLException: Operation 'DROP TABLE' cannot be performed on object
'ATDC_BKUP1' because TRIGGER 'ATDC_TAB1_TRG1' is dependent on that object.
> 	at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeLargeUpdate(Unknown Source)
> 	at org.apache.derby.impl.jdbc.EmbedStatement.executeUpdate(Unknown Source)
> 	at org.apache.derbyTesting.junit.BaseJDBCTestCase.dropTable(BaseJDBCTestCase.java:1082)
> 	... 109 more
> Caused by: ERROR X0Y25: Operation 'DROP TABLE' cannot be performed on object 'ATDC_BKUP1'
because TRIGGER 'ATDC_TAB1_TRG1' is dependent on that object.
> 	at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
> 	at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
> 	at org.apache.derby.iapi.sql.dictionary.TriggerDescriptor.prepareToInvalidate(Unknown
Source)
> 	at org.apache.derby.impl.sql.depend.BasicDependencyManager.coreInvalidateFor(Unknown
Source)
> 	at org.apache.derby.impl.sql.depend.BasicDependencyManager.invalidateFor(Unknown Source)
> 	at org.apache.derby.impl.sql.execute.DropTableConstantAction.executeConstantAction(Unknown
Source)
> 	at org.apache.derby.impl.sql.execute.MiscResultSet.open(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source)
> 	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
> 	... 114 more
> FAILURES!!!
> Tests run: 145,  Failures: 1,  Errors: 0
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message