You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Christian d'Heureuse (JIRA)" <ji...@apache.org> on 2007/01/11 02:43:27 UTC

[jira] Created: (DERBY-2230) AssertFailure: ByteCode Conditional then/else stack mismatch

AssertFailure: ByteCode Conditional then/else stack mismatch
------------------------------------------------------------

                 Key: DERBY-2230
                 URL: https://issues.apache.org/jira/browse/DERBY-2230
             Project: Derby
          Issue Type: Bug
          Components: SQL
    Affects Versions: 10.2.2.0
         Environment: The AssertFailure error occurs only with the debug version of derby.jar.
Java 1.5
            Reporter: Christian d'Heureuse


The following statements produce an AssertFailure exception:

CREATE TABLE table1 (
   s VARCHAR(10));

SELECT 1
   FROM table1 a
      INNER JOIN table1 b ON
         a.s =
            CASE
               WHEN 1=1 THEN '0'
               ELSE SUBSTR(b.s,1,1) END;


Stack trace:

org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED ByteCode Conditional then/else stack mismatch: then: Lorg/apache/derby/iapi/types/StringDataValue; else: Lorg/apache/derby/iapi/types/ConcatableDataValue;
        at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:149)
        at org.apache.derby.impl.services.bytecode.Conditional.end(Conditional.java:216)
        at org.apache.derby.impl.services.bytecode.BCMethod.completeConditional(BCMethod.java:1063)
        at org.apache.derby.impl.sql.compile.ConditionalNode.generateExpression(ConditionalNode.java:468)
        at org.apache.derby.impl.sql.compile.BinaryRelationalOperatorNode.generateQualMethod(BinaryRelationalOperatorNode.java:708)
        at org.apache.derby.impl.sql.compile.PredicateList.generateSingleQualifierCode(PredicateList.java:2723)
        at org.apache.derby.impl.sql.compile.PredicateList.generateQualifiers(PredicateList.java:2905)
        at org.apache.derby.impl.sql.compile.HashJoinStrategy.getScanArgs(HashJoinStrategy.java:348)
        at org.apache.derby.impl.sql.compile.FromBaseTable.getScanArguments(FromBaseTable.java:3368)
        at org.apache.derby.impl.sql.compile.FromBaseTable.generateResultSet(FromBaseTable.java:3059)
        at org.apache.derby.impl.sql.compile.FromBaseTable.generate(FromBaseTable.java:2986)
        at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1352)
        at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1303)
        at org.apache.derby.impl.sql.compile.JoinNode.getJoinArguments(JoinNode.java:1580)
        at org.apache.derby.impl.sql.compile.JoinNode.generateCore(JoinNode.java:1556)
        at org.apache.derby.impl.sql.compile.JoinNode.generate(JoinNode.java:1480)
        at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1441)
        at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1303)
        at org.apache.derby.impl.sql.compile.ScrollInsensitiveResultSetNode.generate(ScrollInsensitiveResultSetNode.java:110)
        at org.apache.derby.impl.sql.compile.CursorNode.generate(CursorNode.java:583)
        at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:233)
        at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:478)
        at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:119)
        at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:745)
        at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:568)
        at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:517)
        at org.apache.derby.impl.tools.ij.ij.executeImmediate(Unknown Source)
        at org.apache.derby.impl.tools.ij.utilMain.doCatch(Unknown Source)
        at org.apache.derby.impl.tools.ij.utilMain.go(Unknown Source)
        at org.apache.derby.impl.tools.ij.Main.go(Unknown Source)
        at org.apache.derby.impl.tools.ij.Main.mainCore(Unknown Source)
        at org.apache.derby.impl.tools.ij.Main14.main(Unknown Source)
        at org.apache.derby.tools.ij.main(Unknown Source)


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (DERBY-2230) AssertFailure: ByteCode Conditional then/else stack mismatch

Posted by "Mayuresh Nirhali (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12488395 ] 

Mayuresh Nirhali commented on DERBY-2230:
-----------------------------------------

The assert is reproducible on trunk as well. When I tried the last time, I think I ran on non-debug version of trunk.

The return types of 'else' and 'then' clauses in the conditional query must be matched. If they are not matched or if one of the types are not assignable to the other, 42X89 is thrown.

In this particular example, when debug flag is set, type.vmName for return type of both 'else' and 'then' clause are checked and found to be not equal. This check does not validate if one of them is assignable to the other, hence the assert.

