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

MCOL-1083 Fix NULL row init for TEXT/BLOB

We should have been initalizing TEXT/BLOB 8 byte tokens for NULL,
instead we were initializing the entire length of the TEXT/BLOB which
can do a lot of damage.
This commit is contained in:
Andrew Hutchings
2017-12-06 17:08:08 +00:00
parent 4d8026618c
commit addd719524

View File

@ -626,6 +626,7 @@ void Row::initToNull()
*((uint64_t *) &data[offsets[i]]) = joblist::DATETIMENULL; break;
case CalpontSystemCatalog::CHAR:
case CalpontSystemCatalog::VARCHAR:
case CalpontSystemCatalog::TEXT:
case CalpontSystemCatalog::STRINT: {
if (inStringTable(i)) {
setStringField(joblist::CPNULLSTRMARK, i);
@ -652,6 +653,7 @@ void Row::initToNull()
break;
}
case CalpontSystemCatalog::VARBINARY:
case CalpontSystemCatalog::BLOB:
*((uint16_t *) &data[offsets[i]]) = 0; break;
case CalpontSystemCatalog::DECIMAL:
case CalpontSystemCatalog::UDECIMAL:
@ -679,11 +681,6 @@ void Row::initToNull()
memset(&data[offsets[i]], 0xFF, getColumnWidth(i));
break;
}
case CalpontSystemCatalog::BLOB:
case CalpontSystemCatalog::TEXT: {
memset(&data[offsets[i]], 0xFF, getColumnWidth(i));
break;
}
default:
ostringstream os;
os << "Row::initToNull(): got bad column type (" << types[i] <<