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/03/13 11:27:50 UTC

[jira] Created: (DERBY-4092) You should not be able to invoke a table function as a scalar function

You should not be able to invoke a table function as a scalar function
----------------------------------------------------------------------

                 Key: DERBY-4092
                 URL: https://issues.apache.org/jira/browse/DERBY-4092
             Project: Derby
          Issue Type: Bug
          Components: SQL
    Affects Versions: 10.4.2.1, 10.4.3.0, 10.5.0.0
            Reporter: Rick Hillegas


If you invoke a table function as a scalar function, Derby instantiates the ResultSet returned by the table function and returns that ResultSet. This behavior looks wrong. Derby should raise an error if you invoke a table function as a scalar function. Here is an example of the problem:

ij> values ( badVTI( 'foo' ) );
1              
---------------
BadVTI@1ef69   

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


[jira] Updated: (DERBY-4092) You should not be able to invoke a table function as a scalar function

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

Rick Hillegas updated DERBY-4092:
---------------------------------

    Issue & fix info: [Newcomer, Patch Available]  (was: [Newcomer])

> You should not be able to invoke a table function as a scalar function
> ----------------------------------------------------------------------
>
>                 Key: DERBY-4092
>                 URL: https://issues.apache.org/jira/browse/DERBY-4092
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.4.2.1, 10.4.3.0, 10.5.1.1
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>         Attachments: derby-4092-01-aa-noVTIsAsScalarValues.diff
>
>
> If you invoke a table function as a scalar function, Derby instantiates the ResultSet returned by the table function and returns that ResultSet. This behavior looks wrong. Derby should raise an error if you invoke a table function as a scalar function. Here is an example of the problem:
> ij> values ( badVTI( 'foo' ) );
> 1              
> ---------------
> BadVTI@1ef69   

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


[jira] Assigned: (DERBY-4092) You should not be able to invoke a table function as a scalar function

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

Rick Hillegas reassigned DERBY-4092:
------------------------------------

    Assignee: Rick Hillegas

> You should not be able to invoke a table function as a scalar function
> ----------------------------------------------------------------------
>
>                 Key: DERBY-4092
>                 URL: https://issues.apache.org/jira/browse/DERBY-4092
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.4.2.1, 10.4.3.0, 10.5.1.1
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>         Attachments: derby-4092-01-aa-noVTIsAsScalarValues.diff
>
>
> If you invoke a table function as a scalar function, Derby instantiates the ResultSet returned by the table function and returns that ResultSet. This behavior looks wrong. Derby should raise an error if you invoke a table function as a scalar function. Here is an example of the problem:
> ij> values ( badVTI( 'foo' ) );
> 1              
> ---------------
> BadVTI@1ef69   

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


[jira] Updated: (DERBY-4092) You should not be able to invoke a table function as a scalar function

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

Rick Hillegas updated DERBY-4092:
---------------------------------

    Attachment: derby-4092-01-aa-noVTIsAsScalarValues.diff

Attaching derby-4092-01-aa-noVTIsAsScalarValues.diff. This patch raises an error during the binding of scalar Java return values if a java.sql.ResultSet is seen.

I have not run regression tests yet although TableFunctionTest runs cleanly with the new test case.

Touches the following files:

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

Raise an error during bind() if a scalar value sits on top of a call to a table function.


M      java/engine/org/apache/derby/loc/messages.xml
M      java/shared/org/apache/derby/shared/common/reference/SQLState.java

A new message for this error state.


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

A test case to verify this fix.


> You should not be able to invoke a table function as a scalar function
> ----------------------------------------------------------------------
>
>                 Key: DERBY-4092
>                 URL: https://issues.apache.org/jira/browse/DERBY-4092
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.4.2.1, 10.4.3.0, 10.5.1.1
>            Reporter: Rick Hillegas
>         Attachments: derby-4092-01-aa-noVTIsAsScalarValues.diff
>
>
> If you invoke a table function as a scalar function, Derby instantiates the ResultSet returned by the table function and returns that ResultSet. This behavior looks wrong. Derby should raise an error if you invoke a table function as a scalar function. Here is an example of the problem:
> ij> values ( badVTI( 'foo' ) );
> 1              
> ---------------
> BadVTI@1ef69   

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


[jira] Updated: (DERBY-4092) You should not be able to invoke a table function as a scalar function

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

Rick Hillegas updated DERBY-4092:
---------------------------------

    Urgency: Normal

Triaged July 2, 2009: Assigned normal urgency.

> You should not be able to invoke a table function as a scalar function
> ----------------------------------------------------------------------
>
>                 Key: DERBY-4092
>                 URL: https://issues.apache.org/jira/browse/DERBY-4092
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.4.2.1, 10.4.3.0, 10.5.1.1
>            Reporter: Rick Hillegas
>
> If you invoke a table function as a scalar function, Derby instantiates the ResultSet returned by the table function and returns that ResultSet. This behavior looks wrong. Derby should raise an error if you invoke a table function as a scalar function. Here is an example of the problem:
> ij> values ( badVTI( 'foo' ) );
> 1              
> ---------------
> BadVTI@1ef69   

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


[jira] Updated: (DERBY-4092) You should not be able to invoke a table function as a scalar function

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

Rick Hillegas updated DERBY-4092:
---------------------------------

    Derby Categories: [Deviation from standard, Newcomer, Wrong query result]

