[ 
https://issues.apache.org/jira/browse/DERBY-651?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Rick Hillegas updated DERBY-651:
--------------------------------

    Attachment: derby-651-09-ac-usagePrivilege.diff

Attaching derby-651-09-ac-usagePrivilege.diff. This patch wires in the USAGE 
privilege, which is needed for sequences and udts. The support for sequences 
can't be finished until a bit more work has been done on implementing the NEXT 
SEQUENCE FOR operator. Regression tests pass for me.

The USAGE privilege is stored in the SYSPERMS catalog, a 10.6 catalog which was 
introduced by earlier work on DERBY-712. SYSPERMS is intended to be a general 
purpose permissions catalog. Over time, the complexity of our permissions 
implementation and the number of permissions catalogs can be reduced by storing 
other kinds of privileges in this catalog. For instance, it should be easy to 
store the EXECUTE privilege in SYSPERMS. Much of the implementation of the 
USAGE privilege parallels the implementation of the EXECUTE privilege.

This patch introduces a new abstraction: PrivilegedSQLObject. This is a data 
dictionary representation of a schema object which has privileges granted on 
it. In this patch, this abstraction covers two kinds of schema objects: 
sequences and udts. Over time, we may want to simplify the hierarchy descending 
from TupleDescriptor. More descendants of TupleDescriptor should be candidates 
to be PrivilegedSQLObjects represented in SYSPERMS.

Touches the following files:

M      java/storeless/org/apache/derby/impl/storeless/EmptyDictionary.java
M      java/engine/org/apache/derby/iapi/sql/dictionary/DataDictionary.java
M      java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
M      java/engine/org/apache/derby/impl/sql/catalog/PermissionsCacheable.java
M      java/engine/org/apache/derby/iapi/sql/dictionary/PermDescriptor.java
M      java/engine/org/apache/derby/impl/sql/catalog/SYSPERMSRowFactory.java

Added USAGE privileges to the permissions cache.


M      java/engine/org/apache/derby/impl/sql/catalog/DDdependableFinder.java
M      java/engine/org/apache/derby/impl/sql/catalog/CoreDDFinderClassInfo.java

Filled in some missing bits of the Formatable machinery for sequences and 
generic privileges.


M      java/engine/org/apache/derby/impl/sql/compile/CompilerContextImpl.java
M      java/engine/org/apache/derby/impl/sql/compile/QueryTreeNode.java
M      java/engine/org/apache/derby/impl/sql/compile/PrivilegeNode.java
M      java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj
M      java/engine/org/apache/derby/iapi/sql/compile/CompilerContext.java

Compiler support for the new USAGE privilege. The USAGE privilege can be 
granted on sequences and udts. However, the compiler creates runtime USAGE 
checks only for udts right now.


A      java/engine/org/apache/derby/impl/sql/execute/GenericPrivilegeInfo.java

Runtime support for the new USAGE privilege.


A      java/engine/org/apache/derby/iapi/sql/dictionary/PrivilegedSQLObject.java
M      java/engine/org/apache/derby/iapi/sql/dictionary/AliasDescriptor.java
M      java/engine/org/apache/derby/iapi/sql/dictionary/SequenceDescriptor.java

Support for the new abstraction discussed above: a schema object which can have 
privileges granted on it.


M      java/engine/org/apache/derby/iapi/sql/dictionary/StatementPermission.java
M      
java/engine/org/apache/derby/iapi/sql/dictionary/StatementRoutinePermission.java
A      
java/engine/org/apache/derby/iapi/sql/dictionary/StatementGenericPermission.java

Additional runtime enforcement of the new USAGE privilege. Enforcement code is 
shared by the EXECUTE and USAGE privileges. I have some reservations about the 
placement of this part of the runtime machinery in the data dictionary. To me 
it looks as though this code might be more comfortable in 
org.apache.derby.impl.sql.execute. However, that is outside the scope of this 
patch.


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

Some new error messages. A message related to EXECUTE permissions has been 
renamed and pressed into service to also serve the USAGE privilege.


M      
java/testing/org/apache/derbyTesting/functionTests/tests/lang/GeneratedColumnsHelper.java
M      java/testing/org/apache/derbyTesting/functionTests/tests/lang/_Suite.java
M      
java/testing/org/apache/derbyTesting/functionTests/tests/lang/UDTTest.java
A      
java/testing/org/apache/derbyTesting/functionTests/tests/lang/UDTPermsTest.java

Basic tests for granting and revoking USAGE privilege on udts.


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

An assertion in this test needed to be updated to account for a new index added 
to SYSPERMS.


> Re-enable the storing of java objects in the database
> -----------------------------------------------------
>
>                 Key: DERBY-651
>                 URL: https://issues.apache.org/jira/browse/DERBY-651
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>            Reporter: Rick Hillegas
>            Assignee: Rick Hillegas
>         Attachments: derby-651-01-aa-basicCreateDropType.diff, 
> derby-651-02-af-udtColumnsRetvalsParams.diff, 
> derby-651-03-aa-udttestInstability.diff, derby-651-04-aa-javadoc.diff, 
> derby-651-05-ac-dependencyTable.diff, derby-651-06-aa-dropTable.diff, 
> derby-651-07-aa-dependencyView.diff, derby-651-08-aa-dependencyRoutines.diff, 
> derby-651-09-ac-usagePrivilege.diff, UserDefinedTypes.html, 
> UserDefinedTypes.html, UserDefinedTypes.html, UserDefinedTypes.html
>
>
> Islay Symonette, in an email thread called "Storing Java Objects in a table" 
> on October 26, 2005 requests the ability to store java objects in the 
> database.
> Old releases of Cloudscape allow users to declare a column's type to be a 
> Serializable class. This feature was removed from Derby because the syntax 
> was non-standard. However, most of the machinery to support objects 
> serialized to columns is still in Derby and is even used in system tables. We 
> need to agree on some standard syntax here and re-expose this useful feature. 
> Some subset of the ANSI adt syntax, cumbersome as it is, would do.

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

Reply via email to