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 "Rick Hillegas (JIRA)" <ji...@apache.org> on 2009/12/01 17:08:20 UTC

[jira] Created: (DERBY-4459) Verification error at execute-time when an outer function which takes a primitive arg is wrapped around an inner function which returns the corresponding Java wrapper object

Verification error at execute-time when an outer function which takes a primitive arg is wrapped around an inner function which returns the corresponding Java wrapper object
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------

                 Key: DERBY-4459
                 URL: https://issues.apache.org/jira/browse/DERBY-4459
             Project: Derby
          Issue Type: Bug
    Affects Versions: 10.4.2.1, 10.4.3.0, 10.5.3.1, 10.5.4.0, 10.6.0.0
            Reporter: Rick Hillegas


An insane Derby raises a verification error when trying to run the following query:

values( negateInt( getNullInt() ) );

where negateInt() takes a primitive int argument and getNullInt() returns an Integer.

Sane Derby raises an assertion. The same test case, run against 10.3.3.1, also fails but raises a more graceful compile-time exception.

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


[jira] Updated: (DERBY-4459) Verification error at execute-time when an outer function which takes a primitive arg is wrapped around an inner function which returns the corresponding Java wrapper object

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

Rick Hillegas updated DERBY-4459:
---------------------------------

    Attachment: derby4459.java
                derby-4459.sql

Attaching a reproducible test case: derby4459.java and derby-4459.sql. If you compile the class and run the script through ij, you will see this output:

ij version 10.6
ij> connect 'jdbc:derby:memory:db;create=true';
ij> create function getNullInt() returns int language java parameter style java external name 'derby4459.getNullInt';
0 rows inserted/updated/deleted
ij> create function negateInt( a int ) returns int language java parameter style java external name 'derby4459.negateInt';
0 rows inserted/updated/deleted
ij> -- this fails gracefully
values( negateInt( cast( null as int) ) );
1          
-----------
ERROR 39004: A NULL value cannot be passed to a method which takes a parameter of primitive type 'int'.
ij> -- this fails gracelessly
values( negateInt( getNullInt() ) );
ERROR XBCM2: Cannot create an instance of generated class org.apache.derby.exe.ac0b5b0099x0125x4b6bxa3fdx000000135f981.
ERROR XJ001: Java exception: '(class: org/apache/derby/exe/ac0b5b0099x0125x4b6bxa3fdx000000135f981, method: e0 signature: ()Ljava/lang/Object;) Expecting to find integer on stack: java.lang.VerifyError'.

> Verification error at execute-time when an outer function which takes a primitive arg is wrapped around an inner function which returns the corresponding Java wrapper object
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-4459
>                 URL: https://issues.apache.org/jira/browse/DERBY-4459
>             Project: Derby
>          Issue Type: Bug
>    Affects Versions: 10.4.2.1, 10.4.3.0, 10.5.3.1, 10.5.4.0, 10.6.0.0
>            Reporter: Rick Hillegas
>         Attachments: derby-4459.sql, derby4459.java
>
>
> An insane Derby raises a verification error when trying to run the following query:
> values( negateInt( getNullInt() ) );
> where negateInt() takes a primitive int argument and getNullInt() returns an Integer.
> Sane Derby raises an assertion. The same test case, run against 10.3.3.1, also fails but raises a more graceful compile-time exception.

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


[jira] Commented: (DERBY-4459) Verification error at execute-time when an outer function which takes a primitive arg is wrapped around an inner function which returns the corresponding Java wrapper object

Posted by "Rick Hillegas (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-4459?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12887929#action_12887929 ] 

Rick Hillegas commented on DERBY-4459:
--------------------------------------

Tests ran cleanly for me except for the following errors which seem to have been introduced into the mainline recently:

1) testAttributeAccumulatedConnectionCount(org.apache.derbyTesting.functionTests.tests.management.NetworkServerMBeanTest)java.security.PrivilegedActionException: javax.management.InstanceNotFoundException: org.apache.derby:type=NetworkServer,system=c013800d-0129-cd0d-100f-ffffe1d7aa3e
	at java.security.AccessController.doPrivileged(Native Method)
	at org.apache.derbyTesting.functionTests.tests.management.MBeanTest.getAttribute(MBeanTest.java:379)
	at org.apache.derbyTesting.functionTests.tests.management.NetworkServerMBeanTest.testAttributeAccumulatedConnectionCount(NetworkServerMBeanTest.java:93)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:109)
	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)
