Skip to content

Commit

Permalink
[case](regresscases) add regress cases for nested type nested type wi…
Browse files Browse the repository at this point in the history
…th csv format (apache#25355)

this pr
1.  fix use podarray push_back() with back() will make heap_use_after_free when podarray is reach capacity which would may make heap free 
2. add cases for csv format for nested types. and csv file has two define which are without quote or just like json text
  • Loading branch information
amorynan authored Oct 16, 2023
1 parent 934d828 commit c482c22
Show file tree
Hide file tree
Showing 4 changed files with 391 additions and 2 deletions.
3 changes: 2 additions & 1 deletion be/src/vec/data_types/serde/data_type_array_serde.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ Status DataTypeArraySerDe::deserialize_one_cell_from_json(IColumn& column, Slice
}
// empty array []
if (slice.size == 2) {
offsets.push_back(offsets.back());
auto last_off = offsets.back();
offsets.push_back(last_off);
return Status::OK();
}
slice.remove_prefix(1);
Expand Down
3 changes: 2 additions & 1 deletion be/src/vec/data_types/serde/data_type_map_serde.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ Status DataTypeMapSerDe::deserialize_one_cell_from_json(IColumn& column, Slice&
}
// empty map
if (slice.size == 2) {
offsets.push_back(offsets.back());
auto last_off = offsets.back();
offsets.push_back(last_off);
return Status::OK();
}

Expand Down
Loading

0 comments on commit c482c22

Please sign in to comment.