MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / get

Method get

src/dsql/DsqlBatch.cpp:927–957  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

925}
926
927ULONG DsqlBatch::DataCache::get(UCHAR** buffer)
928{
929 if (m_used > m_got)
930 {
931 // get data from tempspace
932 ULONG dlen = m_cache.getCount();
933 ULONG delta = m_cacheCapacity - dlen;
934 if (delta > m_used - m_got)
935 delta = m_used - m_got;
936 UCHAR* buf = m_cache.getBuffer(dlen + delta);
937 buf += dlen;
938 const FB_UINT64 readBytes = m_space->read(m_got, buf, delta);
939 fb_assert(readBytes == delta);
940 m_got += delta;
941 }
942
943 if (m_cache.getCount())
944 {
945 if (m_shift)
946 m_cache.removeCount(0, m_shift);
947
948 // return buffer full of data
949 *buffer = m_cache.begin();
950 fb_assert(intptr_t(*buffer) % FB_ALIGNMENT == 0);
951 return m_cache.getCount();
952 }
953
954 // no more data
955 *buffer = nullptr;
956 return 0;
957}
958
959ULONG DsqlBatch::DataCache::reget(ULONG remains, UCHAR** buffer, ULONG alignment)
960{

Callers 15

setCursorMethod · 0.45
mapInOutMethod · 0.45
getSubFunctionMethod · 0.45
getSubProcedureMethod · 0.45
dsqlPassMethod · 0.45
executeMethod · 0.45
parseMethod · 0.45
genBlrMethod · 0.45
executeMethod · 0.45
executeMethod · 0.45
getImplicitJoinFieldMethod · 0.45
getStatementMethod · 0.45

Calls 5

getCountMethod · 0.45
getBufferMethod · 0.45
readMethod · 0.45
removeCountMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected