db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r1336775 - in /db/derby/code/trunk/java: engine/org/apache/derby/iapi/reference/ engine/org/apache/derby/impl/jdbc/ engine/org/apache/derby/impl/jdbc/authentication/ testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/
Date Thu, 10 May 2012 16:18:01 GMT
Author: dag
Date: Thu May 10 16:18:00 2012
New Revision: 1336775

URL: http://svn.apache.org/viewvc?rev=1336775&view=rev
Log:
DERBY-3146 Adjust length restriction on user identifiers (authorization ids) to same as other
identifiers

Patch DERBY-3146 lift this DB2 legacy restriction. The new restriction
is 128, the same as other SQLIdentifiers. 


Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/reference/Limits.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/authentication/AuthenticationServiceBase.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DatabaseMetaDataTest.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/reference/Limits.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/reference/Limits.java?rev=1336775&r1=1336774&r2=1336775&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/reference/Limits.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/reference/Limits.java Thu May 10
16:18:00 2012
@@ -69,7 +69,6 @@ public interface Limits
 
 	public static final int DB2_MIN_COL_LENGTH_FOR_CURRENT_USER = 8;
 	public static final int DB2_MIN_COL_LENGTH_FOR_CURRENT_SCHEMA = 128;     
-	public static final int DB2_MAX_USERID_LENGTH = 30;
 
     /**
      * DB2 TABLESPACE page size limits

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java?rev=1336775&r1=1336774&r2=1336775&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java
Thu May 10 16:18:00 2012
@@ -1298,7 +1298,7 @@ public class EmbedDatabaseMetaData exten
      * @return max name length  in bytes
      */
 	public int getMaxUserNameLength() {
-		return Limits.DB2_MAX_USERID_LENGTH;
+		return Limits.MAX_IDENTIFIER_LENGTH;
 	}
 
     //----------------------------------------------------------------------

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/authentication/AuthenticationServiceBase.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/authentication/AuthenticationServiceBase.java?rev=1336775&r1=1336774&r2=1336775&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/authentication/AuthenticationServiceBase.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/authentication/AuthenticationServiceBase.java
Thu May 10 16:18:00 2012
@@ -227,12 +227,7 @@ public abstract class AuthenticationServ
 			return false;
 
 		String userName = userInfo.getProperty(Attribute.USERNAME_ATTR);
-		if ((userName != null) && userName.length() > Limits.DB2_MAX_USERID_LENGTH)
{
-		// DB2 has limits on length of the user id, so we enforce the same.
-		// This used to be error 28000 "Invalid authorization ID", but with v82,
-		// DB2 changed the behavior to return a normal "authorization failure
-		// occurred" error; so that means just return "false" and the correct
-		// exception will be thrown as usual.
+		if ((userName != null) && userName.length() > Limits.MAX_IDENTIFIER_LENGTH)
{
 			return false;
 		}
 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DatabaseMetaDataTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DatabaseMetaDataTest.java?rev=1336775&r1=1336774&r2=1336775&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DatabaseMetaDataTest.java
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/DatabaseMetaDataTest.java
Thu May 10 16:18:00 2012
@@ -534,7 +534,7 @@ public class DatabaseMetaDataTest extend
         assertEquals(0, dmd.getMaxStatements());
         assertEquals(128, dmd.getMaxTableNameLength());
         assertEquals(0, dmd.getMaxTablesInSelect());
-        assertEquals(30, dmd.getMaxUserNameLength());
+        assertEquals(128, dmd.getMaxUserNameLength());
     }
     
     public void testMiscellaneous() throws SQLException



Mime
View raw message