You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by dj...@apache.org on 2007/05/31 07:20:11 UTC

svn commit: r543063 - in /db/derby/code/trunk/java/engine/org/apache/derby: iapi/sql/conn/LanguageConnectionContext.java impl/sql/compile/QueryTreeNode.java

Author: djd
Date: Wed May 30 22:20:11 2007
New Revision: 543063

URL: http://svn.apache.org/viewvc?view=rev&rev=543063
Log:
Cleanup some comments in QueryTreeNode.getSchemaDescriptor() to indicate these
methods must be used to get schemas during compilation and to indicate that
passing null returns the current compilation schema.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/conn/LanguageConnectionContext.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/QueryTreeNode.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=543063&r1=543062&r2=543063
==============================================================================
--- 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 Wed May 30 22:20:11 2007
@@ -424,7 +424,7 @@
 	public String getAuthorizationId();
   
 	/**
-	 *	Get the current default schema
+	 *	Get the current default schema for the connection.
 	 *
 	 * @return SchemaDescriptor	the current schema
 	 */

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/QueryTreeNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/QueryTreeNode.java?view=diff&rev=543063&r1=543062&r2=543063
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/QueryTreeNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/QueryTreeNode.java Wed May 30 22:20:11 2007
@@ -1292,15 +1292,22 @@
 
 	/**
 	 * Get the descriptor for the named schema. If the schemaName
-	 * parameter is NULL, it gets the descriptor for the current (default)
-	 * schema. Schema descriptors include authorization ids and schema ids.
+	 * parameter is NULL, it gets the descriptor for the current
+	 * compilation schema.
+     * 
+     * QueryTreeNodes must obtain schemas using this method or the two argument
+     * version of it. This is to ensure that the correct default compliation schema
+     * is returned and to allow determination of if the statement being compiled
+     * depends on the current schema. 
+     * 
+     * Schema descriptors include authorization ids and schema ids.
 	 * SQL92 allows a schema to specify a default character set - we will
 	 * not support this.  Will check default schema for a match
 	 * before scanning a system table.
 	 * 
 	 * @param schemaName	The name of the schema we're interested in.
 	 *			If the name is NULL, get the descriptor for the
-	 *			current schema.
+	 *			current compilation schema.
 	 *
 	 * @return	The descriptor for the schema.
 	 *
@@ -1312,6 +1319,25 @@
 		//return getSchemaDescriptor(schemaName, schemaName != null);
 		return getSchemaDescriptor(schemaName, true);
 	}
+    
+    /**
+     * Get the descriptor for the named schema. If the schemaName
+     * parameter is NULL, it gets the descriptor for the current
+     * compilation schema.
+     * 
+     * QueryTreeNodes must obtain schemas using this method or the single argument
+     * version of it. This is to ensure that the correct default compliation schema
+     * is returned and to allow determination of if the statement being compiled
+     * depends on the current schema. 
+     * 
+     * @param schemaName The name of the schema we're interested in.
+     * If the name is NULL, get the descriptor for the current compilation schema.
+     * @param raiseError True to raise an error if the schema does not exist,
+     * false to return null if the schema does not exist.
+     * @return Valid SchemaDescriptor or null if raiseError is false and the
+     * schema does not exist. 
+     * @throws StandardException Schema does not exist and raiseError is true.
+     */
 	final SchemaDescriptor	getSchemaDescriptor(String schemaName, boolean raiseError)
 		throws StandardException
 	{