You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-16 04:01:52 +03:00
Fix/mcol 5787 rgdata buffer max size dev (#3325)
* fix(rowgroup): RGData now uses uint64_t counter for the fixed sizes columns data buf. The buffer can utilize > 4GB RAM that is necessary for PM side join. RGData ctor uses uint32_t allocating data buffer. This fact causes implicit heap overflow. * feat(bytestream,serdes): BS buffer size type is uint64_t This necessary to handle 64bit RGData, that comes as a separate patch. The pair of patches would allow to have PM joins when SmallSide size > 4GB. * feat(bytestream,serdes): Distribute BS buf size data type change to avoid implicit data type narrowing * feat(rowgroup): this returns bits lost during cherry-pick. The bits lost caused the first RGData::serialize to crash a process
This commit is contained in:
@ -20,6 +20,7 @@
|
||||
*
|
||||
*
|
||||
***********************************************************************/
|
||||
#include "bytestream.h"
|
||||
#include "mcsconfig.h"
|
||||
|
||||
#include <stdexcept>
|
||||
@ -117,7 +118,7 @@ const SBS CompressedInetStreamSocket::read(const struct timespec* timeout, bool*
|
||||
|
||||
void CompressedInetStreamSocket::write(const ByteStream& msg, Stats* stats)
|
||||
{
|
||||
size_t len = msg.length();
|
||||
BSSizeType len = msg.length();
|
||||
|
||||
if (useCompression && (len > 512))
|
||||
{
|
||||
@ -126,6 +127,9 @@ void CompressedInetStreamSocket::write(const ByteStream& msg, Stats* stats)
|
||||
|
||||
alg->compress((char*)msg.buf(), len, (char*)smsg.getInputPtr() + HEADER_SIZE, &outLen);
|
||||
// Save original len.
|
||||
// !!!
|
||||
// !!! Reducing BS size type from 64bit down to 32 and potentially loosing data.
|
||||
// !!!
|
||||
*(uint32_t*)smsg.getInputPtr() = len;
|
||||
smsg.advanceInputPtr(outLen + HEADER_SIZE);
|
||||
|
||||
|
Reference in New Issue
Block a user