Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
grammaright committed May 24, 2024
1 parent 36e0449 commit e2cdd2c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/copy_array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,18 @@ namespace duckdb
auto &data = bind_data.Cast<WriteArrayData>();

// getbuffer
auto dcoords = make_uniq_array<uint64_t>(2);
dcoords[0] = data.tile_coords[0];
dcoords[1] = data.tile_coords[1];
// dcoords = make_uniq_array<uint64_t>(2);
dcoords = new uint64_t[2];
dcoords[0] = (uint64_t)data.tile_coords[0];
dcoords[1] = (uint64_t)data.tile_coords[1];

auto arrname = data.array_name.c_str();
// why allocate newly?
arrname_char = new char[1024];
strcpy(arrname_char, arrname);

// TODO: Consider sparse tile in the future
key = {arrname_char, "a", dcoords.get(), data.dim_len, BF_EMPTYTILE_DENSE};
key = {arrname_char, (char *)"i", dcoords, data.dim_len, BF_EMPTYTILE_DENSE};

PFpage *page;
BF_GetBuf(key, &page);
Expand Down Expand Up @@ -132,6 +133,7 @@ namespace duckdb
private:
array_key key;
char *arrname_char;
uint64_t *dcoords;

// vector<uint64_t> current_coords_in_tile;
// bool finished;
Expand Down
2 changes: 1 addition & 1 deletion src/read_array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ namespace duckdb
strcpy(arrname_char, arrname);

// TODO: Consider sparse tile in the future
array_key key = {arrname_char, (char *)"a", dcoords.get(), 2, BF_EMPTYTILE_DENSE};
array_key key = {arrname_char, (char *)"i", dcoords.get(), 2, BF_EMPTYTILE_DENSE};

PFpage *page;
if (BF_GetBuf(key, &page) != BFE_OK)
Expand Down

0 comments on commit e2cdd2c

Please sign in to comment.