> AssertFailure: ByteCode Conditional then/else stack mismatch
> ------------------------------------------------------------
>
>                 Key: DERBY-2230
>                 URL: https://issues.apache.org/jira/browse/DERBY-2230
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.2.0
>         Environment: The AssertFailure error occurs only with the debug version of derby.jar.
> Java 1.5
>            Reporter: Christian d'Heureuse
>         Assigned To: Mayuresh Nirhali
>             Fix For: 10.2.2.1
>
>
> The following statements produce an AssertFailure exception:
> CREATE TABLE table1 (
>    s VARCHAR(10));
> SELECT 1
>    FROM table1 a
>       INNER JOIN table1 b ON
>          a.s =
>             CASE
>                WHEN 1=1 THEN '0'
>                ELSE SUBSTR(b.s,1,1) END;
> Stack trace:
> org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED ByteCode Conditional then/else stack mismatch: then: Lorg/apache/derby/iapi/types/StringDataValue; else: Lorg/apache/derby/iapi/types/ConcatableDataValue;
>         at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:149)
>         at org.apache.derby.impl.services.bytecode.Conditional.end(Conditional.java:216)
>         at org.apache.derby.impl.services.bytecode.BCMethod.completeConditional(BCMethod.java:1063)
>         at org.apache.derby.impl.sql.compile.ConditionalNode.generateExpression(ConditionalNode.java:468)
>         at org.apache.derby.impl.sql.compile.BinaryRelationalOperatorNode.generateQualMethod(BinaryRelationalOperatorNode.java:708)
>         at org.apache.derby.impl.sql.compile.PredicateList.generateSingleQualifierCode(PredicateList.java:2723)
>         at org.apache.derby.impl.sql.compile.PredicateList.generateQualifiers(PredicateList.java:2905)
>         at org.apache.derby.impl.sql.compile.HashJoinStrategy.getScanArgs(HashJoinStrategy.java:348)
>         at org.apache.derby.impl.sql.compile.FromBaseTable.getScanArguments(FromBaseTable.java:3368)
>         at org.apache.derby.impl.sql.compile.FromBaseTable.generateResultSet(FromBaseTable.java:3059)
>         at org.apache.derby.impl.sql.compile.FromBaseTable.generate(FromBaseTable.java:2986)
>         at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1352)
>         at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1303)
>         at org.apache.derby.impl.sql.compile.JoinNode.getJoinArguments(JoinNode.java:1580)
>         at org.apache.derby.impl.sql.compile.JoinNode.generateCore(JoinNode.java:1556)
>         at org.apache.derby.impl.sql.compile.JoinNode.generate(JoinNode.java:1480)
>         at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1441)
>         at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1303)
>         at org.apache.derby.impl.sql.compile.ScrollInsensitiveResultSetNode.generate(ScrollInsensitiveResultSetNode.java:110)
>         at org.apache.derby.impl.sql.compile.CursorNode.generate(CursorNode.java:583)
>         at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:233)
>         at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:478)
>         at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:119)
>         at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:745)
>         at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:568)
>         at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:517)
>         at org.apache.derby.impl.tools.ij.ij.executeImmediate(Unknown Source)
>         at org.apache.derby.impl.tools.ij.utilMain.doCatch(Unknown Source)
>         at org.apache.derby.impl.tools.ij.utilMain.go(Unknown Source)
>         at org.apache.derby.impl.tools.ij.Main.go(Unknown Source)
>         at org.apache.derby.impl.tools.ij.Main.mainCore(Unknown Source)
>         at org.apache.derby.impl.tools.ij.Main14.main(Unknown Source)
>         at org.apache.derby.tools.ij.main(Unknown Source)

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


[jira] Updated: (DERBY-2230) AssertFailure: ByteCode Conditional then/else stack mismatch

Posted by "Mayuresh Nirhali (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2230?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mayuresh Nirhali updated DERBY-2230:
------------------------------------

    Fix Version/s: 10.2.2.1

> AssertFailure: ByteCode Conditional then/else stack mismatch
> ------------------------------------------------------------
>
>                 Key: DERBY-2230
>                 URL: https://issues.apache.org/jira/browse/DERBY-2230
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.2.0
>         Environment: The AssertFailure error occurs only with the debug version of derby.jar.
> Java 1.5
>            Reporter: Christian d'Heureuse
>         Assigned To: Mayuresh Nirhali
>             Fix For: 10.2.2.1
>
>
> The following statements produce an AssertFailure exception:
> CREATE TABLE table1 (
>    s VARCHAR(10));
> SELECT 1
>    FROM table1 a
>       INNER JOIN table1 b ON
>          a.s =
>             CASE
>                WHEN 1=1 THEN '0'
>                ELSE SUBSTR(b.s,1,1) END;
> Stack trace:
> org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED ByteCode Conditional then/else stack mismatch: then: Lorg/apache/derby/iapi/types/StringDataValue; else: Lorg/apache/derby/iapi/types/ConcatableDataValue;
>         at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:149)
>         at org.apache.derby.impl.services.bytecode.Conditional.end(Conditional.java:216)
>         at org.apache.derby.impl.services.bytecode.BCMethod.completeConditional(BCMethod.java:1063)
>         at org.apache.derby.impl.sql.compile.ConditionalNode.generateExpression(ConditionalNode.java:468)
>         at org.apache.derby.impl.sql.compile.BinaryRelationalOperatorNode.generateQualMethod(BinaryRelationalOperatorNode.java:708)
>         at org.apache.derby.impl.sql.compile.PredicateList.generateSingleQualifierCode(PredicateList.java:2723)
>         at org.apache.derby.impl.sql.compile.PredicateList.generateQualifiers(PredicateList.java:2905)
>         at org.apache.derby.impl.sql.compile.HashJoinStrategy.getScanArgs(HashJoinStrategy.java:348)
>         at org.apache.derby.impl.sql.compile.FromBaseTable.getScanArguments(FromBaseTable.java:3368)
>         at org.apache.derby.impl.sql.compile.FromBaseTable.generateResultSet(FromBaseTable.java:3059)
>         at org.apache.derby.impl.sql.compile.FromBaseTable.generate(FromBaseTable.java:2986)
>         at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1352)
>         at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1303)
>         at org.apache.derby.impl.sql.compile.JoinNode.getJoinArguments(JoinNode.java:1580)
>         at org.apache.derby.impl.sql.compile.JoinNode.generateCore(JoinNode.java:1556)
>         at org.apache.derby.impl.sql.compile.JoinNode.generate(JoinNode.java:1480)
>         at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1441)
>         at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1303)
>         at org.apache.derby.impl.sql.compile.ScrollInsensitiveResultSetNode.generate(ScrollInsensitiveResultSetNode.java:110)
>         at org.apache.derby.impl.sql.compile.CursorNode.generate(CursorNode.java:583)
>         at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:233)
>         at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:478)
>         at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:119)
>         at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:745)
>         at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:568)
>         at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:517)
>         at org.apache.derby.impl.tools.ij.ij.executeImmediate(Unknown Source)
>         at org.apache.derby.impl.tools.ij.utilMain.doCatch(Unknown Source)
>         at org.apache.derby.impl.tools.ij.utilMain.go(Unknown Source)
>         at org.apache.derby.impl.tools.ij.Main.go(Unknown Source)
>         at org.apache.derby.impl.tools.ij.Main.mainCore(Unknown Source)
>         at org.apache.derby.impl.tools.ij.Main14.main(Unknown Source)
>         at org.apache.derby.tools.ij.main(Unknown Source)

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


[jira] Updated: (DERBY-2230) AssertFailure: ByteCode Conditional then/else stack mismatch

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2230?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kathey Marsden updated DERBY-2230:
----------------------------------

    Derby Info:   (was: [Patch Available])

I committed this patch but I do think it would be good to add this test case to an existing test.

