You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-29 08:21:15 +03:00
MCOL-4758 Limit LONGTEXT and LONGBLOB to 16MB (#1995)
MCOL-4758 Limit LONGTEXT and LONGBLOB to 16MB Also add the original test case from MCOL-3879.
This commit is contained in:
@ -87,11 +87,8 @@ void fix_column_length(SchemaObject* elem, const CHARSET_INFO* def_cs) {
|
||||
column->fType->fLength = 255;
|
||||
else if (column->fType->fLength <= 65535)
|
||||
column->fType->fLength = 65535;
|
||||
else if (column->fType->fLength <= 16777215)
|
||||
else
|
||||
column->fType->fLength = 16777215;
|
||||
else if (column->fType->fLength <= 2100000000)
|
||||
column->fType->fLength = 2100000000;
|
||||
// otherwise leave the decision to a caller code
|
||||
}
|
||||
}
|
||||
|
||||
@ -1000,7 +997,7 @@ blob_type:
|
||||
| LONGBLOB
|
||||
{
|
||||
$$ = new ColumnType(DDL_BLOB);
|
||||
$$->fLength = 2100000000;
|
||||
$$->fLength = 16777215;
|
||||
}
|
||||
;
|
||||
|
||||
@ -1029,7 +1026,7 @@ text_type:
|
||||
| LONGTEXT
|
||||
{
|
||||
$$ = new ColumnType(DDL_TEXT);
|
||||
$$->fLength = 2100000000;
|
||||
$$->fLength = 16777215;
|
||||
}
|
||||
;
|
||||
|
||||
|
@ -3157,15 +3157,12 @@ CalpontSystemCatalog::ColType colType_MysqlToIDB (const Item* item)
|
||||
case STRING_RESULT:
|
||||
ct.colDataType = CalpontSystemCatalog::VARCHAR;
|
||||
|
||||
// MCOL-697 the longest TEXT we deal with is 2100000000 so
|
||||
// limit to that. Otherwise for LONGBLOB ct.colWidth ends
|
||||
// up being -1 and demons eat your data and first born
|
||||
// (or you just get truncated to 20 bytes with the 'if'
|
||||
// below)
|
||||
if (item->max_length < 2100000000)
|
||||
// MCOL-4758 the longest TEXT we deal with is 16777215 so
|
||||
// limit to that.
|
||||
if (item->max_length < 16777215)
|
||||
ct.colWidth = item->max_length;
|
||||
else
|
||||
ct.colWidth = 2100000000;
|
||||
ct.colWidth = 16777215;
|
||||
|
||||
// force token
|
||||
if (item->type() == Item::FUNC_ITEM)
|
||||
|
Reference in New Issue
Block a user