Skip to content

Commit

Permalink
Merge pull request #3046 from kuzudb/fix-3042
Browse files Browse the repository at this point in the history
Fix issue 3042
  • Loading branch information
ray6080 committed Mar 14, 2024
2 parents 4f06cf1 + 77489a5 commit d348228
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/storage/store/var_list_column_chunk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ void VarListDataColumnChunk::resizeBuffer(uint64_t numValues) {
}
capacity = capacity == 0 ? 1 : capacity;
while (capacity < numValues) {
capacity *= CHUNK_RESIZE_RATIO;
capacity = std::ceil(capacity * CHUNK_RESIZE_RATIO);
}
dataColumnChunk->resize(capacity);
}
Expand Down Expand Up @@ -65,7 +65,7 @@ void VarListColumnChunk::append(ValueVector* vector, SelectionVector& selVector)
auto numToAppend = selVector.selectedSize;
auto newCapacity = capacity;
while (numValues + numToAppend >= newCapacity) {
newCapacity *= 1.5;
newCapacity = std::ceil(newCapacity * 1.5);
}
if (capacity < newCapacity) {
resize(newCapacity);
Expand Down
9 changes: 9 additions & 0 deletions test/test_files/issue/issue.test
Original file line number Diff line number Diff line change
Expand Up @@ -397,3 +397,12 @@ v3|v2
{_ID: 1:1, _LABEL: R, id: r12}|v12
|v11
|v111

-CASE 3042
-STATEMENT CREATE NODE TABLE MyTask (id STRING, inputs MAP(STRING, STRING)[], PRIMARY KEY(id));
---- ok
-STATEMENT CREATE (:MyTask {id: 'myid', inputs: [MAP(['input1'], ['value1'])]});
---- ok
-STATEMENT MATCH (n:MyTask) RETURN n.*;
---- 1
myid|[{input1=value1}]

0 comments on commit d348228

Please sign in to comment.