1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +03:00

MCOL-267 Add basic engine support

This patch adds enough support so that cross engines joins with blob
columns in the foreign engines will work. The modifications are as
follows:

* Add CrossEngine support for non-NULL-terminated (binary) data
* Add row data support for blobs (similar to varbinary)
* Add engine support for writing out blob data correctly to the storage
engine API
* Re-enable blob support in the engine plugin
This commit is contained in:
Andrew Hutchings
2017-01-30 17:04:45 +00:00
parent 15e3963e62
commit 27e5995cd3
7 changed files with 56 additions and 21 deletions

View File

@ -365,7 +365,8 @@ string Row::toString() const
else
switch (types[i]) {
case CalpontSystemCatalog::CHAR:
case CalpontSystemCatalog::VARCHAR: {
case CalpontSystemCatalog::VARCHAR:
{
const string &tmp = getStringField(i);
os << "(" << getStringLength(i) << ") '" << tmp << "' ";
break;
@ -381,7 +382,9 @@ string Row::toString() const
case CalpontSystemCatalog::LONGDOUBLE:
os << getLongDoubleField(i) << " ";
break;
case CalpontSystemCatalog::VARBINARY: {
case CalpontSystemCatalog::VARBINARY:
case CalpontSystemCatalog::BLOB:
{
uint32_t len = getVarBinaryLength(i);
const uint8_t* val = getVarBinaryField(i);
os << "0x" << hex;
@ -429,7 +432,9 @@ string Row::toCSV() const
case CalpontSystemCatalog::LONGDOUBLE:
os << getLongDoubleField(i);
break;
case CalpontSystemCatalog::VARBINARY: {
case CalpontSystemCatalog::VARBINARY:
case CalpontSystemCatalog::BLOB:
{
uint32_t len = getVarBinaryLength(i);
const uint8_t* val = getVarBinaryField(i);
os << "0x" << hex;
@ -532,6 +537,11 @@ void Row::initToNull()
memset(&data[offsets[i]], 0xFF, getColumnWidth(i));
break;
}
case CalpontSystemCatalog::BLOB: {
// TODO: no NULL value for long double yet, this is a nan.
memset(&data[offsets[i]], 0xFF, getColumnWidth(i));
break;
}
default:
ostringstream os;
os << "Row::initToNull(): got bad column type (" << types[i] <<
@ -603,6 +613,7 @@ bool Row::isNullValue(uint32_t colIndex) const
}
break;
}
case CalpontSystemCatalog::BLOB:
case CalpontSystemCatalog::VARBINARY: {
uint32_t pos = offsets[colIndex];
if (inStringTable(colIndex)) {
@ -1100,7 +1111,7 @@ void applyMapping(const int *mapping, const Row &in, Row *out)
//out->setStringField(in.getStringField(i), mapping[i]);
else if (UNLIKELY(in.isShortString(i)))
out->setUintField(in.getUintField(i), mapping[i]);
else if (UNLIKELY(in.getColTypes()[i] == execplan::CalpontSystemCatalog::VARBINARY))
else if (UNLIKELY(in.getColTypes()[i] == execplan::CalpontSystemCatalog::VARBINARY || in.getColTypes()[i] == execplan::CalpontSystemCatalog::BLOB))
out->setVarBinaryField(in.getVarBinaryField(i), in.getVarBinaryLength(i), mapping[i]);
else if (UNLIKELY(in.getColTypes()[i] == execplan::CalpontSystemCatalog::LONGDOUBLE))
out->setLongDoubleField(in.getLongDoubleField(i), mapping[i]);