db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-3610) Confusing error message when granting execute privilege
Date Sun, 05 Apr 2009 18:00:12 GMT

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

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

I think it may be better to have two different error messages, since passing the words "procedure"
and "function" as arguments to the error message doesn't work that well for other languages
than English.

It is possible to have many messages with the same SQLState, by adding a suffix that is only
used by Derby internally. For example

42Y21.S.0 - {0} is not recognized as a procedure
42Y21.S.1 - {0} is not recognized as a function

See here for a description of how Derby interprets the states: http://db.apache.org/derby/javadoc/engine/org/apache/derby/shared/common/reference/SQLState.html

Perhaps we should reuse the SQLState 42Y03 instead of adding 42Y21, so that the change doesn't
affect existing applications that check the SQLState. If the state is changed, we'd need a
release note to give a heads up to the users.

> Confusing error message when granting execute privilege
> -------------------------------------------------------
>
>                 Key: DERBY-3610
>                 URL: https://issues.apache.org/jira/browse/DERBY-3610
>             Project: Derby
>          Issue Type: Improvement
>          Components: Newcomer, SQL
>            Reporter: Dag H. Wanvik
>            Priority: Trivial
>         Attachments: DERBY-3610.patch
>
>
> When the wrong keyword is used in a grant execute privilege statement, the error message
> leads one the believe the identifier is neither a procedure or a function, when in deed
it is one of the two.
> > create function bc(i int) returns int language java parameter style java external
name 'java.lang.Integer.bitCount' no sql;
> > grant execute on procedure bc to foo;
> ERROR 42Y03: 'BC' is not recognized as a function or procedure.
> > grant execute on function bc to foo;
> (works)
> The reason is that the error message is generic. It would be better to have an error
message for each case.

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


Mime
View raw message