db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r494603 - in /db/derby/code/trunk/java/engine/org/apache/derby: iapi/sql/conn/LanguageConnectionContext.java iapi/sql/dictionary/DataDictionary.java impl/sql/catalog/DataDictionaryImpl.java impl/sql/conn/GenericLanguageConnectionContext.java
Date Tue, 09 Jan 2007 21:40:34 GMT
Author: djd
Date: Tue Jan  9 13:40:33 2007
New Revision: 494603

URL: http://svn.apache.org/viewvc?view=rev&rev=494603
Log:
Cleanup the DataDictionary/LanguageConnectionContext to remove dead code
that allowed the LanguageConnectionContext to define schema names.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/conn/LanguageConnectionContext.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/DataDictionary.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionContext.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/conn/LanguageConnectionContext.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/conn/LanguageConnectionContext.java?view=diff&rev=494603&r1=494602&r2=494603
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/conn/LanguageConnectionContext.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/conn/LanguageConnectionContext.java
Tue Jan  9 13:40:33 2007
@@ -391,35 +391,7 @@
 	 */
 
 	TransactionController getTransactionExecute();
-
-    /**
-     * Get the system schema name.
-     *
-     * @return a String containing the system schema name.
-     */
-    public String getSystemSchemaName() throws StandardException;
-    
-    /**
-     * Get the SYSIBM schema name.
-     *
-     * @return a String containing the SYSIBM schema name.
-     */
-    public String getSysIBMSchemaName() throws StandardException;
-
-    /**
-     * Get the SYSCS_DIAG schema name.
-     *
-     * @return a String containing the SYSIBM schema name.
-     */
-    public String getSystemDiagSchemaName() throws StandardException;
-
-    /**
-     * Get the SYSCS_UTIL schema name.
-     *
-     * @return a String containing the SYSIBM schema name.
-     */
-    public String getSystemUtilSchemaName() throws StandardException;
-    
+   
 	/**
 		Get the data dictionary 
 
@@ -457,13 +429,6 @@
 	 * @return String	the authorization id
 	 */
 	public String getAuthorizationId();
-
-    /**
-     * Get the declared global temporary tables schema name.
-     *
-     * @return a String containing the declared global temporary tables schema name.
-     */
-    public String getDeclaredGlobalTemporaryTablesSchemaName() throws StandardException;
   
 	/**
 	 *	Get the current default schema

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/DataDictionary.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/DataDictionary.java?view=diff&rev=494603&r1=494602&r2=494603
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/DataDictionary.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/DataDictionary.java
Tue Jan  9 13:40:33 2007
@@ -339,20 +339,6 @@
 						throws StandardException;
 
 	/**
-	 * Get the descriptor for the SYSCS_DIAG schema. Schema descriptors 
-     * include authorization ids and schema ids.
-     *
-	 * SQL92 allows a schema to specify a default character set - we will
-	 * not support this.
-	 *
-	 * @return	The descriptor for the schema.
-	 *
-	 * @exception StandardException		Thrown on failure
-	 */
-	public SchemaDescriptor	getSystemDiagSchemaDescriptor( )
-						throws StandardException;
-
-	/**
 	 * Get the descriptor for the declared global temporary table schema which is always named
"SESSION".
 	 *
 	 * SQL92 allows a schema to specify a default character set - we will

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java?view=diff&rev=494603&r1=494602&r2=494603
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
Tue Jan  9 13:40:33 2007
@@ -150,20 +150,9 @@
 import java.sql.Types;
 
 /**
- * This abstract class contains the common code for the "regular" and
- * limited data dictionaries.  The limited configuration puts an upper
- * limit on the number of tables a user is allowed to create.
- *
- * This class provides the entire implementation of DataDictionary,
- * and ModuleControl, except for the stop()
- * method, which is to be provided by a non-abstract super-class.
- * The reason for putting the stop() method in the super-class is to
- * prevent someone from inadvertently changing this to a non-abstract
- * class.  This class is shipped with both the limited and non-limited
- * configurations, and we don't want anyone to be able to cheat by
- * booting this class instead of booting the super-class.
+ * Standard database implementation of the data dictionary
+ * that stores the information in the system catlogs.
  */
