Merge branch 'ecarm002/json_constraints' of https://code.google.com/p/hyracks into ecarm002/json_constraints
diff --git a/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/edu/uci/ics/hyracks/storage/am/lsm/invertedindex/ondisk/OnDiskInvertedIndex.java b/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/edu/uci/ics/hyracks/storage/am/lsm/invertedindex/ondisk/OnDiskInvertedIndex.java
index d72e019..6aa3253 100644
--- a/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/edu/uci/ics/hyracks/storage/am/lsm/invertedindex/ondisk/OnDiskInvertedIndex.java
+++ b/hyracks/hyracks-storage-am-lsm-invertedindex/src/main/java/edu/uci/ics/hyracks/storage/am/lsm/invertedindex/ondisk/OnDiskInvertedIndex.java
@@ -337,6 +337,7 @@
             btreeTupleBuilder.reset();
             DataOutput output = btreeTupleBuilder.getDataOutput();
             // Add key fields.
+            lastTuple.reset(lastTupleBuilder.getFieldEndOffsets(), lastTupleBuilder.getByteArray());
             for (int i = 0; i < numTokenFields; i++) {
                 btreeTupleBuilder.addField(lastTuple.getFieldData(i), lastTuple.getFieldStart(i),
                         lastTuple.getFieldLength(i));
@@ -462,7 +463,7 @@
     public BTree getBTree() {
         return btree;
     }
-    
+
     public FileReference getInvListsFile() {
         return invListsFile;
     }
@@ -565,11 +566,11 @@
         public ByteBuffer allocateFrame() {
             return ByteBuffer.allocate(FRAME_SIZE);
         }
-        
+
         @Override
         public void deallocateFrames(int frameCount) {
             // TODO Auto-generated method stub
-            
+
         }
     }