Caused by: javax.management.InstanceNotFoundException: org.apache.derby:type=NetworkServer,system=c013800d-0129-cd0d-100f-ffffe1d7aa3e
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getMBean(DefaultMBeanServerInterceptor.java:1010)
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getAttribute(DefaultMBeanServerInterceptor.java:627)
	at com.sun.jmx.mbeanserver.JmxMBeanServer.getAttribute(JmxMBeanServer.java:659)
	at org.apache.derbyTesting.functionTests.tests.management.MBeanTest$4.run(MBeanTest.java:382)
	... 41 more
There was 1 failure:
1) ttestSetPortPriority(org.apache.derbyTesting.functionTests.tests.derbynet.ServerPropertiesTest)junit.framework.AssertionFailedError: Port 1537 exceeeds expected maximum. You may need to update TestConfiguration.MAX_PORTS_USED and the Wiki page at http://wiki.apache.org/db-derby/DerbyJUnitTesting if test runs now require more available ports
	at org.apache.derbyTesting.junit.TestConfiguration.getNextAvailablePort(TestConfiguration.java:1413)
	at org.apache.derbyTesting.functionTests.tests.derbynet.ServerPropertiesTest.ttestSetPortPriority(ServerPropertiesTest.java:445)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at org.apache.derbyTesting.junit.BaseTestCase.runBare(BaseTestCase.java:109)
	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)

FAILURES!!!
Tests run: 8845,  Failures: 1,  Errors: 1


> Verification error at execute-time when an outer function which takes a primitive arg is wrapped around an inner function which returns the corresponding Java wrapper object
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-4459
>                 URL: https://issues.apache.org/jira/browse/DERBY-4459
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.4.2.1, 10.5.3.1, 10.6.1.0
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>         Attachments: derby-4459-01-aa-disableOptimization.diff, derby-4459.sql, derby4459.java
>
>
> An insane Derby raises a verification error when trying to run the following query:
> values( negateInt( getNullInt() ) );
> where negateInt() takes a primitive int argument and getNullInt() returns an Integer.
> Sane Derby raises an assertion. The same test case, run against 10.3.3.1, also fails but raises a more graceful compile-time exception.

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


[jira] Updated: (DERBY-4459) Verification error at execute-time when an outer function which takes a primitive arg is wrapped around an inner function which returns the corresponding Java wrapper object

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

Rick Hillegas updated DERBY-4459:
---------------------------------

    Attachment: derby-4459-01-aa-disableOptimization.diff

Attaching derby-4459-01-aa-disableOptimization.diff. This disables the same over-eager optimization which led to DERBY-1030.

For more context, please see DERBY-1030. This is another case of that optimization being applied too liberally. This patch disables that optimization when the bind() phase has determined that an argument needs to be cast to a primitive in order to match the selected method. Running tests now.

Touches the following files:

-------------

M      java/engine/org/apache/derby/impl/sql/compile/StaticMethodCallNode.java

Disables the optimization.

-------------

M      java/testing/org/apache/derbyTesting/functionTests/tests/lang/RoutineTest.java

Adds a test case.


> Verification error at execute-time when an outer function which takes a primitive arg is wrapped around an inner function which returns the corresponding Java wrapper object
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-4459
>                 URL: https://issues.apache.org/jira/browse/DERBY-4459
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.4.2.1, 10.5.3.1, 10.6.1.0
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>         Attachments: derby-4459-01-aa-disableOptimization.diff, derby-4459.sql, derby4459.java
>
>
> An insane Derby raises a verification error when trying to run the following query:
> values( negateInt( getNullInt() ) );
> where negateInt() takes a primitive int argument and getNullInt() returns an Integer.
> Sane Derby raises an assertion. The same test case, run against 10.3.3.1, also fails but raises a more graceful compile-time exception.

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