> AssertFailure: ByteCode Conditional then/else stack mismatch
> ------------------------------------------------------------
>
>                 Key: DERBY-2230
>                 URL: https://issues.apache.org/jira/browse/DERBY-2230
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.2.0
>         Environment: The AssertFailure error occurs only with the debug version of derby.jar.
> Java 1.5
>            Reporter: Christian d'Heureuse
>         Assigned To: Mayuresh Nirhali
>             Fix For: 10.2.2.1, 10.3.0.0
>
>         Attachments: derby2230.diff
>
>
> The following statements produce an AssertFailure exception:
> CREATE TABLE table1 (
>    s VARCHAR(10));
> SELECT 1
>    FROM table1 a
>       INNER JOIN table1 b ON
>          a.s =
>             CASE
>                WHEN 1=1 THEN '0'
>                ELSE SUBSTR(b.s,1,1) END;
> Stack trace:
> org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED ByteCode Conditional then/else stack mismatch: then: Lorg/apache/derby/iapi/types/StringDataValue; else: Lorg/apache/derby/iapi/types/ConcatableDataValue;
>         at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:149)
>         at org.apache.derby.impl.services.bytecode.Conditional.end(Conditional.java:216)
>         at org.apache.derby.impl.services.bytecode.BCMethod.completeConditional(BCMethod.java:1063)
>         at org.apache.derby.impl.sql.compile.ConditionalNode.generateExpression(ConditionalNode.java:468)
>         at org.apache.derby.impl.sql.compile.BinaryRelationalOperatorNode.generateQualMethod(BinaryRelationalOperatorNode.java:708)
>         at org.apache.derby.impl.sql.compile.PredicateList.generateSingleQualifierCode(PredicateList.java:2723)
>         at org.apache.derby.impl.sql.compile.PredicateList.generateQualifiers(PredicateList.java:2905)
>         at org.apache.derby.impl.sql.compile.HashJoinStrategy.getScanArgs(HashJoinStrategy.java:348)
>         at org.apache.derby.impl.sql.compile.FromBaseTable.getScanArguments(FromBaseTable.java:3368)
>         at org.apache.derby.impl.sql.compile.FromBaseTable.generateResultSet(FromBaseTable.java:3059)
>         at org.apache.derby.impl.sql.compile.FromBaseTable.generate(FromBaseTable.java:2986)
>         at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1352)
>         at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1303)
>         at org.apache.derby.impl.sql.compile.JoinNode.getJoinArguments(JoinNode.java:1580)
>         at org.apache.derby.impl.sql.compile.JoinNode.generateCore(JoinNode.java:1556)
>         at org.apache.derby.impl.sql.compile.JoinNode.generate(JoinNode.java:1480)
>         at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1441)
>         at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1303)
>         at org.apache.derby.impl.sql.compile.ScrollInsensitiveResultSetNode.generate(ScrollInsensitiveResultSetNode.java:110)
>         at org.apache.derby.impl.sql.compile.CursorNode.generate(CursorNode.java:583)
>         at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:233)
>         at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:478)
>         at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:119)
>         at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:745)
>         at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:568)
>         at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:517)
>         at org.apache.derby.impl.tools.ij.ij.executeImmediate(Unknown Source)
>         at org.apache.derby.impl.tools.ij.utilMain.doCatch(Unknown Source)
>         at org.apache.derby.impl.tools.ij.utilMain.go(Unknown Source)
>         at org.apache.derby.impl.tools.ij.Main.go(Unknown Source)
>         at org.apache.derby.impl.tools.ij.Main.mainCore(Unknown Source)
>         at org.apache.derby.impl.tools.ij.Main14.main(Unknown Source)
>         at org.apache.derby.tools.ij.main(Unknown Source)

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


[jira] Commented: (DERBY-2230) AssertFailure: ByteCode Conditional then/else stack mismatch

Posted by "Christian d'Heureuse (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12463880 ] 

Christian d'Heureuse commented on DERBY-2230:
---------------------------------------------

I found a simpler version to produce the AssertFailure:

CREATE TABLE table1 (
   s VARCHAR(10));

SELECT CASE WHEN 1=1 THEN '0' ELSE SUBSTR(s,1,1) END
   FROM table1;


> AssertFailure: ByteCode Conditional then/else stack mismatch
> ------------------------------------------------------------
>
>                 Key: DERBY-2230
>                 URL: https://issues.apache.org/jira/browse/DERBY-2230
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.2.0
>         Environment: The AssertFailure error occurs only with the debug version of derby.jar.
> Java 1.5
>            Reporter: Christian d'Heureuse
>
> The following statements produce an AssertFailure exception:
> CREATE TABLE table1 (
>    s VARCHAR(10));
> SELECT 1
>    FROM table1 a
>       INNER JOIN table1 b ON
>          a.s =
>             CASE
>                WHEN 1=1 THEN '0'
>                ELSE SUBSTR(b.s,1,1) END;
> Stack trace:
> org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED ByteCode Conditional then/else stack mismatch: then: Lorg/apache/derby/iapi/types/StringDataValue; else: Lorg/apache/derby/iapi/types/ConcatableDataValue;
>         at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:149)
>         at org.apache.derby.impl.services.bytecode.Conditional.end(Conditional.java:216)
>         at org.apache.derby.impl.services.bytecode.BCMethod.completeConditional(BCMethod.java:1063)
>         at org.apache.derby.impl.sql.compile.ConditionalNode.generateExpression(ConditionalNode.java:468)
>         at org.apache.derby.impl.sql.compile.BinaryRelationalOperatorNode.generateQualMethod(BinaryRelationalOperatorNode.java:708)
>         at org.apache.derby.impl.sql.compile.PredicateList.generateSingleQualifierCode(PredicateList.java:2723)
>         at org.apache.derby.impl.sql.compile.PredicateList.generateQualifiers(PredicateList.java:2905)
>         at org.apache.derby.impl.sql.compile.HashJoinStrategy.getScanArgs(HashJoinStrategy.java:348)
>         at org.apache.derby.impl.sql.compile.FromBaseTable.getScanArguments(FromBaseTable.java:3368)
>         at org.apache.derby.impl.sql.compile.FromBaseTable.generateResultSet(FromBaseTable.java:3059)
>         at org.apache.derby.impl.sql.compile.FromBaseTable.generate(FromBaseTable.java:2986)
>         at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1352)
>         at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1303)
>         at org.apache.derby.impl.sql.compile.JoinNode.getJoinArguments(JoinNode.java:1580)
>         at org.apache.derby.impl.sql.compile.JoinNode.generateCore(JoinNode.java:1556)
>         at org.apache.derby.impl.sql.compile.JoinNode.generate(JoinNode.java:1480)
>         at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1441)
>         at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1303)
>         at org.apache.derby.impl.sql.compile.ScrollInsensitiveResultSetNode.generate(ScrollInsensitiveResultSetNode.java:110)
>         at org.apache.derby.impl.sql.compile.CursorNode.generate(CursorNode.java:583)
>         at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:233)
>         at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:478)
>         at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:119)
>         at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:745)
>         at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:568)
>         at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:517)
>         at org.apache.derby.impl.tools.ij.ij.executeImmediate(Unknown Source)
>         at org.apache.derby.impl.tools.ij.utilMain.doCatch(Unknown Source)
>         at org.apache.derby.impl.tools.ij.utilMain.go(Unknown Source)
>         at org.apache.derby.impl.tools.ij.Main.go(Unknown Source)
>         at org.apache.derby.impl.tools.ij.Main.mainCore(Unknown Source)
>         at org.apache.derby.impl.tools.ij.Main14.main(Unknown Source)
>         at org.apache.derby.tools.ij.main(Unknown Source)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Assigned: (DERBY-2230) AssertFailure: ByteCode Conditional then/else stack mismatch

