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

Knut Anders Hatlen commented on DERBY-866:
------------------------------------------

I have some questions about the getRawDataAndZeroIt() method in SQLChar:

1) Could this code

    char[]  sourceValue = (rawData ==  null) ? getCharArray() : rawData;

be replaced with

    char[] sourceValue = getCharArray();

? It looks to me as if getCharArray() already has a special case for returning 
rawData directly if it has one.

2) Would it be better to use getLength() instead of sourceValue.length to get 
the length of the value? I don't think those two values are guaranteed to be 
equal (see for example the comment in readExternalFromArray()), and if they are 
not equal, I think code like this might end up returning a different 
(zero-padded) value instead of a clone:

    public DataValueDescriptor cloneValue(boolean forceMaterialization)
        throws StandardException
        {
        return new SQLPassword( getRawDataAndZeroIt() );
        }

3) It calls Arrays.fill( sourceValue, (char) 0 ) right before calling 
setAndZeroOldValue(). Isn't that redundant, since calling zeroRawData() is the 
first thing setAndZeroOldValue() does?

4) If the value comes from a stream, the call to getCharArray() will create the 
char array by going via string representation (it calls getString()). Perhaps 
the stream case should be moved from getString() to getCharArray() to prevent 
this unnecessary intermediate representation?
                
> Derby User Management Enhancements
> ----------------------------------
>
>                 Key: DERBY-866
>                 URL: https://issues.apache.org/jira/browse/DERBY-866
>             Project: Derby
>          Issue Type: Improvement
>          Components: Services
>    Affects Versions: 10.2.1.6
>            Reporter: Francois Orsini
>            Assignee: Rick Hillegas
>         Attachments: Derby_User_Enhancement.html, 
> Derby_User_Enhancement_v1.1.html, DummyAuthenticator.java, 
> UserManagement.html, UserManagement.html, UserManagement.html, 
> derby-866-01-aa-sysusers.diff, derby-866-01-ab-sysusers.diff, 
> derby-866-02-ag-createDropUser.diff, dummyCredentials.properties
>
>
> Proposal to enhance Derby's Built-In DDL User Management. (See proposal spec 
> attached to the JIRA).
> Abstract:
> This feature aims at improving the way BUILT-IN users are managed in Derby by 
> providing a more intuitive and familiar DDL interface. Currently (in 
> 10.1.2.1), Built-In users can be defined at the system and/or database level. 
> Users created at the system level can be defined via JVM or/and Derby system 
> properties in the derby.properties file. Built-in users created at the 
> database level are defined via a call to a Derby system procedure 
> (SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY) which sets a database property.
> Defining a user at the system level is very convenient and practical during 
> the development phase (EOD) of an application - However, the user's password 
> is not encrypted and consequently appears in clear in the derby.properties 
> file. Hence, for an application going into production, whether it is embedded 
> or not, it is preferable to create users at the database level where the 
> password is encrypted.
> There is no real ANSI SQL standard for managing users in SQL but by providing 
> a more intuitive and known interface, it will ease Built-In User management 
> at the database level as well as Derby's adoption.

--
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

        

Reply via email to