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

Kathey Marsden commented on DERBY-39:
-------------------------------------

When I run the repro attached to this bug with a trunk sane build I get:
ij> INSERT INTO SubShape (nID, nSubID) SELECT nID, nSubID FROM Test;
java.sql.SQLException: Java exception: 'ASSERT FAILED col1.getClass() (class 
org.apache.derby.iapi.types.SQLInteger) exp
ected to be the same as col2.getClass() (class 
org.apache.derby.iapi.types.SQLLongint): org.apache.derby.shared.common.s
anity.AssertFailure'.
        at 
org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:95)
        at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:88)
        at org.apache.derby.impl.jdbc.Util.javaException(Util.java:245)
        at 
org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java:403)
        at 
org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java:346)
        at 
org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java:1878)
        at 
org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java:81)
        at 
org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1324)
        at 
org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(EmbedPreparedStatement.java:1650)
        at 
org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(EmbedPreparedStatement.java:299)
        at SubShape.insert(SubShape.java:37)
        at 
org.apache.derby.exe.ac12564092x0117xf01cxf31fx00000011ade01.g0(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:45)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:599)
        at 
org.apache.derby.impl.services.reflect.ReflectMethod.invoke(ReflectMethod.java:46)
        at 
org.apache.derby.impl.sql.execute.CallStatementResultSet.open(CallStatementResultSet.java:90)
        at 
org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:372)
        at 
org.apache.derby.impl.sql.execute.GenericTriggerExecutor.executeSPS(GenericTriggerExecutor.java:159)
        at 
org.apache.derby.impl.sql.execute.StatementTriggerExecutor.fireTrigger(StatementTriggerExecutor.java:80)
        at 
org.apache.derby.impl.sql.execute.TriggerEventActivator.notifyEvent(TriggerEventActivator.java:269)
        at 
org.apache.derby.impl.sql.execute.InsertResultSet.normalInsertCore(InsertResultSet.java:1150)
        at 
org.apache.derby.impl.sql.execute.InsertResultSet.open(InsertResultSet.java:487)
        at 
org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:372)
        at 
org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1234)
        at 
org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:624)
        at 
org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:556)
        at org.apache.derby.impl.tools.ij.ij.executeImmediate(ij.java:330)
        at org.apache.derby.impl.tools.ij.utilMain.doCatch(utilMain.java:508)
        at 
org.apache.derby.impl.tools.ij.utilMain.runScriptGuts(utilMain.java:350)
        at org.apache.derby.impl.tools.ij.utilMain.go(utilMain.java:248)
        at org.apache.derby.impl.tools.ij.Main.go(Main.java:215)
        at org.apache.derby.impl.tools.ij.Main.mainCore(Main.java:181)
        at org.apache.derby.impl.tools.ij.Main.main(Main.java:73)
        at org.apache.derby.tools.ij.main(ij.java:59)
Caused by: java.sql.SQLException: Java exception: 'ASSERT FAILED 
col1.getClass() (class org.apache.derby.iapi.types.SQLI
nteger) expected to be the same as col2.getClass() (class 
org.apache.derby.iapi.types.SQLLongint): org.apache.derby.shar
ed.common.sanity.AssertFailure'.
        at 
org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:45)
        at 
org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory40.java:13
5)
        at 
org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(SQLExceptionFactory40.java:70)
        ... 35 more
Caused by: org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED 
col1.getClass() (class org.apache.derby.ia
pi.types.SQLInteger) expected to be the same as col2.getClass() (class 
org.apache.derby.iapi.types.SQLLongint)
        at 
org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:162)
        at 
org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:147)
        at 
org.apache.derby.impl.store.access.sort.MergeSort.checkColumnTypes(MergeSort.java:472)
        at 
org.apache.derby.impl.store.access.sort.MergeInserter.insert(MergeInserter.java:98)
        at 
org.apache.derby.impl.sql.execute.SortResultSet.loadSorter(SortResultSet.java:317)
        at 
org.apache.derby.impl.sql.execute.SortResultSet.openCore(SortResultSet.java:268)
        at 
org.apache.derby.impl.sql.execute.NormalizeResultSet.openCore(NormalizeResultSet.java:147)
        at 
org.apache.derby.impl.sql.execute.InsertResultSet.open(InsertResultSet.java:407)
        at 
org.apache.derby.impl.sql.GenericPreparedStatement.execute(GenericPreparedStatement.java:372)
        at 
org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(EmbedStatement.java:1234)
        ... 28 more
ERROR XJ001: Java exception: ': java.lang.NullPointerException'.
ij> [C:/kmarsden/repro/derby-39/derby-joinon]

It passes with 10.2 but won't run with 10.1 because the CALL syntax in CREATE 
TRIGGER is not supported.   I tend to think the repro is a new issue and a 
regression. If noone objects I will open a new issue for the 
regression and close DERBY-39 CannotReproduce.




> Strange error in JOIN ON clause
> -------------------------------
>
>                 Key: DERBY-39
>                 URL: https://issues.apache.org/jira/browse/DERBY-39
>             Project: Derby
>          Issue Type: Bug
>          Components: Newcomer, SQL
>    Affects Versions: 10.0.2.0
>            Reporter: Erik Bengtson
>         Attachments: derby-joinon.tar.gz
>
>
> The exception:
> ---------------------------------------
> Error: An ON clause associated with a JOIN operator is not valid.
> ---------------------------------------
> happens when I run the below SQL script:
> ---------------------------------------
> SELECT
> THIS.DOSSIERTEMPLATE_ID
> FROM DOSSIERTEMPLATE THIS,
> ENTITLEMENT UNBOUND_ENTITLE 
> INNER JOIN 
> ENTITLEMENT II 
> ON UNBOUND_ENTITLE.ENTITLEMENT_ID = II.ENTITLEMENT_ID 
> INNER JOIN 
> DOSSIERTEMPLATERESOURCE BB 
> ON II.ENTITLED_TO_RESOURCE_ID_OID = BB.DOSSIERTEMPLATERESOURCE_ID 
> INNER JOIN 
> I18N THIS_LABEL
> ON THIS.LABEL_I18N_ID_OID = THIS_LABEL.I18N_ID
> ---------------------------------------
> It works fine if I run without the LABEL join
> ---------------------------------------
> SELECT
> THIS.DOSSIERTEMPLATE_ID
> FROM DOSSIERTEMPLATE THIS,
> ENTITLEMENT UNBOUND_ENTITLE 
> INNER JOIN 
> ENTITLEMENT II 
> ON UNBOUND_ENTITLE.ENTITLEMENT_ID = II.ENTITLEMENT_ID 
> INNER JOIN 
> DOSSIERTEMPLATERESOURCE BB 
> ON II.ENTITLED_TO_RESOURCE_ID_OID = BB.DOSSIERTEMPLATERESOURCE_ID 
> ---------------------------------------
> The column LABEL_I18N_ID_OID is BIGINT and has a FK to I18N_ID, which is 
> BIGINT as well

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to