db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r587458 - in /db/derby/code/trunk/java: engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj testing/org/apache/derbyTesting/functionTests/tests/lang/RolesTest.java
Date Tue, 23 Oct 2007 11:15:06 GMT
Author: dag
Date: Tue Oct 23 04:15:05 2007
New Revision: 587458

URL: http://svn.apache.org/viewvc?rev=587458&view=rev
Log:
DERBY-3073 SQL roles: add parser support

Patch DERBY-3073-part-2. Check role ids max 30 long, string allowed for SET ROLE.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/RolesTest.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj?rev=587458&r1=587457&r2=587458&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj Tue Oct
23 04:15:05 2007
@@ -9638,6 +9638,7 @@
 	{
 		checkSqlStandardAccess("CREATE ROLE");
 		checkVersion( DataDictionary.DD_VERSION_DERBY_10_4, "ROLES");
+		checkAuthorizationLength(roleName);
 
 		return (StatementNode) nodeFactory.getNode(
 			C_NodeTypes.CREATE_ROLE_NODE,
@@ -11461,6 +11462,16 @@
 			 null,
 			 ReuseFactory.getInteger(StatementType.SET_ROLE_DYNAMIC),
 			 getContextManager());
+	}
+|
+	roleName = string()
+	{
+		checkIdentifierLengthLimit(roleName, Limits.MAX_IDENTIFIER_LENGTH);
+		return (StatementNode) nodeFactory.getNode(
+			C_NodeTypes.SET_ROLE_NODE,
+			roleName,
+			null,
+			getContextManager());
 	}
 }
 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/RolesTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/RolesTest.java?rev=587458&r1=587457&r2=587458&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/RolesTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/RolesTest.java
Tue Oct 23 04:15:05 2007
@@ -304,6 +304,8 @@
         // set
         doStmt("set role foo",
                sqlAuthorizationRequired, notImplemented, notImplemented);
+        doStmt("set role 'FOO'",
+               sqlAuthorizationRequired, notImplemented, notImplemented);
         doStmt("set role none",
                sqlAuthorizationRequired, notImplemented, notImplemented);
         doDynamicSetRole(_conn);



Mime
View raw message