Posted by "Mayuresh Nirhali (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2230?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mayuresh Nirhali reassigned DERBY-2230:
---------------------------------------

    Assignee: Mayuresh Nirhali

> AssertFailure: ByteCode Conditional then/else stack mismatch
> ------------------------------------------------------------
>
>                 Key: DERBY-2230
>                 URL: https://issues.apache.org/jira/browse/DERBY-2230
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.2.0
>         Environment: The AssertFailure error occurs only with the debug version of derby.jar.
> Java 1.5
>            Reporter: Christian d'Heureuse
>         Assigned To: Mayuresh Nirhali
>             Fix For: 10.2.2.1
>
>
> The following statements produce an AssertFailure exception:
> CREATE TABLE table1 (
>    s VARCHAR(10));
> SELECT 1
>    FROM table1 a
>       INNER JOIN table1 b ON
>          a.s =
>             CASE
>                WHEN 1=1 THEN '0'
>                ELSE SUBSTR(b.s,1,1) END;
> Stack trace:
> org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED ByteCode Conditional then/else stack mismatch: then: Lorg/apache/derby/iapi/types/StringDataValue; else: Lorg/apache/derby/iapi/types/ConcatableDataValue;
>         at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:149)
>         at org.apache.derby.impl.services.bytecode.Conditional.end(Conditional.java:216)
>         at org.apache.derby.impl.services.bytecode.BCMethod.completeConditional(BCMethod.java:1063)
>         at org.apache.derby.impl.sql.compile.ConditionalNode.generateExpression(ConditionalNode.java:468)
>         at org.apache.derby.impl.sql.compile.BinaryRelationalOperatorNode.generateQualMethod(BinaryRelationalOperatorNode.java:708)
>         at org.apache.derby.impl.sql.compile.PredicateList.generateSingleQualifierCode(PredicateList.java:2723)
>         at org.apache.derby.impl.sql.compile.PredicateList.generateQualifiers(PredicateList.java:2905)
>         at org.apache.derby.impl.sql.compile.HashJoinStrategy.getScanArgs(HashJoinStrategy.java:348)
>         at org.apache.derby.impl.sql.compile.FromBaseTable.getScanArguments(FromBaseTable.java:3368)
>         at org.apache.derby.impl.sql.compile.FromBaseTable.generateResultSet(FromBaseTable.java:3059)
>         at org.apache.derby.impl.sql.compile.FromBaseTable.generate(FromBaseTable.java:2986)
>         at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1352)
>         at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1303)
>         at org.apache.derby.impl.sql.compile.JoinNode.getJoinArguments(JoinNode.java:1580)
>         at org.apache.derby.impl.sql.compile.JoinNode.generateCore(JoinNode.java:1556)
>         at org.apache.derby.impl.sql.compile.JoinNode.generate(JoinNode.java:1480)
>         at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1441)
>         at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1303)
>         at org.apache.derby.impl.sql.compile.ScrollInsensitiveResultSetNode.generate(ScrollInsensitiveResultSetNode.java:110)
>         at org.apache.derby.impl.sql.compile.CursorNode.generate(CursorNode.java:583)
>         at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:233)
>         at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:478)
>         at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:119)
>         at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:745)
>         at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:568)
>         at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:517)
>         at org.apache.derby.impl.tools.ij.ij.executeImmediate(Unknown Source)
>         at org.apache.derby.impl.tools.ij.utilMain.doCatch(Unknown Source)
>         at org.apache.derby.impl.tools.ij.utilMain.go(Unknown Source)
>         at org.apache.derby.impl.tools.ij.Main.go(Unknown Source)
>         at org.apache.derby.impl.tools.ij.Main.mainCore(Unknown Source)
>         at org.apache.derby.impl.tools.ij.Main14.main(Unknown Source)
>         at org.apache.derby.tools.ij.main(Unknown Source)

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


[jira] Updated: (DERBY-2230) AssertFailure: ByteCode Conditional then/else stack mismatch

Posted by "Mayuresh Nirhali (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2230?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mayuresh Nirhali updated DERBY-2230:
------------------------------------

    Attachment: derby2230_testv1.diff

patch adds another testcase to GroupByExpressionTest for this particular bug.

this new test patch is ready for review.

