db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mi...@apache.org
Subject svn commit: r475330 - in /db/derby/code/trunk/java: engine/org/apache/derby/catalog/SystemProcedures.java testing/org/apache/derbyTesting/functionTests/master/compressTable.out testing/org/apache/derbyTesting/functionTests/tests/lang/compressTable.sql
Date Wed, 15 Nov 2006 17:53:46 GMT
Author: mikem
Date: Wed Nov 15 09:53:45 2006
New Revision: 475330

URL: http://svn.apache.org/viewvc?view=rev&rev=475330
Log:
DERBY-2057
contributed by Yip Ng
patch:  derby2057-trunk-diff02.txt

Fixed SYSCS_UTIL.SYSCS_INPLACE_COMPRESS_TABLE() implementation to match
documentation.  Arguments should treat non-zero as "true", previous to this
fix only "1" was treated as true.



Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/catalog/SystemProcedures.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/compressTable.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/compressTable.sql

Modified: db/derby/code/trunk/java/engine/org/apache/derby/catalog/SystemProcedures.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/catalog/SystemProcedures.java?view=diff&rev=475330&r1=475329&r2=475330
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/catalog/SystemProcedures.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/catalog/SystemProcedures.java Wed Nov
15 09:53:45 2006
@@ -924,12 +924,13 @@
     int     truncateEnd)
 		throws SQLException
     {
+ 
         org.apache.derby.iapi.db.OnlineCompress.compressTable(
             schema, 
             tablename, 
-            (purgeRows == 1),
-            (defragementRows == 1),
-            (truncateEnd == 1));
+            (purgeRows != 0),
+            (defragementRows != 0),
+            (truncateEnd != 0));
 
         return;
     }

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/compressTable.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/compressTable.out?view=diff&rev=475330&r1=475329&r2=475330
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/compressTable.out
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/compressTable.out
Wed Nov 15 09:53:45 2006
@@ -1296,5 +1296,32 @@
 STATID                              |REFERENCEID                         |TABLEID       
                     |CREATIONTIMESTAMP         |&|VALID|COLCOUNT   |STATISTICS  
 --------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 ij> --end derby-737 related test cases.
-;
+-- DERBY-2057
+-- Use non-zero args other than 1s.
+rollback;
+ij> autocommit on;
+ij> call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize','4096');
+0 rows inserted/updated/deleted
+ij> create table t1 (c1 char(254));
+0 rows inserted/updated/deleted
+ij> insert into t1 values 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z';
+26 rows inserted/updated/deleted
+ij> select conglomeratename, numallocatedpages, numfreepages from new org.apache.derby.diag.SpaceTable('T1')
tab;
+CONGLOMERATENAME                                                                        
                                       |NUMALLOCATEDPAGES   |NUMFREEPAGES        
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+T1                                                                                      
                                       |3                   |0                   
+ij> delete from t1;
+26 rows inserted/updated/deleted
+ij> select conglomeratename, numallocatedpages, numfreepages from new org.apache.derby.diag.SpaceTable('T1')
tab;
+CONGLOMERATENAME                                                                        
                                       |NUMALLOCATEDPAGES   |NUMFREEPAGES        
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+T1                                                                                      
                                       |1                   |2                   
+ij> call syscs_util.syscs_inplace_compress_table('APP','T1',2,2,2);
+0 rows inserted/updated/deleted
+ij> select conglomeratename, numallocatedpages, numfreepages from new org.apache.derby.diag.SpaceTable('T1')
tab;
+CONGLOMERATENAME                                                                        
                                       |NUMALLOCATEDPAGES   |NUMFREEPAGES        
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+T1                                                                                      
                                       |1                   |0                   
+ij> drop table t1;
+0 rows inserted/updated/deleted
 ij> 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/compressTable.sql
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/compressTable.sql?view=diff&rev=475330&r1=475329&r2=475330
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/compressTable.sql
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/compressTable.sql
Wed Nov 15 09:53:45 2006
@@ -585,3 +585,17 @@
 select * from sys.sysstatistics;
 
 --end derby-737 related test cases.
+
+-- DERBY-2057
+-- Use non-zero args other than 1s.
+rollback;
+autocommit on;
+call SYSCS_UTIL.SYSCS_SET_DATABASE_PROPERTY('derby.storage.pageSize','4096');
+create table t1 (c1 char(254));
+insert into t1 values 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z';
+select conglomeratename, numallocatedpages, numfreepages from new org.apache.derby.diag.SpaceTable('T1')
tab;
+delete from t1;
+select conglomeratename, numallocatedpages, numfreepages from new org.apache.derby.diag.SpaceTable('T1')
tab;
+call syscs_util.syscs_inplace_compress_table('APP','T1',2,2,2);
+select conglomeratename, numallocatedpages, numfreepages from new org.apache.derby.diag.SpaceTable('T1')
tab;
+drop table t1;



Mime
View raw message