db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From banda...@apache.org
Subject svn commit: r395328 - in /db/derby/code/trunk/java/engine/org/apache/derby: iapi/sql/depend/ iapi/sql/dictionary/ impl/sql/depend/ impl/sql/execute/
Date Wed, 19 Apr 2006 18:06:10 GMT
Author: bandaram
Date: Wed Apr 19 11:06:07 2006
New Revision: 395328

URL: http://svn.apache.org/viewcvs?rev=395328&view=rev
Log:
Remove code that is not being used. Not only improves our code coverage, will also reduces
complexity by removing dead code.

Remove partial code for DROP TABLE/VIEW CASCADE.

Submitted by Satheesh Bandaram (satheesh@sourcery.org)

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/depend/DependencyManager.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/SPSDescriptor.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ViewDescriptor.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/depend/BasicDependencyManager.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DropTableConstantAction.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/depend/DependencyManager.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/depend/DependencyManager.java?rev=395328&r1=395327&r2=395328&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/depend/DependencyManager.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/depend/DependencyManager.java
Wed Apr 19 11:06:07 2006
@@ -232,10 +232,7 @@
 	<p>
 	I do not know if it would be worthwhile to consider using the 
 	dependency manager to aid in the implementation of the SQL DROP
-	statements or not. SQL DROP statements tend to have CASCADE or
-	RESTRICT actions, where they either also DROP all objects that
-	somehow use or depend on the object being dropped, or refuse
-	to drop the object if any such objects exist.  Past implementations
+	statements or not. Past implementations
 	of database systems have not used the dependency system to implement
 	this functionality, but have instead hard-coded the lookups like so:
 
@@ -297,10 +294,7 @@
 	public static final int COMPRESS_TABLE = 33;
 	//using same action for rename table/column
 	public static final int RENAME = 34;
-	public static final int DROP_TABLE_CASCADE = 35;
-	public static final int DROP_VIEW_CASCADE = 36;
 	public static final int DROP_COLUMN = 37;
-	public static final int DROP_COLUMN_CASCADE = 38;
 	public static final int DROP_STATISTICS = 39;
 	public static final int UPDATE_STATISTICS = 40;
 	//rename index dependency behavior is not as stringent as rename table and column and

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/SPSDescriptor.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/SPSDescriptor.java?rev=395328&r1=395327&r2=395328&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/SPSDescriptor.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/SPSDescriptor.java
Wed Apr 19 11:06:07 2006
@@ -889,10 +889,7 @@
 			case DependencyManager.INTERNAL_RECOMPILE_REQUEST:
 			case DependencyManager.CREATE_TRIGGER:
 			case DependencyManager.DROP_TRIGGER:
-			case DependencyManager.DROP_TABLE_CASCADE:
-			case DependencyManager.DROP_VIEW_CASCADE:
 			case DependencyManager.DROP_COLUMN:
-			case DependencyManager.DROP_COLUMN_CASCADE:
 		    case DependencyManager.UPDATE_STATISTICS:
 		    case DependencyManager.DROP_STATISTICS:
     		case DependencyManager.TRUNCATE_TABLE:
@@ -966,10 +963,7 @@
 			case DependencyManager.INTERNAL_RECOMPILE_REQUEST:
 			case DependencyManager.CREATE_TRIGGER:
 			case DependencyManager.DROP_TRIGGER:
-			case DependencyManager.DROP_TABLE_CASCADE:
-			case DependencyManager.DROP_VIEW_CASCADE:
 			case DependencyManager.DROP_COLUMN:
-			case DependencyManager.DROP_COLUMN_CASCADE:
 		    case DependencyManager.UPDATE_STATISTICS:
 		    case DependencyManager.DROP_STATISTICS:
 			case DependencyManager.TRUNCATE_TABLE:

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ViewDescriptor.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ViewDescriptor.java?rev=395328&r1=395327&r2=395328&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ViewDescriptor.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/ViewDescriptor.java
Wed Apr 19 11:06:07 2006
@@ -253,9 +253,6 @@
 
 		    case DependencyManager.BULK_INSERT:
 		    case DependencyManager.COMPRESS_TABLE:
-		    case DependencyManager.DROP_TABLE_CASCADE:
-		    case DependencyManager.DROP_COLUMN_CASCADE:
-		    case DependencyManager.DROP_VIEW_CASCADE:
 		    case DependencyManager.RENAME_INDEX:
 			case DependencyManager.UPDATE_STATISTICS:
 			case DependencyManager.DROP_STATISTICS:
@@ -317,12 +314,6 @@
 			case DependencyManager.TRUNCATE_TABLE:
 				break;
 		
-			case DependencyManager.DROP_TABLE_CASCADE:
-			case DependencyManager.DROP_COLUMN_CASCADE:
-			case DependencyManager.DROP_VIEW_CASCADE:
-				dropViewCascade(lcc);
-				break;
-
 		    default:
 
 				/* We should never get here, since we can't have dangling references */
@@ -373,40 +364,6 @@
 			return "";
 		}
 	}
-	/**
-	   Drops the dependent view as part of a drop table cascade
-	 
-	   @exception StandardException thrown if failure occurs in dropping view
-	 */
-	private void dropViewCascade(LanguageConnectionContext lcc) throws StandardException
-	{
-		DataDictionary dd = getDataDictionary();
-
-		DependencyManager dm = dd.getDependencyManager();
-		TransactionController tc = lcc.getTransactionCompile();
-		SchemaDescriptor sd= dd.getSchemaDescriptor(compSchemaId, tc);
-
-		TableDescriptor td = dd.getTableDescriptor(uuid);
-
-		// we may have already dropped this view if it was a view on top of
-		// another view
-		// For example a->va->vva, creates 3 dependencies va->a, vva->a, vva->va
-		if (td == null)
-			return;
-
-		// make sure the table is a view
-		if (SanityManager.DEBUG)
-		{
-			SanityManager.ASSERT((td.getTableType() == TableDescriptor.VIEW_TYPE), 
-							"table descriptor not view type for view "+viewName);
-		}
-
-		// drop the View
-		dropViewWork(dd, dm, lcc, tc, sd, td, true);
-		lcc.getLastActivation().addWarning(
-						StandardException.newWarning(SQLState.LANG_VIEW_DROPPED,
- 							td.getName()));
-	}
 
 	public void dropViewWork(DataDictionary dd, DependencyManager dm,
 							  LanguageConnectionContext lcc, TransactionController tc,
@@ -421,8 +378,7 @@
 		 * cursor referencing a table/view that the user is attempting to
 		 * drop.) If no one objects, then invalidate any dependent objects.
 		 */
-		dm.invalidateFor(td,
-			cascade ? DependencyManager.DROP_VIEW_CASCADE : DependencyManager.DROP_VIEW, lcc);
+		dm.invalidateFor(td, DependencyManager.DROP_VIEW, lcc);
 
 		/* Clear the dependencies for the view */
 		dm.clearDependencies(lcc, this);

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/depend/BasicDependencyManager.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/depend/BasicDependencyManager.java?rev=395328&r1=395327&r2=395328&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/depend/BasicDependencyManager.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/depend/BasicDependencyManager.java
Wed Apr 19 11:06:07 2006
@@ -820,17 +820,8 @@
 			case COMPRESS_TABLE:
 				return "COMPRESS TABLE";
 
-			case DROP_TABLE_CASCADE:
-				return "DROP TABLE CASCADE";
-
-			case DROP_VIEW_CASCADE:
-				return "DROP VIEW CASCADE";
-
 			case DROP_COLUMN:
 				return "DROP COLUMN";
-
-			case DROP_COLUMN_CASCADE:
-				return "DROP COLUMN CASCADE";
 
 		    case DROP_STATISTICS:
 				return "DROP STATISTICS";

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java?rev=395328&r1=395327&r2=395328&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/AlterTableConstantAction.java
Wed Apr 19 11:06:07 2006
@@ -701,9 +701,7 @@
 		toDrop.set(columnPosition);
 		td.setReferencedColumnMap(toDrop);
 
-		dm.invalidateFor(td, cascade ?
-							 DependencyManager.DROP_COLUMN_CASCADE :
-							 DependencyManager.DROP_COLUMN, lcc);
+		dm.invalidateFor(td, DependencyManager.DROP_COLUMN, lcc);
 					
 		// If column has a default we drop the default and any dependencies
 		if (columnDescriptor.getDefaultInfo() != null)

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DropTableConstantAction.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DropTableConstantAction.java?rev=395328&r1=395327&r2=395328&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DropTableConstantAction.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/DropTableConstantAction.java
Wed Apr 19 11:06:07 2006
@@ -261,9 +261,7 @@
 		 * decoding tuples in SYSDEPENDS.
 		 */
 
-		dm.invalidateFor(td, cascade ?
-						DependencyManager.DROP_TABLE_CASCADE : DependencyManager.DROP_TABLE,
-						lcc);
+		dm.invalidateFor(td, DependencyManager.DROP_TABLE, lcc);
 
 		/* Drop the table */
 		dd.dropTableDescriptor(td, sd, tc);



Mime
View raw message