-
 public final class	DataDictionaryImpl
 	implements DataDictionary, CacheableFactory, ModuleControl, ModuleSupportable,java.security.PrivilegedAction
 {
@@ -268,18 +257,10 @@
 	** SchemaDescriptors for system and app schemas.  Both
 	** are canonical.  We cache them for fast lookup.
 	*/
-	protected SchemaDescriptor systemSchemaDesc;
-	protected SchemaDescriptor sysIBMSchemaDesc;
-	protected SchemaDescriptor declaredGlobalTemporaryTablesSchemaDesc;
-	protected SchemaDescriptor systemDiagSchemaDesc;
-	protected SchemaDescriptor systemUtilSchemaDesc;
-
-    private String systemSchemaName;
-    private String systemDiagSchemaName;
-    private String systemUtilSchemaName;
-    private String sysIBMSchemaName;
-    private String declaredGlobalTemporaryTablesSchemaName;
-    boolean builtinSchemasAreFromLCC;
+	private SchemaDescriptor systemSchemaDesc;
+	private SchemaDescriptor sysIBMSchemaDesc;
+	private SchemaDescriptor declaredGlobalTemporaryTablesSchemaDesc;
+	private SchemaDescriptor systemUtilSchemaDesc;
 
     protected boolean convertIdToLower;
     // Convert identifiers to lower case (as in Foundation) or not.
@@ -349,8 +330,8 @@
 	// no other system tables have id's in the configuration.
 
 	public	DataDescriptorGenerator		dataDescriptorGenerator;
-	protected DataValueFactory			dvf;
-	protected AccessFactory               af;
+	private DataValueFactory			dvf;
+	AccessFactory               af;
 	//DataDictionaryContext				ddc;
 
 	private	ExecutionFactory	exFactory;
@@ -481,6 +462,8 @@
 		uuidFactory = Monitor.getMonitor().getUUIDFactory();
 
 		engineType = Monitor.getEngineType( startParams );
+        
+        getBuiltinSchemas();
 
 		// REMIND: actually, we're supposed to get the DataValueFactory
 		// out of the connection context...this is a bit of a shortcut.
@@ -1215,68 +1198,28 @@
 		return exFactory;
 	}
 
