Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions src/duckdb/src/execution/index/art/prefix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,17 @@ uint8_t Prefix::GetByte(const ART &art, const Node &node, const uint8_t pos) {
return prefix.data[pos];
}

Prefix Prefix::NewInternal(ART &art, Node &node, const data_ptr_t data, const uint8_t count, const idx_t offset,
const NType type) {
node = Node::GetAllocator(art, type).New();
node.SetMetadata(static_cast<uint8_t>(type));
Prefix Prefix::NewInternal(ART &art, Node &node, const data_ptr_t data, const uint8_t count, const idx_t offset) {
node = Node::GetAllocator(art, PREFIX).New();
node.SetMetadata(static_cast<uint8_t>(PREFIX));

Prefix prefix(art, node, true);
prefix.data[Count(art)] = count;
if (data) {
D_ASSERT(count);
memcpy(prefix.data, data + offset, count);
}
prefix.ptr->Clear();
return prefix;
}

Expand All @@ -68,7 +68,7 @@ void Prefix::New(ART &art, reference<Node> &ref, const ARTKey &key, const idx_t
while (count) {
auto min = MinValue(UnsafeNumericCast<idx_t>(Count(art)), count);
auto this_count = UnsafeNumericCast<uint8_t>(min);
auto prefix = NewInternal(art, ref, key.data, this_count, offset + depth, PREFIX);
auto prefix = NewInternal(art, ref, key.data, this_count, offset + depth);

ref = *prefix.ptr;
offset += this_count;
Expand Down Expand Up @@ -114,7 +114,7 @@ void Prefix::Concat(ART &art, Node &parent, uint8_t byte, const GateStatus old_s
}

if (parent.GetType() != PREFIX) {
auto prefix = NewInternal(art, parent, &byte, 1, 0, PREFIX);
auto prefix = NewInternal(art, parent, &byte, 1, 0);
if (child.GetType() == PREFIX) {
prefix.Append(art, child);
} else {
Expand Down Expand Up @@ -216,7 +216,7 @@ GateStatus Prefix::Split(ART &art, reference<Node> &node, Node &child, const uin
// Create a new prefix and
// 1. copy the remaining bytes of this prefix.
// 2. append remaining prefix nodes.
auto new_prefix = NewInternal(art, child, nullptr, 0, 0, PREFIX);
auto new_prefix = NewInternal(art, child, nullptr, 0, 0);
new_prefix.data[Count(art)] = prefix.data[Count(art)] - pos - 1;
memcpy(new_prefix.data, prefix.data + pos + 1, new_prefix.data[Count(art)]);

Expand Down Expand Up @@ -321,7 +321,7 @@ Prefix Prefix::Append(ART &art, const uint8_t byte) {
return *this;
}

auto prefix = NewInternal(art, *ptr, nullptr, 0, 0, PREFIX);
auto prefix = NewInternal(art, *ptr, nullptr, 0, 0);
return prefix.Append(art, byte);
}

Expand Down Expand Up @@ -364,14 +364,14 @@ void Prefix::ConcatGate(ART &art, Node &parent, uint8_t byte, const Node &child)

} else if (child.GetType() == PREFIX) {
// At least one more row ID in this gate.
auto prefix = NewInternal(art, new_prefix, &byte, 1, 0, PREFIX);
auto prefix = NewInternal(art, new_prefix, &byte, 1, 0);
prefix.ptr->Clear();
prefix.Append(art, child);
new_prefix.SetGateStatus(GateStatus::GATE_SET);

} else {
// At least one more row ID in this gate.
auto prefix = NewInternal(art, new_prefix, &byte, 1, 0, PREFIX);
auto prefix = NewInternal(art, new_prefix, &byte, 1, 0);
*prefix.ptr = child;
new_prefix.SetGateStatus(GateStatus::GATE_SET);
}
Expand All @@ -386,7 +386,7 @@ void Prefix::ConcatGate(ART &art, Node &parent, uint8_t byte, const Node &child)
void Prefix::ConcatChildIsGate(ART &art, Node &parent, uint8_t byte, const Node &child) {
// Create a new prefix and point it to the gate.
if (parent.GetType() != PREFIX) {
auto prefix = NewInternal(art, parent, &byte, 1, 0, PREFIX);
auto prefix = NewInternal(art, parent, &byte, 1, 0);
*prefix.ptr = child;
return;
}
Expand Down
6 changes: 3 additions & 3 deletions src/duckdb/src/function/table/version/pragma_version.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef DUCKDB_PATCH_VERSION
#define DUCKDB_PATCH_VERSION "3-dev133"
#define DUCKDB_PATCH_VERSION "3-dev137"
#endif
#ifndef DUCKDB_MINOR_VERSION
#define DUCKDB_MINOR_VERSION 3
Expand All @@ -8,10 +8,10 @@
#define DUCKDB_MAJOR_VERSION 1
#endif
#ifndef DUCKDB_VERSION
#define DUCKDB_VERSION "v1.3.3-dev133"
#define DUCKDB_VERSION "v1.3.3-dev137"
#endif
#ifndef DUCKDB_SOURCE_ID
#define DUCKDB_SOURCE_ID "2efc9ec537"
#define DUCKDB_SOURCE_ID "3ac7e19ac4"
#endif
#include "duckdb/function/table/system_functions.hpp"
#include "duckdb/main/database.hpp"
Expand Down
3 changes: 1 addition & 2 deletions src/duckdb/src/include/duckdb/execution/index/art/prefix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ class Prefix {
static void TransformToDeprecated(ART &art, Node &node, unsafe_unique_ptr<FixedSizeAllocator> &allocator);

private:
static Prefix NewInternal(ART &art, Node &node, const data_ptr_t data, const uint8_t count, const idx_t offset,
const NType type);
static Prefix NewInternal(ART &art, Node &node, const data_ptr_t data, const uint8_t count, const idx_t offset);

static Prefix GetTail(ART &art, const Node &node);

Expand Down