Skip to content

Commit

Permalink
Fix writing null to a large list.
Browse files Browse the repository at this point in the history
  • Loading branch information
Giorgi committed Jun 18, 2024
1 parent 53734da commit 1790dcc
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DuckDB.NET.Data/Internal/Writer/ListVectorDataWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,6 @@ private void ResizeVector(int rowIndex, ulong count)
throw new DuckDBException($"Failed to reserve {vectorReservedSize} for the list vector");
}

listItemWriter.FetchDataPointer();
listItemWriter.InitializerWriter();
}
}
3 changes: 2 additions & 1 deletion DuckDB.NET.Data/Internal/Writer/VectorDataWriterBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,9 @@ internal unsafe bool AppendValueInternal<T>(T value, int rowIndex) where T : unm
return true;
}

internal void FetchDataPointer()
internal void InitializerWriter()
{
validity = default;
vectorData = NativeMethods.Vectors.DuckDBVectorGetData(Vector);
}
}
2 changes: 1 addition & 1 deletion DuckDB.NET.Test/DuckDBManagedAppenderListTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public void ListValuesNullableDouble()

private void ListValuesInternal<T>(string typeName, Func<Faker, T> generator, int? length = null)
{
var rows = 10;
var rows = 2000;
var table = $"managedAppenderLists";

var columnLength = length.HasValue ? length.Value.ToString() : "";
Expand Down

0 comments on commit 1790dcc

Please sign in to comment.