Skip to content

Commit

Permalink
[Fix](load) Restrict the import of VARCHAR(0) data to avoid coredump (#…
Browse files Browse the repository at this point in the history
…40940)

The VARCHAR(0) created has an actual length of 0, and BE didn't restrict
it, leading to a BE core dump.
#[38427](#38427) changed VARCHAR(0)
to have a length of 65533. This PR restricts data import when the length
is 0 to avoid a core dump.
  • Loading branch information
liaoxin01 authored Sep 19, 2024
1 parent 158f0b2 commit adf7fb1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion be/src/vec/sink/vtablet_block_convertor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ Status OlapTableBlockConvertor::_internal_validate_column(
auto string_column_checker = [&](const ColumnString* column_string) {
size_t limit = config::string_type_length_soft_limit_bytes;
// when type.len is negative, std::min will return overflow value, so we need to check it
if (type.len > 0) {
if (type.len >= 0) {
limit = std::min(config::string_type_length_soft_limit_bytes, type.len);
}

Expand Down

0 comments on commit adf7fb1

Please sign in to comment.