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 da...@apache.org on 2012/06/14 17:15:37 UTC
svn commit: r1350289 - in
/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql: catalog/ compile/
Author: dag
Date: Thu Jun 14 15:15:36 2012
New Revision: 1350289
URL: http://svn.apache.org/viewvc?rev=1350289&view=rev
Log:
DERBY-5814 Source cleanup in catalogs "impl.sql.catalog" and "impl.sql.compile"
Patch catalog-compile-cleaning-2, which:
a) removed unused private methods
b) removed unused local variables and members
c) cleaned up imports
d) remove unused formal arguments
Modified:
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DropDependencyFilter.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SPSNameCacheable.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SequenceGenerator.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/BaseTypeCompiler.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateAliasNode.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ExecSPSNode.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromTable.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromVTI.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DropDependencyFilter.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DropDependencyFilter.java?rev=1350289&r1=1350288&r2=1350289&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DropDependencyFilter.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DropDependencyFilter.java Thu Jun 14 15:15:36 2012
@@ -21,28 +21,17 @@
package org.apache.derby.impl.sql.catalog;
-import org.apache.derby.iapi.services.sanity.SanityManager;
-
-import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
-
-import org.apache.derby.iapi.types.DataValueDescriptor;
-
-import org.apache.derby.iapi.types.BooleanDataValue;
-import org.apache.derby.iapi.types.SQLBoolean;
-
-import org.apache.derby.iapi.sql.execute.ExecutionFactory;
-
-import org.apache.derby.iapi.services.context.ContextService;
-import org.apache.derby.iapi.types.DataValueFactory;
-
-import org.apache.derby.iapi.services.monitor.Monitor;
-
-import org.apache.derby.iapi.sql.execute.TupleFilter;
-import org.apache.derby.iapi.sql.execute.ExecRow;
-import org.apache.derby.iapi.error.StandardException;
import org.apache.derby.catalog.UUID;
+import org.apache.derby.iapi.error.StandardException;
+import org.apache.derby.iapi.services.monitor.Monitor;
import org.apache.derby.iapi.services.uuid.UUIDFactory;
+import org.apache.derby.iapi.sql.execute.ExecRow;
+import org.apache.derby.iapi.sql.execute.TupleFilter;
+import org.apache.derby.iapi.types.BooleanDataValue;
+import org.apache.derby.iapi.types.DataValueDescriptor;
+import org.apache.derby.iapi.types.DataValueFactory;
+import org.apache.derby.iapi.types.SQLBoolean;
/**
@@ -157,25 +146,6 @@ public class DropDependencyFilter implem
}
/**
- * Gets the DataValueFactory for this connection.
- *
- * @return the data value factory for this connection
- */
- private DataValueFactory getDataValueFactory()
- {
- if ( dataValueFactory == null )
- {
- LanguageConnectionContext lcc = (LanguageConnectionContext)
- ContextService.getContext
- (LanguageConnectionContext.CONTEXT_ID);
-
- dataValueFactory = lcc.getDataValueFactory();
- }
-
- return dataValueFactory;
- }
-
- /**
* Gets a BooleanDataValue representing TRUE.
*
* @return a TRUE value
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SPSNameCacheable.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SPSNameCacheable.java?rev=1350289&r1=1350288&r2=1350289&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SPSNameCacheable.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SPSNameCacheable.java Thu Jun 14 15:15:36 2012
@@ -21,17 +21,10 @@
package org.apache.derby.impl.sql.catalog;
-import org.apache.derby.iapi.services.cache.Cacheable;
-import org.apache.derby.iapi.services.cache.CacheManager;
-
-import org.apache.derby.iapi.services.stream.HeaderPrintWriter;
-
-import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor;
-import org.apache.derby.iapi.sql.dictionary.SPSDescriptor;
-
import org.apache.derby.iapi.error.StandardException;
-
+import org.apache.derby.iapi.services.cache.Cacheable;
import org.apache.derby.iapi.services.sanity.SanityManager;
+import org.apache.derby.iapi.sql.dictionary.SPSDescriptor;
/**
* This class implements a Cacheable for a DataDictionary cache of
@@ -229,54 +222,54 @@ class SPSNameCacheable implements Cachea
return spsd;
}
- /**
- * Check the consistency of the table descriptor held by this TDCacheable
- * versus an uncached table descriptor.
- *
- * @param uncachedSpsd The uncached descriptor to compare to
- * @param identity The identity of the table descriptor
- * @param reportInconsistent A HeaderPrintWriter to send complaints to
- *
- * @return true if the descriptors are the same, false if they're different
- *
- * @exception StandardException Thrown on error
- */
- private boolean checkConsistency(SPSDescriptor uncachedSpsd,
- Object identity,
- HeaderPrintWriter reportInconsistent)
- throws StandardException
- {
- boolean retval = true;
-
- if (SanityManager.DEBUG)
- {
- if (uncachedSpsd == null)
- {
- reportInconsistent.println(
- "Inconsistent SPSNameCacheable: identity = " + identity +
- ", uncached table descriptor not found.");
- retval = false;
- }
- else
- {
- if (
- (!uncachedSpsd.getText().equals(spsd.getText())) ||
- (!uncachedSpsd.getUsingText().equals(spsd.getUsingText())) ||
- (!uncachedSpsd.getQualifiedName().equals(spsd.getQualifiedName()))
- )
- {
- reportInconsistent.println(
- "Inconsistent SPSNameCacheable: identity = " + identity +
- ", cached SPS = " +
- spsd +
- ", uncached SPS = " +
- uncachedSpsd);
-
- retval = false;
- }
- }
- }
-
- return retval;
- }
+ // /**
+ // * Check the consistency of the table descriptor held by this TDCacheable
+ // * versus an uncached table descriptor.
+ // *
+ // * @param uncachedSpsd The uncached descriptor to compare to
+ // * @param identity The identity of the table descriptor
+ // * @param reportInconsistent A HeaderPrintWriter to send complaints to
+ // *
+ // * @return true if the descriptors are the same, false if they're different
+ // *
+ // * @exception StandardException Thrown on error
+ // */
+ // private boolean checkConsistency(SPSDescriptor uncachedSpsd,
+ // Object identity,
+ // HeaderPrintWriter reportInconsistent)
+ // throws StandardException
+ // {
+ // boolean retval = true;
+ //
+ // if (SanityManager.DEBUG)
+ // {
+ // if (uncachedSpsd == null)
+ // {
+ // reportInconsistent.println(
+ // "Inconsistent SPSNameCacheable: identity = " + identity +
+ // ", uncached table descriptor not found.");
+ // retval = false;
+ // }
+ // else
+ // {
+ // if (
+ // (!uncachedSpsd.getText().equals(spsd.getText())) ||
+ // (!uncachedSpsd.getUsingText().equals(spsd.getUsingText())) ||
+ // (!uncachedSpsd.getQualifiedName().equals(spsd.getQualifiedName()))
+ // )
+ // {
+ // reportInconsistent.println(
+ // "Inconsistent SPSNameCacheable: identity = " + identity +
+ // ", cached SPS = " +
+ // spsd +
+ // ", uncached SPS = " +
+ // uncachedSpsd);
+
+ // retval = false;
+ // }
+ // }
+ // }
+ //
+ // return retval;
+ // }
}
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SequenceGenerator.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SequenceGenerator.java?rev=1350289&r1=1350288&r2=1350289&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SequenceGenerator.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/SequenceGenerator.java Thu Jun 14 15:15:36 2012
@@ -23,16 +23,6 @@ package org.apache.derby.impl.sql.catalo
import org.apache.derby.catalog.SequencePreallocator;
import org.apache.derby.iapi.error.StandardException;
import org.apache.derby.iapi.reference.SQLState;
-import org.apache.derby.iapi.services.cache.Cacheable;
-import org.apache.derby.iapi.services.cache.CacheManager;
-import org.apache.derby.iapi.services.context.ContextManager;
-import org.apache.derby.iapi.services.context.ContextService;
-import org.apache.derby.iapi.services.sanity.SanityManager;
-import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
-import org.apache.derby.iapi.sql.dictionary.SequenceDescriptor;
-import org.apache.derby.iapi.store.access.TransactionController;
-import org.apache.derby.iapi.types.NumberDataValue;
-import org.apache.derby.iapi.types.RowLocation;
/**
* <p>
@@ -516,24 +506,4 @@ public class SequenceGenerator
return happyResult;
}
-
-
- ///////////////////////////////////////////////////////////////////////////////////
- //
- // UTILITY MINIONS
- //
- ///////////////////////////////////////////////////////////////////////////////////
-
- private static LanguageConnectionContext getLCC()
- {
- return (LanguageConnectionContext)
- ContextService.getContextOrNull(LanguageConnectionContext.CONTEXT_ID);
- }
-
- /** Report an unimplemented feature */
- private StandardException unimplementedFeature()
- {
- return StandardException.newException( SQLState.BTREE_UNIMPLEMENTED_FEATURE );
- }
-
}
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/BaseTypeCompiler.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/BaseTypeCompiler.java?rev=1350289&r1=1350288&r2=1350289&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/BaseTypeCompiler.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/BaseTypeCompiler.java Thu Jun 14 15:15:36 2012
@@ -21,27 +21,16 @@
package org.apache.derby.impl.sql.compile;
+import org.apache.derby.iapi.error.StandardException;
import org.apache.derby.iapi.reference.SQLState;
+import org.apache.derby.iapi.services.classfile.VMOpcode;
+import org.apache.derby.iapi.services.compiler.LocalField;
+import org.apache.derby.iapi.services.compiler.MethodBuilder;
import org.apache.derby.iapi.services.loader.ClassFactory;
-
import org.apache.derby.iapi.services.sanity.SanityManager;
-
-import org.apache.derby.iapi.error.StandardException;
-
import org.apache.derby.iapi.sql.compile.TypeCompiler;
-
-import org.apache.derby.iapi.types.DataValueDescriptor;
-import org.apache.derby.iapi.types.DataValueFactory;
-import org.apache.derby.iapi.types.NumberDataValue;
-import org.apache.derby.iapi.types.SQLInteger;
-import org.apache.derby.iapi.types.TypeId;
-
import org.apache.derby.iapi.types.DataTypeDescriptor;
-
-import org.apache.derby.iapi.services.compiler.LocalField;
-import org.apache.derby.iapi.services.compiler.MethodBuilder;
-
-import org.apache.derby.iapi.services.classfile.VMOpcode;
+import org.apache.derby.iapi.types.TypeId;
/**
* This is the base implementation of TypeCompiler
@@ -364,18 +353,6 @@ abstract class BaseTypeCompiler implemen
{
return getTypeId().getTypeFormatId();
}
-
- private static DataValueDescriptor gnn(DataValueFactory dvf)
- {
- return dvf.getNullInteger((NumberDataValue) null);
- }
-
- private static DataValueDescriptor gnn2(DataValueFactory dvf)
- {
- return new SQLInteger();
- }
-
-
}
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateAliasNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateAliasNode.java?rev=1350289&r1=1350288&r2=1350289&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateAliasNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateAliasNode.java Thu Jun 14 15:15:36 2012
@@ -21,31 +21,21 @@
package org.apache.derby.impl.sql.compile;
-import org.apache.derby.iapi.reference.SQLState;
-import org.apache.derby.iapi.reference.Limits;
-
-import org.apache.derby.iapi.sql.execute.ConstantAction;
-
-import org.apache.derby.iapi.types.TypeId;
-import org.apache.derby.iapi.types.DataTypeDescriptor;
-import org.apache.derby.iapi.types.StringDataValue;
-
-import org.apache.derby.iapi.sql.dictionary.DataDictionary;
-import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor;
-import org.apache.derby.iapi.reference.JDBC30Translation;
-
-import org.apache.derby.iapi.error.StandardException;
-
-import org.apache.derby.iapi.services.sanity.SanityManager;
-
+import java.util.Vector;
import org.apache.derby.catalog.AliasInfo;
import org.apache.derby.catalog.TypeDescriptor;
import org.apache.derby.catalog.types.RoutineAliasInfo;
import org.apache.derby.catalog.types.SynonymAliasInfo;
-import org.apache.derby.catalog.types.TypeDescriptorImpl;
import org.apache.derby.catalog.types.UDTAliasInfo;
-
-import java.util.Vector;
+import org.apache.derby.iapi.error.StandardException;
+import org.apache.derby.iapi.reference.Limits;
+import org.apache.derby.iapi.reference.SQLState;
+import org.apache.derby.iapi.services.sanity.SanityManager;
+import org.apache.derby.iapi.sql.dictionary.DataDictionary;
+import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor;
+import org.apache.derby.iapi.sql.execute.ConstantAction;
+import org.apache.derby.iapi.types.DataTypeDescriptor;
+import org.apache.derby.iapi.types.TypeId;
/**
* A CreateAliasNode represents a CREATE ALIAS statement.
@@ -76,7 +66,6 @@ public class CreateAliasNode extends DDL
private String javaClassName;
private String methodName;
private char aliasType;
- private boolean delimitedIdentifier;
private AliasInfo aliasInfo;
@@ -88,10 +77,7 @@ public class CreateAliasNode extends DDL
* @param targetObject Target name
* @param methodName The method name
* @param aliasType The alias type
- * @param delimitedIdentifier Whether or not to treat the class name
- * as a delimited identifier if trying to
- * resolve it as a class alias
- *
+ *
* @exception StandardException Thrown on error
*/
public void init(
@@ -99,8 +85,7 @@ public class CreateAliasNode extends DDL
Object targetObject,
Object methodName,
Object aliasSpecificInfo,
- Object aliasType,
- Object delimitedIdentifier)
+ Object aliasType)
throws StandardException
{
TableName qn = (TableName) aliasName;
@@ -122,8 +107,6 @@ public class CreateAliasNode extends DDL
{
this.javaClassName = (String) targetObject;
this.methodName = (String) methodName;
- this.delimitedIdentifier =
- ((Boolean) delimitedIdentifier).booleanValue();
//routineElements contains the description of the procedure.
//
@@ -290,48 +273,6 @@ public class CreateAliasNode extends DDL
}
}
- /**
- * CreateAliasNode creates the RoutineAliasInfo for a user defined function
- * or procedure in it's init method, which is called by the parser. But at
- * that time, we do not have the SchemaDescriptor ready to determine the
- * collation type. Hence, at the bind time, when we do have the
- * SchemaDescriptor available, we should go back and fix the
- * RoutineAliasInfo to have correct collation for its character string
- * parameters and also fix its return type (for functions) so as to have
- * correct collation if it is returning character string type.
- *
- * This method here checks if the RoutineAliasInfo has any character string
- * types associated with it. If not, then the RoutineAliasInfo that got
- * created at parsing time is just fine. But if not, then we should take
- * care of the collation type of it's character string types.
- *
- * @return true if it has a parameter or return type of character string
- */
- private boolean anyStringTypeDescriptor() {
- RoutineAliasInfo rai = (RoutineAliasInfo)aliasInfo;
- TypeDescriptor aType = rai.getReturnType();
- TypeId compTypeId;
- /*
- ** Try for a built in type matching the
- ** type name.
- */
- if (aType != null) //that means we are not dealing with a procedure
- {
- compTypeId = TypeId.getBuiltInTypeId(aType.getTypeName());
- if (compTypeId != null && compTypeId.isStringTypeId())
- return true;
- }
- if (rai.getParameterCount() != 0) {
- int paramCount = rai.getParameterCount();
- TypeDescriptor[] paramTypes = rai.getParameterTypes();
- for (int i = 0; i < paramCount; i++) {
- compTypeId = TypeId.getBuiltInTypeId(paramTypes[i].getTypeName());
- if (compTypeId != null && compTypeId.isStringTypeId())
- return true;
- }
- }
- return false;
- }
// We inherit the generate() method from DDLStatementNode.
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ExecSPSNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ExecSPSNode.java?rev=1350289&r1=1350288&r2=1350289&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ExecSPSNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ExecSPSNode.java Thu Jun 14 15:15:36 2012
@@ -21,34 +21,19 @@
package org.apache.derby.impl.sql.compile;
-import org.apache.derby.iapi.services.sanity.SanityManager;
-
-import org.apache.derby.iapi.services.loader.GeneratedClass;
-
import org.apache.derby.iapi.error.StandardException;
-
-import org.apache.derby.iapi.sql.compile.CompilerContext;
-
+import org.apache.derby.iapi.reference.SQLState;
+import org.apache.derby.iapi.services.loader.GeneratedClass;
+import org.apache.derby.iapi.services.sanity.SanityManager;
+import org.apache.derby.iapi.sql.ResultDescription;
import org.apache.derby.iapi.sql.dictionary.DataDictionary;
-import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor;
import org.apache.derby.iapi.sql.dictionary.SPSDescriptor;
-
-import org.apache.derby.iapi.sql.depend.DependencyManager;
-
-import org.apache.derby.iapi.reference.SQLState;
-
+import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor;
import org.apache.derby.iapi.sql.execute.ConstantAction;
import org.apache.derby.iapi.sql.execute.ExecPreparedStatement;
-
import org.apache.derby.iapi.types.DataTypeDescriptor;
-import org.apache.derby.iapi.sql.PreparedStatement;
-import org.apache.derby.iapi.sql.ResultDescription;
-
-import org.apache.derby.impl.sql.CursorInfo;
-
import org.apache.derby.iapi.util.ByteArray;
-import java.util.Enumeration;
/**
* A ExecSPSNode is the root of a QueryTree
@@ -314,10 +299,4 @@ public class ExecSPSNode extends Stateme
{
return "EXECUTE STATEMENT";
}
-
- // called after bind only
- private final SPSDescriptor getSPSDescriptor()
- {
- return spsd;
- }
}
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromTable.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromTable.java?rev=1350289&r1=1350288&r2=1350289&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromTable.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromTable.java Thu Jun 14 15:15:36 2012
@@ -21,39 +21,29 @@
package org.apache.derby.impl.sql.compile;
-import org.apache.derby.iapi.services.context.ContextManager;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Properties;
+import java.util.Vector;
+import org.apache.derby.iapi.error.StandardException;
+import org.apache.derby.iapi.reference.SQLState;
+import org.apache.derby.iapi.services.io.FormatableBitSet;
+import org.apache.derby.iapi.services.sanity.SanityManager;
+import org.apache.derby.iapi.sql.compile.AccessPath;
+import org.apache.derby.iapi.sql.compile.C_NodeTypes;
+import org.apache.derby.iapi.sql.compile.CostEstimate;
+import org.apache.derby.iapi.sql.compile.JoinStrategy;
import org.apache.derby.iapi.sql.compile.Optimizable;
import org.apache.derby.iapi.sql.compile.OptimizablePredicate;
import org.apache.derby.iapi.sql.compile.OptimizablePredicateList;
import org.apache.derby.iapi.sql.compile.Optimizer;
-import org.apache.derby.iapi.sql.compile.CostEstimate;
-import org.apache.derby.iapi.sql.compile.JoinStrategy;
-import org.apache.derby.iapi.sql.compile.AccessPath;
import org.apache.derby.iapi.sql.compile.RowOrdering;
-import org.apache.derby.iapi.sql.compile.C_NodeTypes;
-
import org.apache.derby.iapi.sql.dictionary.*;
-
import org.apache.derby.iapi.types.DataTypeDescriptor;
-
-import org.apache.derby.iapi.error.StandardException;
-import org.apache.derby.iapi.services.sanity.SanityManager;
-
-import org.apache.derby.iapi.reference.SQLState;
-import org.apache.derby.iapi.error.StandardException;
-
-import org.apache.derby.impl.sql.execute.HashScanResultSet;
-
import org.apache.derby.iapi.util.JBitSet;
-import org.apache.derby.iapi.services.io.FormatableBitSet;
import org.apache.derby.iapi.util.StringUtil;
-import org.apache.derby.catalog.UUID;
-
-import java.util.Enumeration;
-import java.util.Properties;
-import java.util.Vector;
-import java.util.HashMap;
+import org.apache.derby.impl.sql.execute.HashScanResultSet;
/**
* A FromTable represents a table in the FROM clause of a DML statement.
@@ -94,8 +84,6 @@ abstract class FromTable extends ResultS
protected CostEstimate bestCostEstimate;
- private FormatableBitSet refCols;
-
private double perRowUsage = -1;
private boolean considerSortAvoidancePath;
@@ -435,7 +423,6 @@ abstract class FromTable extends ResultS
* invalid value for hashLoadFactor
* invalid value for hashMaxCapacity
*/
- boolean indexSpecified = false;
Enumeration e = tableProperties.keys();
while (e.hasMoreElements())
{
@@ -638,7 +625,6 @@ abstract class FromTable extends ResultS
/* also store the name of the access path; i.e index name/constraint
* name if we're using an index to access the base table.
*/
- ConglomerateDescriptor cd = bestPath.getConglomerateDescriptor();
if (isBaseTable())
{
@@ -1002,15 +988,6 @@ abstract class FromTable extends ResultS
return -1.0;
}
- private FormatableBitSet getRefCols()
- {
- if (refCols == null)
- refCols = resultColumns.getReferencedFormatableBitSet(cursorTargetTable(), true, false);
-
- return refCols;
- }
-
-
/**
* Return the user specified join strategy, if any for this table.
*
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromVTI.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromVTI.java?rev=1350289&r1=1350288&r2=1350289&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromVTI.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromVTI.java Thu Jun 14 15:15:36 2012
@@ -21,81 +21,53 @@
package org.apache.derby.impl.sql.compile;
-import org.apache.derby.iapi.services.loader.ClassInspector;
-import org.apache.derby.iapi.services.loader.GeneratedMethod;
-
-import org.apache.derby.iapi.services.context.ContextManager;
-
-import org.apache.derby.iapi.services.compiler.MethodBuilder;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
+import java.sql.SQLException;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Vector;
+import org.apache.derby.catalog.TypeDescriptor;
+import org.apache.derby.catalog.UUID;
+import org.apache.derby.catalog.types.RoutineAliasInfo;
+import org.apache.derby.iapi.error.StandardException;
+import org.apache.derby.iapi.reference.ClassName;
+import org.apache.derby.iapi.reference.SQLState;
+import org.apache.derby.iapi.services.classfile.VMOpcode;
import org.apache.derby.iapi.services.compiler.LocalField;
-
+import org.apache.derby.iapi.services.compiler.MethodBuilder;
+import org.apache.derby.iapi.services.io.FormatableBitSet;
+import org.apache.derby.iapi.services.io.FormatableHashtable;
+import org.apache.derby.iapi.services.loader.ClassInspector;
import org.apache.derby.iapi.services.sanity.SanityManager;
-
-import org.apache.derby.iapi.error.StandardException;
-
-import org.apache.derby.iapi.sql.compile.CompilerContext;
+import org.apache.derby.iapi.sql.compile.C_NodeTypes;
+import org.apache.derby.iapi.sql.compile.CostEstimate;
+import org.apache.derby.iapi.sql.compile.Optimizable;
+import org.apache.derby.iapi.sql.compile.OptimizablePredicate;
import org.apache.derby.iapi.sql.compile.OptimizablePredicateList;
import org.apache.derby.iapi.sql.compile.Optimizer;
-import org.apache.derby.iapi.sql.compile.OptimizablePredicate;
-import org.apache.derby.iapi.sql.compile.Optimizable;
-import org.apache.derby.iapi.sql.compile.CostEstimate;
-import org.apache.derby.iapi.sql.compile.Visitable;
-import org.apache.derby.iapi.sql.compile.Visitor;
import org.apache.derby.iapi.sql.compile.RowOrdering;
-import org.apache.derby.iapi.sql.compile.C_NodeTypes;
-
+import org.apache.derby.iapi.sql.compile.Visitor;
import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
-
-import org.apache.derby.iapi.sql.dictionary.DataDictionary;
import org.apache.derby.iapi.sql.dictionary.ColumnDescriptor;
import org.apache.derby.iapi.sql.dictionary.ColumnDescriptorList;
import org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor;
+import org.apache.derby.iapi.sql.dictionary.DataDictionary;
import org.apache.derby.iapi.sql.dictionary.TableDescriptor;
+import org.apache.derby.iapi.sql.execute.ExecutionContext;
import org.apache.derby.iapi.types.DataTypeDescriptor;
-
-import org.apache.derby.iapi.reference.ClassName;
-import org.apache.derby.iapi.reference.SQLState;
-
-import org.apache.derby.iapi.sql.Activation;
-
-import org.apache.derby.catalog.TypeDescriptor;
-import org.apache.derby.catalog.UUID;
-import org.apache.derby.catalog.types.RoutineAliasInfo;
-
+import org.apache.derby.iapi.util.JBitSet;
import org.apache.derby.vti.DeferModification;
import org.apache.derby.vti.RestrictedVTI;
import org.apache.derby.vti.Restriction;
import org.apache.derby.vti.VTICosting;
import org.apache.derby.vti.VTIEnvironment;
-import org.apache.derby.iapi.util.JBitSet;
-import org.apache.derby.iapi.services.io.FormatableBitSet;
-import org.apache.derby.iapi.services.classfile.VMOpcode;
-import org.apache.derby.iapi.services.info.JVMInfo;
-
-import org.apache.derby.impl.sql.compile.ActivationClassBuilder;
-import org.apache.derby.iapi.sql.execute.ExecutionContext;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.ResultSetMetaData;
-import java.sql.SQLException;
-import java.sql.Types;
-
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Properties;
-import java.util.Vector;
-import org.apache.derby.iapi.services.io.FormatableHashtable;
-
-import java.lang.reflect.Modifier;
-
/**
* A FromVTI represents a VTI in the FROM list of a DML statement.
*
@@ -123,19 +95,6 @@ public class FromVTI extends FromTable i
private PredicateList restrictionList;
-
- /**
- Was a FOR UPDATE clause specified in a SELECT statement.
- */
- private boolean forUpdatePresent;
-
-
- /**
- Was the FOR UPDATE clause empty (no columns specified).
- */
- private boolean emptyForUpdate;
-
-
/*
** We don't know how expensive a virtual table will be.
** Let's say it has 10000 rows with a cost of 100000.
@@ -153,7 +112,6 @@ public class FromVTI extends FromTable i
private JavaValueNode[] methodParms;
private boolean controlsDeferral;
- private boolean isInsensitive;
private int resultSetType = ResultSet.TYPE_FORWARD_ONLY;
private String[] projectedColumnNames; // for RestrictedVTIs
@@ -739,7 +697,6 @@ public class FromVTI extends FromTable i
catch( SQLException sqle){}
catch( java.lang.AbstractMethodError ame){}
catch( java.lang.NoSuchMethodError nsme){}
- isInsensitive = (resultSetType == ResultSet.TYPE_SCROLL_INSENSITIVE);
if (!implementsVTICosting) {
ps.close();
@@ -906,8 +863,6 @@ public class FromVTI extends FromTable i
public void bindExpressions(FromList fromListParam)
throws StandardException
{
- ResultColumnList derivedRCL = resultColumns;
-
/* Figure out if the VTIs parameters are QUERY_INVARIANT. If so,
* then the VTI is a candidate for materialization at execution time
* if it is the inner table of a join or in a subquery.
@@ -1045,7 +1000,6 @@ public class FromVTI extends FromTable i
ResultColumn resultColumn = null;
TableName columnsTableName;
- TableName exposedTableName;
columnsTableName = columnReference.getTableNameNode();
@@ -1808,10 +1762,6 @@ public class FromVTI extends FromTable i
ValueNode valueNode;
ColumnDescriptor colDesc = null;
-
- TableName tableName = makeTableName(td.getSchemaName(),
- td.getName());
-
/* Add all of the columns in the table */
rcList = (ResultColumnList) getNodeFactory().getNode(
C_NodeTypes.RESULT_COLUMN_LIST,
@@ -1852,35 +1802,6 @@ public class FromVTI extends FromTable i
return true;
}
- protected void markUpdatableByCursor(Vector updateColumns) {
- super.markUpdatableByCursor(updateColumns);
- forUpdatePresent = true;
- emptyForUpdate = ((updateColumns == null) || (updateColumns.size() == 0));
- }
-
- private int[] getForUpdateColumnList() {
-
- int[] tempList = new int[getNumColumnsReturned()];
- int offset = 0;
-
- for (int col = 0; col < tempList.length; col++)
- {
- if (resultColumns.updatableByCursor(col))
- tempList[offset++] = col + 1; // JDBC id
- }
-
- int[] list;
-
- if (offset == tempList.length)
- list = tempList;
- else {
- list = new int[offset];
- System.arraycopy(tempList, 0, list, 0, offset);
- }
-
- return list;
- }
-
/*
** VTIEnvironment
*/
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj?rev=1350289&r1=1350288&r2=1350289&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj Thu Jun 14 15:15:36 2012
@@ -1679,11 +1679,7 @@ public class SQLParser
* @param targetName TableName for target, or the full path/method name
* @param aliasSpecificInfo Information specific to the type of alias being created.
* @param aliasType The type of alias to create
- * @param delimitedIdentifier Whether or not to treat the class name
- * as a delimited identifier if trying to
- * resolve it as a class alias.
- *
- * @return A CreateAliasNode matching the given parameters
+ * @return A CreateAliasNode matching the given parameters
*
* @exception StandardException Thrown on error
*/
@@ -1692,8 +1688,7 @@ public class SQLParser
Object aliasName,
Object targetName,
Object aliasSpecificInfo,
- char aliasType,
- Boolean delimitedIdentifier)
+ char aliasType)
throws StandardException
{
int nodeType = C_NodeTypes.CREATE_ALIAS_NODE;
@@ -1729,7 +1724,6 @@ public class SQLParser
methodName,
aliasSpecificInfo,
new Character(aliasType),
- delimitedIdentifier,
cm );
}
@@ -10656,8 +10650,7 @@ procedureDefinition() throws StandardExc
procedureName,
(String) procedureElements[ CreateAliasNode.EXTERNAL_NAME ],
procedureElements,
- AliasInfo.ALIAS_TYPE_PROCEDURE_AS_CHAR,
- Boolean.FALSE);
+ AliasInfo.ALIAS_TYPE_PROCEDURE_AS_CHAR);
}
}
@@ -10887,8 +10880,7 @@ functionDefinition() throws StandardExce
functionName,
(String) functionElements[CreateAliasNode.EXTERNAL_NAME],
functionElements,
- AliasInfo.ALIAS_TYPE_FUNCTION_AS_CHAR,
- Boolean.FALSE);
+ AliasInfo.ALIAS_TYPE_FUNCTION_AS_CHAR);
}
}
@@ -11037,8 +11029,7 @@ udtDefinition() throws StandardException
udtName,
externalName,
null,
- AliasInfo.ALIAS_TYPE_UDT_AS_CHAR,
- Boolean.FALSE);
+ AliasInfo.ALIAS_TYPE_UDT_AS_CHAR);
}
}
@@ -11196,8 +11187,7 @@ synonymDefinition() throws StandardExcep
synonymName,
targetName,
null,
- AliasInfo.ALIAS_TYPE_SYNONYM_AS_CHAR,
- Boolean.FALSE
+ AliasInfo.ALIAS_TYPE_SYNONYM_AS_CHAR
);
}
}