[jira] Assigned: (DERBY-4459) Verification error at execute-time when an outer function which takes a primitive arg is wrapped around an inner function which returns the corresponding Java wrapper object

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

Rick Hillegas reassigned DERBY-4459:
------------------------------------

    Assignee: Rick Hillegas

> Verification error at execute-time when an outer function which takes a primitive arg is wrapped around an inner function which returns the corresponding Java wrapper object
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-4459
>                 URL: https://issues.apache.org/jira/browse/DERBY-4459
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.4.2.1, 10.5.3.1, 10.6.1.0
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>         Attachments: derby-4459-01-aa-disableOptimization.diff, derby-4459.sql, derby4459.java
>
>
> An insane Derby raises a verification error when trying to run the following query:
> values( negateInt( getNullInt() ) );
> where negateInt() takes a primitive int argument and getNullInt() returns an Integer.
> Sane Derby raises an assertion. The same test case, run against 10.3.3.1, also fails but raises a more graceful compile-time exception.

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


[jira] Updated: (DERBY-4459) Verification error at execute-time when an outer function which takes a primitive arg is wrapped around an inner function which returns the corresponding Java wrapper object

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

Mike Matrigali updated DERBY-4459:
----------------------------------

    Component/s: SQL

> Verification error at execute-time when an outer function which takes a primitive arg is wrapped around an inner function which returns the corresponding Java wrapper object
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-4459
>                 URL: https://issues.apache.org/jira/browse/DERBY-4459
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.4.2.1, 10.4.3.0, 10.5.3.1, 10.5.4.0, 10.6.1.0
>            Reporter: Rick Hillegas
>         Attachments: derby-4459.sql, derby4459.java
>
>
> An insane Derby raises a verification error when trying to run the following query:
> values( negateInt( getNullInt() ) );
> where negateInt() takes a primitive int argument and getNullInt() returns an Integer.
> Sane Derby raises an assertion. The same test case, run against 10.3.3.1, also fails but raises a more graceful compile-time exception.

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


[jira] Updated: (DERBY-4459) Verification error at execute-time when an outer function which takes a primitive arg is wrapped around an inner function which returns the corresponding Java wrapper object

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

Rick Hillegas updated DERBY-4459:
---------------------------------

    Issue & fix info: [Patch Available]

> Verification error at execute-time when an outer function which takes a primitive arg is wrapped around an inner function which returns the corresponding Java wrapper object
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-4459
>                 URL: https://issues.apache.org/jira/browse/DERBY-4459
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.4.2.1, 10.5.3.1, 10.6.1.0
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>         Attachments: derby-4459-01-aa-disableOptimization.diff, derby-4459.sql, derby4459.java
>
>
> An insane Derby raises a verification error when trying to run the following query:
> values( negateInt( getNullInt() ) );
> where negateInt() takes a primitive int argument and getNullInt() returns an Integer.
> Sane Derby raises an assertion. The same test case, run against 10.3.3.1, also fails but raises a more graceful compile-time exception.

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


[jira] Closed: (DERBY-4459) Verification error at execute-time when an outer function which takes a primitive arg is wrapped around an inner function which returns the corresponding Java wrapper object

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

Rick Hillegas closed DERBY-4459.
--------------------------------

    Issue & fix info:   (was: [Patch Available])
       Fix Version/s: 10.7.0.0
          Resolution: Fixed

Committed patch at subversion revision 964039.

> Verification error at execute-time when an outer function which takes a primitive arg is wrapped around an inner function which returns the corresponding Java wrapper object
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-4459
>                 URL: https://issues.apache.org/jira/browse/DERBY-4459
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.4.2.1, 10.5.3.1, 10.6.1.0
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>             Fix For: 10.7.0.0
>
>         Attachments: derby-4459-01-aa-disableOptimization.diff, derby-4459.sql, derby4459.java
>
>
> An insane Derby raises a verification error when trying to run the following query:
> values( negateInt( getNullInt() ) );
> where negateInt() takes a primitive int argument and getNullInt() returns an Integer.
> Sane Derby raises an assertion. The same test case, run against 10.3.3.1, also fails but raises a more graceful compile-time exception.

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