db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick Hillegas (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-5779) Table functions and vtis should only accept arguments which are constant in their query block.
Date Wed, 06 Jun 2012 12:55:22 GMT

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

Rick Hillegas commented on DERBY-5779:
--------------------------------------

Derby relies on the illegal syntax for some of its internal metadata queries. For instance,
the getFunctionColumns() query (in metadata.properties) involves a join, in the FROM list,
between a VTI's arguments and columns from other tables in the FROM list. This raises the
following red flags:

1) Fixing the syntax may involve re-writing existing Derby metadata queries.

2) The backward compatibility problem may be too big to contemplate.

We may want to narrow the scope of this issue and just fix the problem for table functions,
leaving Derby VTIs alone. We could probably back ourselves into the position that VTIs fall
outside the SQL Standard. As a Derby extension, we can make up our own rules for them.

The following phased approach might make sense:

A) Add new overloads so that Derby table functions (like SYSCS_DIAG.SPACE_TABLE) can be invoked
in a legal way.

B) Change the documentation accordingly so that we no longer showcase illegal syntax.

C) Make the bad syntax illegal for table functions, but leave VTIs alone.

Later on, we may want to give some thought to what the illegal VTI syntax means. It may have
a well-defined meaning provided that we can guarantee the join order which Derby chooses.
                
> Table functions and vtis should only accept arguments which are constant in their query
block.
> ----------------------------------------------------------------------------------------------
>
>                 Key: DERBY-5779
>                 URL: https://issues.apache.org/jira/browse/DERBY-5779
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 10.9.1.0
>            Reporter: Rick Hillegas
>
> Derby lets you invoke a table function/vti in the FROM list of a query, passing in arguments
built out of columns in other tables in the FROM list. This syntax is illegal and the resulting
queries have no meaning under the SQL Standard. See the discussion on DERBY-5554. We should
forbid this syntax. Similar syntax involving correlated subqueries in the FROM list is already
forbidden. Fixing this will create a backward incompatibility which requires a release note.
In particular, the sample usage for SYSCS_DIAG.SPACE_TABLE, given in the Reference Manual,
will no longer work after fixing this bug. Changes to SPACE_TABLE are being discussed on DERBY-5554.

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

        

Mime
View raw message