> AssertFailure: ByteCode Conditional then/else stack mismatch
> ------------------------------------------------------------
>
>                 Key: DERBY-2230
>                 URL: https://issues.apache.org/jira/browse/DERBY-2230
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.2.0
>         Environment: The AssertFailure error occurs only with the debug version of derby.jar.
> Java 1.5
>            Reporter: Christian d'Heureuse
>         Assigned To: Mayuresh Nirhali
>             Fix For: 10.2.2.1, 10.3.0.0
>
>         Attachments: derby2230.diff, derby2230_testv1.diff
>
>
> The following statements produce an AssertFailure exception:
> CREATE TABLE table1 (
>    s VARCHAR(10));
> SELECT 1
>    FROM table1 a
>       INNER JOIN table1 b ON
>          a.s =
>             CASE
>                WHEN 1=1 THEN '0'
>                ELSE SUBSTR(b.s,1,1) END;
> Stack trace:
> org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED ByteCode Conditional then/else stack mismatch: then: Lorg/apache/derby/iapi/types/StringDataValue; else: Lorg/apache/derby/iapi/types/ConcatableDataValue;
>         at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:149)
>         at org.apache.derby.impl.services.bytecode.Conditional.end(Conditional.java:216)
>         at org.apache.derby.impl.services.bytecode.BCMethod.completeConditional(BCMethod.java:1063)
>         at org.apache.derby.impl.sql.compile.ConditionalNode.generateExpression(ConditionalNode.java:468)
>         at org.apache.derby.impl.sql.compile.BinaryRelationalOperatorNode.generateQualMethod(BinaryRelationalOperatorNode.java:708)
>         at org.apache.derby.impl.sql.compile.PredicateList.generateSingleQualifierCode(PredicateList.java:2723)
>         at org.apache.derby.impl.sql.compile.PredicateList.generateQualifiers(PredicateList.java:2905)
>         at org.apache.derby.impl.sql.compile.HashJoinStrategy.getScanArgs(HashJoinStrategy.java:348)
>         at org.apache.derby.impl.sql.compile.FromBaseTable.getScanArguments(FromBaseTable.java:3368)
>         at org.apache.derby.impl.sql.compile.FromBaseTable.generateResultSet(FromBaseTable.java:3059)
>         at org.apache.derby.impl.sql.compile.FromBaseTable.generate(FromBaseTable.java:2986)
>         at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1352)
>         at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1303)
>         at org.apache.derby.impl.sql.compile.JoinNode.getJoinArguments(JoinNode.java:1580)
>         at org.apache.derby.impl.sql.compile.JoinNode.generateCore(JoinNode.java:1556)
>         at org.apache.derby.impl.sql.compile.JoinNode.generate(JoinNode.java:1480)
>         at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1441)
>         at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1303)
>         at org.apache.derby.impl.sql.compile.ScrollInsensitiveResultSetNode.generate(ScrollInsensitiveResultSetNode.java:110)
>         at org.apache.derby.impl.sql.compile.CursorNode.generate(CursorNode.java:583)
>         at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:233)
>         at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:478)
>         at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:119)
>         at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:745)
>         at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:568)
>         at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:517)
>         at org.apache.derby.impl.tools.ij.ij.executeImmediate(Unknown Source)
>         at org.apache.derby.impl.tools.ij.utilMain.doCatch(Unknown Source)
>         at org.apache.derby.impl.tools.ij.utilMain.go(Unknown Source)
>         at org.apache.derby.impl.tools.ij.Main.go(Unknown Source)
>         at org.apache.derby.impl.tools.ij.Main.mainCore(Unknown Source)
>         at org.apache.derby.impl.tools.ij.Main14.main(Unknown Source)
>         at org.apache.derby.tools.ij.main(Unknown Source)

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


[jira] Commented: (DERBY-2230) AssertFailure: ByteCode Conditional then/else stack mismatch

Posted by "Mayuresh Nirhali (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2230?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12487794 ] 

Mayuresh Nirhali commented on DERBY-2230:
-----------------------------------------

I did NOT see any assert failures when I ran on the latest trunk.

This failure is reproducible with 10.2.2.

> AssertFailure: ByteCode Conditional then/else stack mismatch
> ------------------------------------------------------------
>
>                 Key: DERBY-2230
>                 URL: https://issues.apache.org/jira/browse/DERBY-2230
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.2.0
>         Environment: The AssertFailure error occurs only with the debug version of derby.jar.
> Java 1.5
>            Reporter: Christian d'Heureuse
>
> The following statements produce an AssertFailure exception:
> CREATE TABLE table1 (
>    s VARCHAR(10));
> SELECT 1
>    FROM table1 a
>       INNER JOIN table1 b ON
>          a.s =
>             CASE
>                WHEN 1=1 THEN '0'
>                ELSE SUBSTR(b.s,1,1) END;
> Stack trace:
> org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED ByteCode Conditional then/else stack mismatch: then: Lorg/apache/derby/iapi/types/StringDataValue; else: Lorg/apache/derby/iapi/types/ConcatableDataValue;
>         at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:149)
>         at org.apache.derby.impl.services.bytecode.Conditional.end(Conditional.java:216)
>         at org.apache.derby.impl.services.bytecode.BCMethod.completeConditional(BCMethod.java:1063)
>         at org.apache.derby.impl.sql.compile.ConditionalNode.generateExpression(ConditionalNode.java:468)
>         at org.apache.derby.impl.sql.compile.BinaryRelationalOperatorNode.generateQualMethod(BinaryRelationalOperatorNode.java:708)
>         at org.apache.derby.impl.sql.compile.PredicateList.generateSingleQualifierCode(PredicateList.java:2723)
>         at org.apache.derby.impl.sql.compile.PredicateList.generateQualifiers(PredicateList.java:2905)
>         at org.apache.derby.impl.sql.compile.HashJoinStrategy.getScanArgs(HashJoinStrategy.java:348)
>         at org.apache.derby.impl.sql.compile.FromBaseTable.getScanArguments(FromBaseTable.java:3368)
>         at org.apache.derby.impl.sql.compile.FromBaseTable.generateResultSet(FromBaseTable.java:3059)
>         at org.apache.derby.impl.sql.compile.FromBaseTable.generate(FromBaseTable.java:2986)
>         at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1352)
>         at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1303)
>         at org.apache.derby.impl.sql.compile.JoinNode.getJoinArguments(JoinNode.java:1580)
>         at org.apache.derby.impl.sql.compile.JoinNode.generateCore(JoinNode.java:1556)
>         at org.apache.derby.impl.sql.compile.JoinNode.generate(JoinNode.java:1480)
>         at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1441)
>         at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1303)
>         at org.apache.derby.impl.sql.compile.ScrollInsensitiveResultSetNode.generate(ScrollInsensitiveResultSetNode.java:110)
>         at org.apache.derby.impl.sql.compile.CursorNode.generate(CursorNode.java:583)
>         at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:233)
>         at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:478)
>         at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:119)
>         at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:745)
>         at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:568)
>         at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:517)
>         at org.apache.derby.impl.tools.ij.ij.executeImmediate(Unknown Source)
>         at org.apache.derby.impl.tools.ij.utilMain.doCatch(Unknown Source)
>         at org.apache.derby.impl.tools.ij.utilMain.go(Unknown Source)
>         at org.apache.derby.impl.tools.ij.Main.go(Unknown Source)
>         at org.apache.derby.impl.tools.ij.Main.mainCore(Unknown Source)
>         at org.apache.derby.impl.tools.ij.Main14.main(Unknown Source)
>         at org.apache.derby.tools.ij.main(Unknown Source)

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