> You should not be able to invoke a table function as a scalar function
> ----------------------------------------------------------------------
>
>                 Key: DERBY-4092
>                 URL: https://issues.apache.org/jira/browse/DERBY-4092
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.4.2.1, 10.4.3.0, 10.5.0.0
>            Reporter: Rick Hillegas
>
> If you invoke a table function as a scalar function, Derby instantiates the ResultSet returned by the table function and returns that ResultSet. This behavior looks wrong. Derby should raise an error if you invoke a table function as a scalar function. Here is an example of the problem:
> ij> values ( badVTI( 'foo' ) );
> 1              
> ---------------
> BadVTI@1ef69   

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


[jira] Commented: (DERBY-4092) You should not be able to invoke a table function as a scalar function

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

Rick Hillegas commented on DERBY-4092:
--------------------------------------

Ported 805443 from trunk to 10.5 branch at subversion revision 805444.

> You should not be able to invoke a table function as a scalar function
> ----------------------------------------------------------------------
>
>                 Key: DERBY-4092
>                 URL: https://issues.apache.org/jira/browse/DERBY-4092
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.5.1.1
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>             Fix For: 10.5.3.1, 10.6.0.0
>
>         Attachments: derby-4092-01-aa-noVTIsAsScalarValues.diff
>
>
> If you invoke a table function as a scalar function, Derby instantiates the ResultSet returned by the table function and returns that ResultSet. This behavior looks wrong. Derby should raise an error if you invoke a table function as a scalar function. Here is an example of the problem:
> ij> values ( badVTI( 'foo' ) );
> 1              
> ---------------
> BadVTI@1ef69   

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


[jira] Closed: (DERBY-4092) You should not be able to invoke a table function as a scalar function

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

Rick Hillegas closed DERBY-4092.
--------------------------------

    Resolution: Fixed

> You should not be able to invoke a table function as a scalar function
> ----------------------------------------------------------------------
>
>                 Key: DERBY-4092
>                 URL: https://issues.apache.org/jira/browse/DERBY-4092
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.5.1.1
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>         Attachments: derby-4092-01-aa-noVTIsAsScalarValues.diff
>
>
> If you invoke a table function as a scalar function, Derby instantiates the ResultSet returned by the table function and returns that ResultSet. This behavior looks wrong. Derby should raise an error if you invoke a table function as a scalar function. Here is an example of the problem:
> ij> values ( badVTI( 'foo' ) );
> 1              
> ---------------
> BadVTI@1ef69   

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


[jira] Commented: (DERBY-4092) You should not be able to invoke a table function as a scalar function

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

Rick Hillegas commented on DERBY-4092:
--------------------------------------

Committed derby-4092-01-aa-noVTIsAsScalarValues.diff at subversion revision 805443.

> You should not be able to invoke a table function as a scalar function
> ----------------------------------------------------------------------
>
>                 Key: DERBY-4092
>                 URL: https://issues.apache.org/jira/browse/DERBY-4092
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.4.2.1, 10.4.3.0, 10.5.1.1
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>         Attachments: derby-4092-01-aa-noVTIsAsScalarValues.diff
>
>
> If you invoke a table function as a scalar function, Derby instantiates the ResultSet returned by the table function and returns that ResultSet. This behavior looks wrong. Derby should raise an error if you invoke a table function as a scalar function. Here is an example of the problem:
> ij> values ( badVTI( 'foo' ) );
> 1              
> ---------------
> BadVTI@1ef69   

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


[jira] Updated: (DERBY-4092) You should not be able to invoke a table function as a scalar function

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

Rick Hillegas updated DERBY-4092:
---------------------------------

    Affects Version/s:     (was: 10.4.3.0)
                           (was: 10.4.2.1)
        Fix Version/s: 10.6.0.0
                       10.5.3.1

> You should not be able to invoke a table function as a scalar function
> ----------------------------------------------------------------------
>
>                 Key: DERBY-4092
>                 URL: https://issues.apache.org/jira/browse/DERBY-4092
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.5.1.1
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>             Fix For: 10.5.3.1, 10.6.0.0
>
>         Attachments: derby-4092-01-aa-noVTIsAsScalarValues.diff
>
>
> If you invoke a table function as a scalar function, Derby instantiates the ResultSet returned by the table function and returns that ResultSet. This behavior looks wrong. Derby should raise an error if you invoke a table function as a scalar function. Here is an example of the problem:
> ij> values ( badVTI( 'foo' ) );
> 1              
> ---------------
> BadVTI@1ef69   

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


[jira] Commented: (DERBY-4092) You should not be able to invoke a table function as a scalar function

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

Rick Hillegas commented on DERBY-4092:
--------------------------------------

The tests ran cleanly for me except for the following, pre-existing heisenbug in NetworkServerMBeanTest. The heisenbug did not recur when I ran the test standalone:

1) testAttributeAccumulatedConnectionCount(org.apache.derbyTesting.functionTests.tests.management.NetworkServerMBeanTest)java.security.PrivilegedActionException: javax.management.InstanceNotFoundException: org.apache.derby:type=NetworkServer,system=c013800d-0123-2df6-f73c-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-0123-2df6-f73c-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

FAILURES!!!
Tests run: 10219,  Failures: 0,  Errors: 1


> You should not be able to invoke a table function as a scalar function
> ----------------------------------------------------------------------
>
>                 Key: DERBY-4092
>                 URL: https://issues.apache.org/jira/browse/DERBY-4092
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.4.2.1, 10.4.3.0, 10.5.1.1
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>         Attachments: derby-4092-01-aa-noVTIsAsScalarValues.diff
>
>
> If you invoke a table function as a scalar function, Derby instantiates the ResultSet returned by the table function and returns that ResultSet. This behavior looks wrong. Derby should raise an error if you invoke a table function as a scalar function. Here is an example of the problem:
> ij> values ( badVTI( 'foo' ) );
> 1              
> ---------------
> BadVTI@1ef69   

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