db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r1362545 - in /db/derby/code/branches/10.8: ./ java/engine/org/apache/derby/impl/sql/LanguageDbPropertySetter.java java/testing/org/apache/derbyTesting/functionTests/tests/lang/SQLAuthorizationPropTest.java
Date Tue, 17 Jul 2012 15:36:45 GMT
Author: rhillegas
Date: Tue Jul 17 15:36:45 2012
New Revision: 1362545

URL: http://svn.apache.org/viewvc?rev=1362545&view=rev
Log:
DERBY-5838: Port 1356333 from trunk to 10.8 branch.

Modified:
    db/derby/code/branches/10.8/   (props changed)
    db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/LanguageDbPropertySetter.java
    db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SQLAuthorizationPropTest.java

Propchange: db/derby/code/branches/10.8/
------------------------------------------------------------------------------
  Merged /db/derby/code/trunk:r1356333

Modified: db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/LanguageDbPropertySetter.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/LanguageDbPropertySetter.java?rev=1362545&r1=1362544&r2=1362545&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/LanguageDbPropertySetter.java
(original)
+++ db/derby/code/branches/10.8/java/engine/org/apache/derby/impl/sql/LanguageDbPropertySetter.java
Tue Jul 17 15:36:45 2012
@@ -30,6 +30,7 @@ import org.apache.derby.iapi.services.sa
 import org.apache.derby.iapi.services.context.ContextService;
 import org.apache.derby.iapi.error.StandardException;
 import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
+import org.apache.derby.iapi.sql.dictionary.DataDictionary;
 import org.apache.derby.iapi.store.access.TransactionController;
 import java.io.Serializable;
 import java.util.Dictionary;
@@ -50,6 +51,13 @@ public class LanguageDbPropertySetter im
 		Dictionary		p
 	) throws StandardException 
 	{
+        // Can't change the dictionary version manually. That could make the database
+        // unbootable. See DERBY-5838.
+		if ( key.trim().equals( DataDictionary.CORE_DATA_DICTIONARY_VERSION ) )
+		{
+            throw StandardException.newException( SQLState.PROPERTY_UNSUPPORTED_CHANGE, key,
value );
+        }
+        
 		// Disallow changing sqlAuthorization from true to false or null after
 		// switching to Standard authorization
 		if (key.trim().equals(Property.SQL_AUTHORIZATION_PROPERTY))

Modified: db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SQLAuthorizationPropTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SQLAuthorizationPropTest.java?rev=1362545&r1=1362544&r2=1362545&view=diff
==============================================================================
--- db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SQLAuthorizationPropTest.java
(original)
+++ db/derby/code/branches/10.8/java/testing/org/apache/derbyTesting/functionTests/tests/lang/SQLAuthorizationPropTest.java
Tue Jul 17 15:36:45 2012
@@ -1,6 +1,6 @@
 /*
 *
-* Derby - Class org.apache.derbyTesting.functionTests.lang.SQLAuthorizationPropTest
+* Derby - Class org.apache.derbyTesting.functionTests.tests.lang.SQLAuthorizationPropTest
 *
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
@@ -171,4 +171,21 @@ public class SQLAuthorizationPropTest ex
         }
         
 	}
+
+	/**
+	 * Verify that you can't make the database unbootable by changing
+     * the database version. See DERBY-5838.
+	 */
+	public void test_5838() throws Exception
+    {
+        Statement stmt = createStatement();
+
+        assertStatementError
+            (
+             "XCY02",
+             stmt,
+             "call syscs_util.syscs_set_database_property( 'DataDictionaryVersion', 'foobar'
)"
+             );
+    }
+    
 }



Mime
View raw message