| 822 | } |
| 823 | |
| 824 | void DsqlBatch::DataCache::put3(const void* data, ULONG dataSize, ULONG offset) |
| 825 | { |
| 826 | fb_assert((DsqlBatch::RAM_BATCH % dataSize == 0) && (offset % dataSize == 0)); |
| 827 | |
| 828 | if (offset >= m_used) |
| 829 | { |
| 830 | // data in cache |
| 831 | UCHAR* to = m_cache.begin(); |
| 832 | to += (offset - m_used); |
| 833 | fb_assert(to < m_cache.end()); |
| 834 | memcpy(to, data, dataSize); |
| 835 | } |
| 836 | else |
| 837 | { |
| 838 | if (offset + dataSize > m_used) |
| 839 | { |
| 840 | // what a pity - data appears partilly divided between cache & tempspace |
| 841 | fb_assert(offset + dataSize <= getSize()); |
| 842 | flush(); |
| 843 | } |
| 844 | |
| 845 | const FB_UINT64 writtenBytes = m_space->write(offset, data, dataSize); |
| 846 | fb_assert(writtenBytes == dataSize); |
| 847 | } |
| 848 | } |
| 849 | |
| 850 | void DsqlBatch::DataCache::put(const void* d, ULONG dataSize) |
| 851 | { |
no test coverage detected