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 2005/11/19 00:00:00 UTC

svn commit: r345595 - in /db/derby/code/trunk/java: engine/org/apache/derby/iapi/db/ testing/org/apache/derbyTesting/functionTests/master/ testing/org/apache/derbyTesting/functionTests/tests/store/

Author: djd
Date: Fri Nov 18 14:59:53 2005
New Revision: 345595

URL: http://svn.apache.org/viewcvs?rev=345595&view=rev
Log:
DERBY-571 Fix SYSCS_INPLACE_COMPRESS_TABLE to ignore VTI tables, like it ignores views.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/db/OnlineCompress.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/TransactionTable.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/TransactionTable.sql

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/db/OnlineCompress.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/iapi/db/OnlineCompress.java?rev=345595&r1=345594&r2=345595&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/db/OnlineCompress.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/db/OnlineCompress.java Fri Nov 18 14:59:53 2005
@@ -291,10 +291,16 @@
                     schemaName + "." + tableName);
             }
 
-            /* Skip views */
-            if (td.getTableType() == TableDescriptor.VIEW_TYPE)
+            switch (td.getTableType())
             {
-                return;
+            /* Skip views and vti tables */
+            case TableDescriptor.VIEW_TYPE:
+            case TableDescriptor.VTI_TYPE:
+            	return;
+            // other types give various errors here
+            // DERBY-719,DERBY-720
+            default:
+            	break;
             }
 
 
@@ -476,9 +482,16 @@
                 schemaName + "." + tableName);
         }
 
-        /* Skip views */
-        if (td.getTableType() != TableDescriptor.VIEW_TYPE)
+        switch (td.getTableType())
         {
+        /* Skip views and vti tables */
+        case TableDescriptor.VIEW_TYPE:
+        case TableDescriptor.VTI_TYPE:
+        	break;
+        // other types give various errors here
+        // DERBY-719,DERBY-720
+        default:
+          {
 
             ConglomerateDescriptor[] conglom_descriptors = 
                 td.getConglomerateDescriptors();
@@ -489,6 +502,7 @@
 
                 tc.purgeConglomerate(cd.getConglomerateNumber());
             }
+          }
         }
 
         return;
@@ -527,10 +541,17 @@
                 schemaName + "." + tableName);
         }
 
-        /* Skip views */
-        if (td.getTableType() != TableDescriptor.VIEW_TYPE)
+        switch (td.getTableType())
         {
-            ConglomerateDescriptor[] conglom_descriptors = 
+        /* Skip views and vti tables */
+        case TableDescriptor.VIEW_TYPE:
+        case TableDescriptor.VTI_TYPE:
+        	break;
+        // other types give various errors here
+        // DERBY-719,DERBY-720
+        default:
+          {
+          ConglomerateDescriptor[] conglom_descriptors = 
                 td.getConglomerateDescriptors();
 
             for (int cd_idx = 0; cd_idx < conglom_descriptors.length; cd_idx++)
@@ -539,6 +560,7 @@
 
                 tc.compressConglomerate(cd.getConglomerateNumber());
             }
+          }
         }
 
         return;

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/TransactionTable.out
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/TransactionTable.out?rev=345595&r1=345594&r2=345595&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/TransactionTable.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/TransactionTable.out Fri Nov 18 14:59:53 2005
@@ -242,6 +242,11 @@
 ERROR 42Y25: 'SYSCS_DIAG.TRANSACTION_TABLE' is a system table.  Users are not allowed to modify the contents of this table.
 ij(C1)> insert into syscs_diag.transaction_table(xid) values('bad');
 ERROR 42Y25: 'SYSCS_DIAG.TRANSACTION_TABLE' is a system table.  Users are not allowed to modify the contents of this table.
+ij(C1)> call SYSCS_UTIL.SYSCS_COMPRESS_TABLE('SYSCS_DIAG', 'TRANSACTION_TABLE', 1);
+ERROR 38000: The exception 'SQL Exception: 'ALTER TABLE' is not allowed in the 'SYSCS_DIAG' schema.' was thrown while evaluating an expression.
+ERROR 42X62: 'ALTER TABLE' is not allowed in the 'SYSCS_DIAG' schema.
+ij(C1)> call SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('SYSCS_DIAG', 'TRANSACTION_TABLE', 1, 1, 1);
+0 rows inserted/updated/deleted
 ij(C1)> -- ensure the old syntax still works until it is deprecated
 select xid from new org.apache.derby.diag.TransactionTable() AS t where 1 = 0;
 XID            

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/TransactionTable.sql
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/TransactionTable.sql?rev=345595&r1=345594&r2=345595&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/TransactionTable.sql (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/store/TransactionTable.sql Fri Nov 18 14:59:53 2005
@@ -144,6 +144,9 @@
 delete from syscs_diag.transaction_table where 1 = 1;
 insert into syscs_diag.transaction_table(xid) values('bad');
 
+call SYSCS_UTIL.SYSCS_COMPRESS_TABLE('SYSCS_DIAG', 'TRANSACTION_TABLE', 1);
+call SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE('SYSCS_DIAG', 'TRANSACTION_TABLE', 1, 1, 1);
+
 -- ensure the old syntax still works until it is deprecated
 select xid from new org.apache.derby.diag.TransactionTable() AS t where 1 = 0;
 update new org.apache.derby.diag.TransactionTable() set xid = NULL;