[jira] Updated: (DERBY-2230) AssertFailure: ByteCode Conditional then/else stack mismatch

Posted by "Mayuresh Nirhali (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2230?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mayuresh Nirhali updated DERBY-2230:
------------------------------------

       Derby Info: [Patch Available]
    Fix Version/s: 10.3.0.0

derbyall, suites.All runs did not show new failures.

Marking patch available flag!

> AssertFailure: ByteCode Conditional then/else stack mismatch
> ------------------------------------------------------------
>
>                 Key: DERBY-2230
>                 URL: https://issues.apache.org/jira/browse/DERBY-2230
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.2.0
>         Environment: The AssertFailure error occurs only with the debug version of derby.jar.
> Java 1.5
>            Reporter: Christian d'Heureuse
>         Assigned To: Mayuresh Nirhali
>             Fix For: 10.2.2.1, 10.3.0.0
>
>         Attachments: derby2230.diff
>
>
> The following statements produce an AssertFailure exception:
> CREATE TABLE table1 (
>    s VARCHAR(10));
> SELECT 1
>    FROM table1 a
>       INNER JOIN table1 b ON
>          a.s =
>             CASE
>                WHEN 1=1 THEN '0'
>                ELSE SUBSTR(b.s,1,1) END;
> Stack trace:
> org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED ByteCode Conditional then/else stack mismatch: then: Lorg/apache/derby/iapi/types/StringDataValue; else: Lorg/apache/derby/iapi/types/ConcatableDataValue;
>         at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:149)
>         at org.apache.derby.impl.services.bytecode.Conditional.end(Conditional.java:216)
>         at org.apache.derby.impl.services.bytecode.BCMethod.completeConditional(BCMethod.java:1063)
>         at org.apache.derby.impl.sql.compile.ConditionalNode.generateExpression(ConditionalNode.java:468)
>         at org.apache.derby.impl.sql.compile.BinaryRelationalOperatorNode.generateQualMethod(BinaryRelationalOperatorNode.java:708)
>         at org.apache.derby.impl.sql.compile.PredicateList.generateSingleQualifierCode(PredicateList.java:2723)
>         at org.apache.derby.impl.sql.compile.PredicateList.generateQualifiers(PredicateList.java:2905)
>         at org.apache.derby.impl.sql.compile.HashJoinStrategy.getScanArgs(HashJoinStrategy.java:348)
>         at org.apache.derby.impl.sql.compile.FromBaseTable.getScanArguments(FromBaseTable.java:3368)
>         at org.apache.derby.impl.sql.compile.FromBaseTable.generateResultSet(FromBaseTable.java:3059)
>         at org.apache.derby.impl.sql.compile.FromBaseTable.generate(FromBaseTable.java:2986)
>         at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1352)
>         at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1303)
>         at org.apache.derby.impl.sql.compile.JoinNode.getJoinArguments(JoinNode.java:1580)
>         at org.apache.derby.impl.sql.compile.JoinNode.generateCore(JoinNode.java:1556)
>         at org.apache.derby.impl.sql.compile.JoinNode.generate(JoinNode.java:1480)
>         at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1441)
>         at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1303)
>         at org.apache.derby.impl.sql.compile.ScrollInsensitiveResultSetNode.generate(ScrollInsensitiveResultSetNode.java:110)
>         at org.apache.derby.impl.sql.compile.CursorNode.generate(CursorNode.java:583)
>         at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:233)
>         at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:478)
>         at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:119)
>         at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:745)
>         at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:568)
>         at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:517)
>         at org.apache.derby.impl.tools.ij.ij.executeImmediate(Unknown Source)
>         at org.apache.derby.impl.tools.ij.utilMain.doCatch(Unknown Source)
>         at org.apache.derby.impl.tools.ij.utilMain.go(Unknown Source)
>         at org.apache.derby.impl.tools.ij.Main.go(Unknown Source)
>         at org.apache.derby.impl.tools.ij.Main.mainCore(Unknown Source)
>         at org.apache.derby.impl.tools.ij.Main14.main(Unknown Source)
>         at org.apache.derby.tools.ij.main(Unknown Source)

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


[jira] Resolved: (DERBY-2230) AssertFailure: ByteCode Conditional then/else stack mismatch

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2230?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Myrna van Lunteren resolved DERBY-2230.
---------------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: 10.2.2.1)
       Derby Info:   (was: [Patch Available])

I applied and committed the test patch in 10.3 with revision 545573.
I don't personally feel the need to/intend to backport this to 10.2, although it probably isn't a big deal if someone wants to do it.
Thx for the patch, Mayuresh.


