You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
feat(bytestream,serdes): Distribute BS buf size data type change to avoid implicit data type narrowing
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);
|
||||
|
||||
|
@ -572,6 +572,9 @@ void InetStreamSocket::write(SBS msg, Stats* stats)
|
||||
|
||||
void InetStreamSocket::do_write(const ByteStream& msg, uint32_t whichMagic, Stats* stats) const
|
||||
{
|
||||
// !!!
|
||||
// !!! Reducing BS size type from 64bit down to 32 and potentially loosing data.
|
||||
// !!!
|
||||
uint32_t msglen = msg.length();
|
||||
uint32_t magic = whichMagic;
|
||||
uint32_t* realBuf;
|
||||
|
Reference in New Issue
Block a user