Return-Path: X-Original-To: apmail-db-derby-commits-archive@www.apache.org Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9F698DE27 for ; Tue, 17 Jul 2012 15:37:09 +0000 (UTC) Received: (qmail 95865 invoked by uid 500); 17 Jul 2012 15:37:09 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 95825 invoked by uid 500); 17 Jul 2012 15:37:09 -0000 Mailing-List: contact derby-commits-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Derby Development" List-Id: Delivered-To: mailing list derby-commits@db.apache.org Received: (qmail 95818 invoked by uid 99); 17 Jul 2012 15:37:08 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Jul 2012 15:37:08 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Jul 2012 15:37:06 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 05E792388860; Tue, 17 Jul 2012 15:36:46 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: derby-commits@db.apache.org From: rhillegas@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120717153646.05E792388860@eris.apache.org> 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' )" + ); + } + }