1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

Fixed a bug in IDBPolicy that prevented using the system

w/o plugins.

A couple other random things.
This commit is contained in:
Patrick LeBlanc
2019-02-06 09:49:32 -06:00
parent c9a9bf9823
commit 92f609f718
3 changed files with 8 additions and 3 deletions

View File

@ -90,7 +90,8 @@ int SocketPool::send_recv(messageqcpp::ByteStream &in, messageqcpp::ByteStream *
const uint8_t *inbuf = in.buf();
int err = 0;
/* TODO: make these writes not send SIGPIPE */
/* TODO: make these writes not send SIGPIPE
TODO: turn at least the header bits into a single write */
err = ::write(sock, &storagemanager::SM_MSG_START, sizeof(storagemanager::SM_MSG_START));
sm_check_error;
err = ::write(sock, &length, sizeof(length));
@ -142,6 +143,8 @@ int SocketPool::send_recv(messageqcpp::ByteStream &in, messageqcpp::ByteStream *
}
}
assert(i == 0); // in testing there shouldn't be any garbage in the stream
if (length == 0) // didn't find the header yet
{
// i == endOfData - 7 here
@ -156,6 +159,9 @@ int SocketPool::send_recv(messageqcpp::ByteStream &in, messageqcpp::ByteStream *
out->needAtLeast(length);
outbuf = out->getInputPtr();
memcpy(outbuf, &window[startOfPayload], endOfData - startOfPayload);
if (length < endOfData - startOfPayload)
cout << "SocketPool: warning! Probably got a bad length field! payload length = " << length <<
" endOfData = " << endOfData << " startOfPayload = " << startOfPayload << endl;
remainingBytes = length - (endOfData - startOfPayload); // remainingBytes is now the # of bytes left to read
out->advanceInputPtr(endOfData - startOfPayload);
break; // done looking for the header, can fill the output buffer directly now.