> AssertFailure: ByteCode Conditional then/else stack mismatch
> ------------------------------------------------------------
>
>                 Key: DERBY-2230
>                 URL: https://issues.apache.org/jira/browse/DERBY-2230
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.2.0
>         Environment: The AssertFailure error occurs only with the debug version of derby.jar.
> Java 1.5
>            Reporter: Christian d'Heureuse
>            Assignee: Mayuresh Nirhali
>             Fix For: 10.3.0.0
>
>         Attachments: derby2230.diff, derby2230_testv1.diff
>
>
> The following statements produce an AssertFailure exception:
> CREATE TABLE table1 (
>    s VARCHAR(10));
> SELECT 1
>    FROM table1 a
>       INNER JOIN table1 b ON
>          a.s =
>             CASE
>                WHEN 1=1 THEN '0'
>                ELSE SUBSTR(b.s,1,1) END;
> Stack trace:
> org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED ByteCode Conditional then/else stack mismatch: then: Lorg/apache/derby/iapi/types/StringDataValue; else: Lorg/apache/derby/iapi/types/ConcatableDataValue;
>         at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:149)
>         at org.apache.derby.impl.services.bytecode.Conditional.end(Conditional.java:216)
>         at org.apache.derby.impl.services.bytecode.BCMethod.completeConditional(BCMethod.java:1063)
>         at org.apache.derby.impl.sql.compile.ConditionalNode.generateExpression(ConditionalNode.java:468)
>         at org.apache.derby.impl.sql.compile.BinaryRelationalOperatorNode.generateQualMethod(BinaryRelationalOperatorNode.java:708)
>         at org.apache.derby.impl.sql.compile.PredicateList.generateSingleQualifierCode(PredicateList.java:2723)
>         at org.apache.derby.impl.sql.compile.PredicateList.generateQualifiers(PredicateList.java:2905)
>         at org.apache.derby.impl.sql.compile.HashJoinStrategy.getScanArgs(HashJoinStrategy.java:348)
>         at org.apache.derby.impl.sql.compile.FromBaseTable.getScanArguments(FromBaseTable.java:3368)
>         at org.apache.derby.impl.sql.compile.FromBaseTable.generateResultSet(FromBaseTable.java:3059)
>         at org.apache.derby.impl.sql.compile.FromBaseTable.generate(FromBaseTable.java:2986)
>         at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1352)
>         at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1303)
>         at org.apache.derby.impl.sql.compile.JoinNode.getJoinArguments(JoinNode.java:1580)
>         at org.apache.derby.impl.sql.compile.JoinNode.generateCore(JoinNode.java:1556)
>         at org.apache.derby.impl.sql.compile.JoinNode.generate(JoinNode.java:1480)
>         at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1441)
>         at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1303)
>         at org.apache.derby.impl.sql.compile.ScrollInsensitiveResultSetNode.generate(ScrollInsensitiveResultSetNode.java:110)
>         at org.apache.derby.impl.sql.compile.CursorNode.generate(CursorNode.java:583)
>         at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:233)
>         at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:478)
>         at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:119)
>         at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:745)
>         at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:568)
>         at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:517)
>         at org.apache.derby.impl.tools.ij.ij.executeImmediate(Unknown Source)
>         at org.apache.derby.impl.tools.ij.utilMain.doCatch(Unknown Source)
>         at org.apache.derby.impl.tools.ij.utilMain.go(Unknown Source)
>         at org.apache.derby.impl.tools.ij.Main.go(Unknown Source)
>         at org.apache.derby.impl.tools.ij.Main.mainCore(Unknown Source)
>         at org.apache.derby.impl.tools.ij.Main14.main(Unknown Source)
>         at org.apache.derby.tools.ij.main(Unknown Source)

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


[jira] Updated: (DERBY-2230) AssertFailure: ByteCode Conditional then/else stack mismatch

Posted by "Mayuresh Nirhali (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2230?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mayuresh Nirhali updated DERBY-2230:
------------------------------------

    Attachment: derby2230.diff

The compiler/bytecode generator code does not load classes to check relationships or any other information. This is making things difficult to fix this bug. Also, I think it is not worth to go this way for a simple check that too in a DEBUG block.

Check for non-matching return types of then and else blocks in Conditional statement is made during bindExpression call and 42X89 is thrown if false. Hence, During byte code generation, check for non-matching return types is not required. I believe the assert check was included just to make sure that the stacks are consistent. But, it seems they do not consider a valid case where the two return types can have different vmNames (StringValue, ConcatableDataValue) which are assignable.

I have created a patch that works around this problem by adding another check for vmTypes. One of the reasons I chose vmType is because I saw BCMethod making its casting decision based on vmType.

I have started testruns with this patch.
I am waiting for comments on this.

> AssertFailure: ByteCode Conditional then/else stack mismatch
> ------------------------------------------------------------
>
>                 Key: DERBY-2230
>                 URL: https://issues.apache.org/jira/browse/DERBY-2230
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.2.0
>         Environment: The AssertFailure error occurs only with the debug version of derby.jar.
> Java 1.5
>            Reporter: Christian d'Heureuse
>         Assigned To: Mayuresh Nirhali
>             Fix For: 10.2.2.1
>
>         Attachments: derby2230.diff
>
>
> The following statements produce an AssertFailure exception:
> CREATE TABLE table1 (
>    s VARCHAR(10));
> SELECT 1
>    FROM table1 a
>       INNER JOIN table1 b ON
>          a.s =
>             CASE
>                WHEN 1=1 THEN '0'
>                ELSE SUBSTR(b.s,1,1) END;
> Stack trace:
> org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED ByteCode Conditional then/else stack mismatch: then: Lorg/apache/derby/iapi/types/StringDataValue; else: Lorg/apache/derby/iapi/types/ConcatableDataValue;
>         at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:149)
>         at org.apache.derby.impl.services.bytecode.Conditional.end(Conditional.java:216)
>         at org.apache.derby.impl.services.bytecode.BCMethod.completeConditional(BCMethod.java:1063)
>         at org.apache.derby.impl.sql.compile.ConditionalNode.generateExpression(ConditionalNode.java:468)
>         at org.apache.derby.impl.sql.compile.BinaryRelationalOperatorNode.generateQualMethod(BinaryRelationalOperatorNode.java:708)
>         at org.apache.derby.impl.sql.compile.PredicateList.generateSingleQualifierCode(PredicateList.java:2723)
>         at org.apache.derby.impl.sql.compile.PredicateList.generateQualifiers(PredicateList.java:2905)
>         at org.apache.derby.impl.sql.compile.HashJoinStrategy.getScanArgs(HashJoinStrategy.java:348)
>         at org.apache.derby.impl.sql.compile.FromBaseTable.getScanArguments(FromBaseTable.java:3368)
>         at org.apache.derby.impl.sql.compile.FromBaseTable.generateResultSet(FromBaseTable.java:3059)
>         at org.apache.derby.impl.sql.compile.FromBaseTable.generate(FromBaseTable.java:2986)
>         at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1352)
>         at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1303)
>         at org.apache.derby.impl.sql.compile.JoinNode.getJoinArguments(JoinNode.java:1580)
>         at org.apache.derby.impl.sql.compile.JoinNode.generateCore(JoinNode.java:1556)
>         at org.apache.derby.impl.sql.compile.JoinNode.generate(JoinNode.java:1480)
>         at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1441)
>         at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1303)
>         at org.apache.derby.impl.sql.compile.ScrollInsensitiveResultSetNode.generate(ScrollInsensitiveResultSetNode.java:110)
>         at org.apache.derby.impl.sql.compile.CursorNode.generate(CursorNode.java:583)
>         at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:233)
>         at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:478)
>         at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:119)
>         at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:745)
>         at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:568)
>         at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:517)
>         at org.apache.derby.impl.tools.ij.ij.executeImmediate(Unknown Source)
>         at org.apache.derby.impl.tools.ij.utilMain.doCatch(Unknown Source)
>         at org.apache.derby.impl.tools.ij.utilMain.go(Unknown Source)
>         at org.apache.derby.impl.tools.ij.Main.go(Unknown Source)
>         at org.apache.derby.impl.tools.ij.Main.mainCore(Unknown Source)
>         at org.apache.derby.impl.tools.ij.Main14.main(Unknown Source)
>         at org.apache.derby.tools.ij.main(Unknown Source)

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


