You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-07 03:22:57 +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:
@@ -626,6 +626,7 @@ void Row::initToNull()
|
|||||||
*((uint64_t *) &data[offsets[i]]) = joblist::DATETIMENULL; break;
|
*((uint64_t *) &data[offsets[i]]) = joblist::DATETIMENULL; break;
|
||||||
case CalpontSystemCatalog::CHAR:
|
case CalpontSystemCatalog::CHAR:
|
||||||
case CalpontSystemCatalog::VARCHAR:
|
case CalpontSystemCatalog::VARCHAR:
|
||||||
|
case CalpontSystemCatalog::TEXT:
|
||||||
case CalpontSystemCatalog::STRINT: {
|
case CalpontSystemCatalog::STRINT: {
|
||||||
if (inStringTable(i)) {
|
if (inStringTable(i)) {
|
||||||
setStringField(joblist::CPNULLSTRMARK, i);
|
setStringField(joblist::CPNULLSTRMARK, i);
|
||||||
@@ -652,6 +653,7 @@ void Row::initToNull()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case CalpontSystemCatalog::VARBINARY:
|
case CalpontSystemCatalog::VARBINARY:
|
||||||
|
case CalpontSystemCatalog::BLOB:
|
||||||
*((uint16_t *) &data[offsets[i]]) = 0; break;
|
*((uint16_t *) &data[offsets[i]]) = 0; break;
|
||||||
case CalpontSystemCatalog::DECIMAL:
|
case CalpontSystemCatalog::DECIMAL:
|
||||||
case CalpontSystemCatalog::UDECIMAL:
|
case CalpontSystemCatalog::UDECIMAL:
|
||||||
@@ -679,11 +681,6 @@ void Row::initToNull()
|
|||||||
memset(&data[offsets[i]], 0xFF, getColumnWidth(i));
|
memset(&data[offsets[i]], 0xFF, getColumnWidth(i));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case CalpontSystemCatalog::BLOB:
|
|
||||||
case CalpontSystemCatalog::TEXT: {
|
|
||||||
memset(&data[offsets[i]], 0xFF, getColumnWidth(i));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
ostringstream os;
|
ostringstream os;
|
||||||
os << "Row::initToNull(): got bad column type (" << types[i] <<
|
os << "Row::initToNull(): got bad column type (" << types[i] <<
|
||||||
|
Reference in New Issue
Block a user