Return-Path: Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: (qmail 60736 invoked from network); 12 May 2007 06:54:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 May 2007 06:54:39 -0000 Received: (qmail 90525 invoked by uid 500); 12 May 2007 06:54:46 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 90492 invoked by uid 500); 12 May 2007 06:54:45 -0000 Mailing-List: contact derby-commits-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Derby Development" List-Id: Delivered-To: mailing list derby-commits@db.apache.org Received: (qmail 90481 invoked by uid 99); 12 May 2007 06:54:45 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 May 2007 23:54:45 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 May 2007 23:54:38 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 6F1621A9838; Fri, 11 May 2007 23:54:18 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r537349 - in /db/derby/code/trunk/java/engine/org/apache/derby: iapi/services/io/ArrayUtil.java impl/store/access/btree/BTree.java impl/store/access/btree/BTreeScan.java impl/store/access/conglomerate/TemplateRow.java Date: Sat, 12 May 2007 06:54:18 -0000 To: derby-commits@db.apache.org From: mikem@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070512065418.6F1621A9838@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mikem Date: Fri May 11 23:54:17 2007 New Revision: 537349 URL: http://svn.apache.org/viewvc?view=rev&rev=537349 Log: DERBY-2537 Fixed assert that did not work with collated database, it needed to be updated to take collation id of template into account. Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/io/ArrayUtil.java db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTree.java db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeScan.java db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate/TemplateRow.java Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/io/ArrayUtil.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/io/ArrayUtil.java?view=diff&rev=537349&r1=537348&r2=537349 ============================================================================== --- db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/io/ArrayUtil.java (original) +++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/io/ArrayUtil.java Fri May 11 23:54:17 2007 @@ -236,6 +236,26 @@ return retVal; } + public static String toString(int[] value) + { + String ret_val; + + if (value == null || value.length == 0) + { + ret_val = "null"; + } + else + { + ret_val = ""; + for (int i = 0; i < value.length; i++) + { + ret_val += "[" + value[i] + "],"; + } + } + return(ret_val); + } + + /////////////////////////////////////////////////////////////////// // // Methods for Arrays of LONGs Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTree.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTree.java?view=diff&rev=537349&r1=537348&r2=537349 ============================================================================== --- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTree.java (original) +++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTree.java Fri May 11 23:54:17 2007 @@ -57,6 +57,8 @@ import java.util.Properties; +import org.apache.derby.iapi.services.io.ArrayUtil; + /** A b-tree object corresponds to an instance of a b-tree conglomerate. It @@ -546,6 +548,8 @@ long conglomId) throws StandardException { + SanityManager.DEBUG_PRINT("BTree.getDynamicCompiledConglomInfo", "collation_ids = " + ArrayUtil.toString(collation_ids)); + SanityManager.showTrace(new Throwable()); return(new OpenConglomerateScratchSpace(format_ids, collation_ids)); } Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeScan.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeScan.java?view=diff&rev=537349&r1=537348&r2=537349 ============================================================================== --- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeScan.java (original) +++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/BTreeScan.java Fri May 11 23:54:17 2007 @@ -83,7 +83,7 @@ */ protected Transaction init_rawtran = null; protected boolean init_forUpdate; - protected FormatableBitSet init_scanColumnList; + protected FormatableBitSet init_scanColumnList; protected DataValueDescriptor[] init_template; protected DataValueDescriptor[] init_startKeyValue; protected int init_startSearchOperator = 0; @@ -1176,7 +1176,7 @@ int open_mode, int lock_level, BTreeLockingPolicy btree_locking_policy, - FormatableBitSet scanColumnList, + FormatableBitSet scanColumnList, DataValueDescriptor[] startKeyValue, int startSearchOperator, Qualifier qualifier[][], @@ -1236,14 +1236,12 @@ if (SanityManager.DEBUG) { - // RESOLVE - (mikem) we should we require a template, need to - // clean up some of the old tests which did not provide one? - if (init_template != null) - { - SanityManager.ASSERT( - TemplateRow.checkColumnTypes( - this.getConglomerate().format_ids, init_template)); - } + SanityManager.ASSERT( + TemplateRow.checkColumnTypes( + getRawTran().getDataValueFactory(), + this.getConglomerate().format_ids, + this.getConglomerate().collation_ids, + init_template)); } // System.out.println("initializing scan:" + this); Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate/TemplateRow.java URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate/TemplateRow.java?view=diff&rev=537349&r1=537348&r2=537349 ============================================================================== --- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate/TemplateRow.java (original) +++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/conglomerate/TemplateRow.java Fri May 11 23:54:17 2007 @@ -23,8 +23,8 @@ import org.apache.derby.iapi.reference.SQLState; -import org.apache.derby.iapi.services.monitor.Monitor; import org.apache.derby.iapi.services.sanity.SanityManager; +import org.apache.derby.iapi.services.io.ArrayUtil; import org.apache.derby.iapi.services.io.Storable; import org.apache.derby.iapi.error.StandardException; @@ -258,7 +258,9 @@ * @exception StandardException Standard exception policy. **/ static public boolean checkColumnTypes( + DataValueFactory dvf, int[] format_ids, + int[] collation_ids, DataValueDescriptor[] row) throws StandardException { @@ -295,7 +297,7 @@ } column_template = - Monitor.newInstanceFromIdentifier(format_ids[colid]); + dvf.getNull(format_ids[colid], collation_ids[colid]); // is this the right check? @@ -305,11 +307,14 @@ "check", "row = " + RowUtil.toString(row)); SanityManager.THROWASSERT( - "column["+colid+"] (" + column.getClass() + - ") expected to be instanceof column_tempate() (" + + "input column["+colid+"] (" + column.getClass() + + ") did not match expected template class (" + column_template.getClass() + ")" + - "column = " + column + - "row[colid] = " + row[colid]); + "\ncolumn value = " + column + + "\nformat_ids = " + + ArrayUtil.toString(format_ids) + + "\ncollation = " + + ArrayUtil.toString(collation_ids)); } } }