[jira] Updated: (DERBY-2230) AssertFailure: ByteCode Conditional then/else stack mismatch

Posted by "Mayuresh Nirhali (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2230?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mayuresh Nirhali updated DERBY-2230:
------------------------------------

    Derby Info: [Patch Available]

> AssertFailure: ByteCode Conditional then/else stack mismatch
> ------------------------------------------------------------
>
>                 Key: DERBY-2230
>                 URL: https://issues.apache.org/jira/browse/DERBY-2230
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.2.2.0
>         Environment: The AssertFailure error occurs only with the debug version of derby.jar.
> Java 1.5
>            Reporter: Christian d'Heureuse
>         Assigned To: Mayuresh Nirhali
>             Fix For: 10.2.2.1, 10.3.0.0
>
>         Attachments: derby2230.diff, derby2230_testv1.diff
>
>
> The following statements produce an AssertFailure exception:
> CREATE TABLE table1 (
>    s VARCHAR(10));
> SELECT 1
>    FROM table1 a
>       INNER JOIN table1 b ON
>          a.s =
>             CASE
>                WHEN 1=1 THEN '0'
>                ELSE SUBSTR(b.s,1,1) END;
> Stack trace:
> org.apache.derby.shared.common.sanity.AssertFailure: ASSERT FAILED ByteCode Conditional then/else stack mismatch: then: Lorg/apache/derby/iapi/types/StringDataValue; else: Lorg/apache/derby/iapi/types/ConcatableDataValue;
>         at org.apache.derby.shared.common.sanity.SanityManager.THROWASSERT(SanityManager.java:149)
>         at org.apache.derby.impl.services.bytecode.Conditional.end(Conditional.java:216)
>         at org.apache.derby.impl.services.bytecode.BCMethod.completeConditional(BCMethod.java:1063)
>         at org.apache.derby.impl.sql.compile.ConditionalNode.generateExpression(ConditionalNode.java:468)
>         at org.apache.derby.impl.sql.compile.BinaryRelationalOperatorNode.generateQualMethod(BinaryRelationalOperatorNode.java:708)
>         at org.apache.derby.impl.sql.compile.PredicateList.generateSingleQualifierCode(PredicateList.java:2723)
>         at org.apache.derby.impl.sql.compile.PredicateList.generateQualifiers(PredicateList.java:2905)
>         at org.apache.derby.impl.sql.compile.HashJoinStrategy.getScanArgs(HashJoinStrategy.java:348)
>         at org.apache.derby.impl.sql.compile.FromBaseTable.getScanArguments(FromBaseTable.java:3368)
>         at org.apache.derby.impl.sql.compile.FromBaseTable.generateResultSet(FromBaseTable.java:3059)
>         at org.apache.derby.impl.sql.compile.FromBaseTable.generate(FromBaseTable.java:2986)
>         at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1352)
>         at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1303)
>         at org.apache.derby.impl.sql.compile.JoinNode.getJoinArguments(JoinNode.java:1580)
>         at org.apache.derby.impl.sql.compile.JoinNode.generateCore(JoinNode.java:1556)
>         at org.apache.derby.impl.sql.compile.JoinNode.generate(JoinNode.java:1480)
>         at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generateMinion(ProjectRestrictNode.java:1441)
>         at org.apache.derby.impl.sql.compile.ProjectRestrictNode.generate(ProjectRestrictNode.java:1303)
>         at org.apache.derby.impl.sql.compile.ScrollInsensitiveResultSetNode.generate(ScrollInsensitiveResultSetNode.java:110)
>         at org.apache.derby.impl.sql.compile.CursorNode.generate(CursorNode.java:583)
>         at org.apache.derby.impl.sql.compile.StatementNode.generate(StatementNode.java:233)
>         at org.apache.derby.impl.sql.GenericStatement.prepMinion(GenericStatement.java:478)
>         at org.apache.derby.impl.sql.GenericStatement.prepare(GenericStatement.java:119)
>         at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(GenericLanguageConnectionContext.java:745)
>         at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:568)
>         at org.apache.derby.impl.jdbc.EmbedStatement.execute(EmbedStatement.java:517)
>         at org.apache.derby.impl.tools.ij.ij.executeImmediate(Unknown Source)
>         at org.apache.derby.impl.tools.ij.utilMain.doCatch(Unknown Source)
>         at org.apache.derby.impl.tools.ij.utilMain.go(Unknown Source)
>         at org.apache.derby.impl.tools.ij.Main.go(Unknown Source)
>         at org.apache.derby.impl.tools.ij.Main.mainCore(Unknown Source)
>         at org.apache.derby.impl.tools.ij.Main14.main(Unknown Source)
>         at org.apache.derby.tools.ij.main(Unknown Source)

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