aboutsummaryrefslogtreecommitdiff
path: root/contrib/native/client/src/include
diff options
context:
space:
mode:
authorParth Chandra <pchandra@maprtech.com>2014-08-21 22:22:15 -0700
committerParth Chandra <pchandra@maprtech.com>2014-10-15 22:47:54 -0700
commite302d98150d85a69ae08aba4cbf025c3bf032344 (patch)
tree0ebb2b33a27a85f953ab0c4c74935ddefcb9aed9 /contrib/native/client/src/include
parent17a4d921417ff914cb81588926b692d1aea09e56 (diff)
DRILL-1303 - Fix Drill Client assertion on getting bad metadata
Diffstat (limited to 'contrib/native/client/src/include')
-rw-r--r--contrib/native/client/src/include/drill/recordBatch.hpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/contrib/native/client/src/include/drill/recordBatch.hpp b/contrib/native/client/src/include/drill/recordBatch.hpp
index 1c89cea2a..de652029f 100644
--- a/contrib/native/client/src/include/drill/recordBatch.hpp
+++ b/contrib/native/client/src/include/drill/recordBatch.hpp
@@ -72,6 +72,7 @@ class SlicedByteBuf{
public:
//TODO: check the size and offset parameters. What is the largest they can be?
SlicedByteBuf(const ByteBuf_t b, size_t offset, size_t length){
+ assert(length>0);
this->m_buffer=b;
this->m_start=offset;
this->m_end=offset+length-1;
@@ -80,9 +81,10 @@ class SlicedByteBuf{
// Carve a sliced buffer out of another sliced buffer
SlicedByteBuf(const SlicedByteBuf& sb, size_t offset, size_t length){
+ assert(length>0);
this->m_buffer=sb.m_buffer;
this->m_start=sb.m_start+offset;
- this->m_end=sb.m_start+offset+length;
+ this->m_end=sb.m_start+offset+length-1;
this->m_length=length;
}
@@ -652,7 +654,7 @@ class DECLSPEC_DRILL_CLIENT ValueVectorVarWidth:public ValueVectorBase{
ValueVectorVarWidth(SlicedByteBuf *b, size_t rowCount):ValueVectorBase(b, rowCount){
size_t offsetEnd = (rowCount+1)*sizeof(uint32_t);
this->m_pOffsetArray= new SlicedByteBuf(*b, 0, offsetEnd);
- this->m_pData= new SlicedByteBuf(*b, offsetEnd, b->getLength());
+ this->m_pData= new SlicedByteBuf(*b, offsetEnd, b->getLength()-offsetEnd);
}
~ValueVectorVarWidth(){
delete this->m_pOffsetArray;