Skip to content

Commit

Permalink
Fixed error in #3920
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-milovidov committed Jan 8, 2019
1 parent a594293 commit 3874dc5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dbms/src/Columns/ColumnArray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,10 @@ void ColumnArray::insertFrom(const IColumn & src_, size_t n)

void ColumnArray::insertDefault()
{
getOffsets().push_back(getOffsets().back());
/// NOTE 1: We can use back() even if the array is empty (due to zero -1th element in PODArray).
/// NOTE 2: We cannot use reference in push_back, because reference get invalidated if array is reallocated.
auto last_offset = getOffsets().back();
getOffsets().push_back(last_offset);
}


Expand Down

0 comments on commit 3874dc5

Please sign in to comment.