-    /* We defer getting the builtin schemas (system and default) past boot time so that
-     * the language connection context will be available.
-     */
-    private void getBuiltinSchemaNames() throws StandardException
-    {
-        if( builtinSchemasAreFromLCC)
-            return;
-        
-        LanguageConnectionContext lcc = getLCC();
-        if( null == lcc)
-        {
-            systemSchemaName        = SchemaDescriptor.STD_SYSTEM_SCHEMA_NAME;
-            sysIBMSchemaName        = SchemaDescriptor.IBM_SYSTEM_SCHEMA_NAME;
 
-            systemDiagSchemaName    = 
-                SchemaDescriptor.STD_SYSTEM_DIAG_SCHEMA_NAME;
-            systemUtilSchemaName    = 
-                SchemaDescriptor.STD_SYSTEM_UTIL_SCHEMA_NAME;
-            declaredGlobalTemporaryTablesSchemaName = 
-                SchemaDescriptor.STD_DECLARED_GLOBAL_TEMPORARY_TABLES_SCHEMA_NAME;
-        }
-        else
-        {
-            systemSchemaName        = lcc.getSystemSchemaName();
-            sysIBMSchemaName        = lcc.getSysIBMSchemaName();
-            systemDiagSchemaName    = lcc.getSystemDiagSchemaName();
-            systemUtilSchemaName    = lcc.getSystemUtilSchemaName();
-            declaredGlobalTemporaryTablesSchemaName = 
-                lcc.getDeclaredGlobalTemporaryTablesSchemaName();
-
-            builtinSchemasAreFromLCC = true;
-        }
-    }
-
-    private void getBuiltinSchemas() throws StandardException
+    /**
+     * Set up the builtin schema descriptors.
+     */
+    private void getBuiltinSchemas()
     {
-        if( builtinSchemasAreFromLCC
-            && null != systemSchemaDesc
-            && null != sysIBMSchemaDesc
-            && null != systemDiagSchemaDesc
-            && null != systemUtilSchemaDesc
-            && null != declaredGlobalTemporaryTablesSchemaDesc)
+        if (systemSchemaDesc != null)
             return;
-
-        getBuiltinSchemaNames();
-
+ 
 		systemSchemaDesc = 
-            newSystemSchemaDesc(
-                systemSchemaName, SchemaDescriptor.SYSTEM_SCHEMA_UUID);
+            newSystemSchemaDesc(SchemaDescriptor.STD_SYSTEM_SCHEMA_NAME,
+                SchemaDescriptor.SYSTEM_SCHEMA_UUID);
 		sysIBMSchemaDesc = 
-            newSystemSchemaDesc(
-                sysIBMSchemaName, SchemaDescriptor.SYSIBM_SCHEMA_UUID);
-		systemDiagSchemaDesc  = 
-            newSystemSchemaDesc(
-                systemDiagSchemaName, SchemaDescriptor.SYSCS_DIAG_SCHEMA_UUID);
+            newSystemSchemaDesc(SchemaDescriptor.IBM_SYSTEM_SCHEMA_NAME,
+                SchemaDescriptor.SYSIBM_SCHEMA_UUID);
 		systemUtilSchemaDesc  = 
-            newSystemSchemaDesc(
-                systemUtilSchemaName, SchemaDescriptor.SYSCS_UTIL_SCHEMA_UUID);
+            newSystemSchemaDesc(SchemaDescriptor.STD_SYSTEM_UTIL_SCHEMA_NAME,
+                SchemaDescriptor.SYSCS_UTIL_SCHEMA_UUID);
 
 		declaredGlobalTemporaryTablesSchemaDesc = 
             newDeclaredGlobalTemporaryTablesSchemaDesc(
-                declaredGlobalTemporaryTablesSchemaName);
+                    SchemaDescriptor.STD_DECLARED_GLOBAL_TEMPORARY_TABLES_SCHEMA_NAME);
     }
 
 	/**
@@ -1293,7 +1236,6 @@
 	public SchemaDescriptor	getSystemSchemaDescriptor()
 						throws StandardException
     {
-        getBuiltinSchemas();
         return systemSchemaDesc;
     }
 
@@ -1312,29 +1254,10 @@
 	public SchemaDescriptor	getSystemUtilSchemaDescriptor()
 						throws StandardException
     {
-        getBuiltinSchemas();
         return(systemUtilSchemaDesc);
     }
 
 	/**
-	 * Get the descriptor for the SYSCS_DIAG system schema. 
-     * Schema descriptors include authorization ids and schema ids.
-     *
-	 * SQL92 allows a schema to specify a default character set - we will
-	 * not support this.
-	 *
-	 * @return	The descriptor for the schema.
-	 *
-	 * @exception StandardException		Thrown on failure
-	 */
-	public SchemaDescriptor	getSystemDiagSchemaDescriptor()
-						throws StandardException
-    {
-        getBuiltinSchemas();
-        return(systemDiagSchemaDesc);
-    }
-
-	/**
 	 * Get the descriptor for the SYSIBM schema. Schema descriptors include 
      * authorization ids and schema ids.
      *
@@ -1348,7 +1271,6 @@
 	public SchemaDescriptor	getSysIBMSchemaDescriptor()
 						throws StandardException
     {
-        getBuiltinSchemas();
         return sysIBMSchemaDesc;
     }
 
@@ -1363,7 +1285,6 @@
 	public SchemaDescriptor	getDeclaredGlobalTemporaryTablesSchemaDescriptor()
         throws StandardException
     {
-        getBuiltinSchemas();
         return declaredGlobalTemporaryTablesSchemaDesc;
     }  
     
@@ -1378,8 +1299,6 @@
     public boolean isSystemSchemaName( String name)
         throws StandardException
     {
-        getBuiltinSchemaNames();
-
         boolean ret_val = false;
 
         for (int i = systemSchemaNames.length - 1; i >= 0;)

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionContext.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionContext.java?view=diff&rev=494603&r1=494602&r2=494603
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionContext.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionContext.java
Tue Jan  9 13:40:33 2007
@@ -2817,65 +2817,6 @@
 		statementDepth = 0;
 	}
 
-    /**
-     * Get the name of the system schema.
-     *
-     * @return	A String containing the name of the system schema.
-     * @throws StandardException
-     */
-    public String getSystemSchemaName() throws StandardException
-    {
-        return convertIdentifierCase( SchemaDescriptor.STD_SYSTEM_SCHEMA_NAME);
-    }
-    
-    /**
-     * Get the name of the SYSIBM schema.
-     *
-     * @return	A String containing the name of the SYSIBM schema.
-     * @throws StandardException
-     */
-    public String getSysIBMSchemaName() throws StandardException
-    {
-        return convertIdentifierCase( SchemaDescriptor.IBM_SYSTEM_SCHEMA_NAME);
-    }
-
-    /**
-     * Get the name of the SYSCS_DIAG schema.
-     *
-     * @return	A String containing the name of the SYSIBM schema.
-     * @throws StandardException
-     */
-    public String getSystemDiagSchemaName() throws StandardException
-    {
-        return(
-            convertIdentifierCase(
-                SchemaDescriptor.STD_SYSTEM_DIAG_SCHEMA_NAME));
-    }
-
-    /**
-     * Get the name of the SYSCS_UTIL schema.
-     *
-     * @return	A String containing the name of the SYSIBM schema.
-     * @throws StandardException
-     */
-    public String getSystemUtilSchemaName() throws StandardException
-    {
-        return(
-            convertIdentifierCase(
-                SchemaDescriptor.STD_SYSTEM_UTIL_SCHEMA_NAME));
-    }
-    
-    /**
-     * Get the declared global temporary tables schema name.
-     *
-     * @return	a String containing the declared global temporary tables schema name.
-     * @throws StandardException
-     */
-    public String getDeclaredGlobalTemporaryTablesSchemaName() throws StandardException
-    {
-        return convertIdentifierCase( SchemaDescriptor.STD_DECLARED_GLOBAL_TEMPORARY_TABLES_SCHEMA_NAME);
-    }
-
 	public DataDictionary getDataDictionary()
 	{
         return getDatabase().getDataDictionary();



Mime
View raw message