Skip to content

Commit 31762d6

Browse files
duckdblabs-botgithub-actions[bot]
authored andcommitted
Update vendored DuckDB sources to b081b761ec
1 parent 830df35 commit 31762d6

File tree

9 files changed

+70
-16
lines changed

9 files changed

+70
-16
lines changed

src/duckdb/extension/parquet/reader/variant/variant_shredded_conversion.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,7 @@ vector<VariantValue> VariantShreddedConversion::ConvertShreddedObject(Vector &me
407407
value.ToUnifiedFormat(total_size, value_format);
408408
auto value_data = value_format.GetData<string_t>(value_format);
409409
auto &validity = value_format.validity;
410+
(void)validity;
410411

411412
//! 'metadata'
412413
UnifiedVectorFormat metadata_format;

src/duckdb/src/common/types/column/column_data_allocator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ ColumnDataAllocator::ColumnDataAllocator(ColumnDataAllocator &other) {
3737
switch (type) {
3838
case ColumnDataAllocatorType::BUFFER_MANAGER_ALLOCATOR:
3939
case ColumnDataAllocatorType::HYBRID:
40-
alloc.allocator = other.alloc.allocator;
40+
alloc.buffer_manager = other.alloc.buffer_manager;
4141
break;
4242
case ColumnDataAllocatorType::IN_MEMORY_ALLOCATOR:
43-
alloc.buffer_manager = other.alloc.buffer_manager;
43+
alloc.allocator = other.alloc.allocator;
4444
break;
4545
default:
4646
throw InternalException("Unrecognized column data allocator type");

src/duckdb/src/common/types/row/tuple_data_allocator.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,14 @@ TupleDataChunkPart TupleDataAllocator::BuildChunkPart(TupleDataPinState &pin_sta
241241
if (total_heap_size == 0) {
242242
result.SetHeapEmpty();
243243
} else {
244-
const auto heap_remaining = MaxValue<idx_t>(
245-
heap_blocks.empty() ? block_size : heap_blocks.back().RemainingCapacity(), heap_sizes[append_offset]);
244+
idx_t heap_remaining;
245+
if (!heap_blocks.empty() && heap_blocks.back().RemainingCapacity() >= heap_sizes[append_offset]) {
246+
// We have enough room for the current entry
247+
heap_remaining = heap_blocks.back().RemainingCapacity();
248+
} else {
249+
// We need to allocate a new block
250+
heap_remaining = MaxValue<idx_t>(block_size, heap_sizes[append_offset]);
251+
}
246252

247253
if (total_heap_size <= heap_remaining) {
248254
// Everything fits

src/duckdb/src/function/scalar/variant/variant_extract.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ static void VariantExtractFunction(DataChunk &input, ExpressionState &state, Vec
101101

102102
auto &path = input.data[1];
103103
D_ASSERT(path.GetVectorType() == VectorType::CONSTANT_VECTOR);
104+
(void)path;
104105

105106
auto &func_expr = state.expr.Cast<BoundFunctionExpression>();
106107
auto &info = func_expr.bind_info->Cast<BindData>();

src/duckdb/src/function/scalar/variant/variant_utils.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,12 +352,14 @@ bool VariantUtils::Verify(Vector &variant, const SelectionVector &sel_p, idx_t c
352352
if (key_id.validity.RowIsValid(key_id_index)) {
353353
auto children_key_id = key_id_data[key_id_index];
354354
D_ASSERT(children_key_id < keys_list_entry.length);
355+
(void)children_key_id;
355356
}
356357

357358
auto value_id_index = value_id.sel->get_index(j + children_list_entry.offset);
358359
D_ASSERT(value_id.validity.RowIsValid(value_id_index));
359360
auto children_value_id = value_id_data[value_id_index];
360361
D_ASSERT(children_value_id < values_list_entry.length);
362+
(void)children_value_id;
361363
}
362364

363365
//! verify values
@@ -397,6 +399,7 @@ bool VariantUtils::Verify(Vector &variant, const SelectionVector &sel_p, idx_t c
397399
} else {
398400
D_ASSERT(!key_id.validity.RowIsValid(child_key_id_index));
399401
}
402+
(void)child_key_id_index;
400403
}
401404
break;
402405
}

src/duckdb/src/function/table/version/pragma_version.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#ifndef DUCKDB_PATCH_VERSION
2-
#define DUCKDB_PATCH_VERSION "0-dev4146"
2+
#define DUCKDB_PATCH_VERSION "0-dev4159"
33
#endif
44
#ifndef DUCKDB_MINOR_VERSION
55
#define DUCKDB_MINOR_VERSION 4
@@ -8,10 +8,10 @@
88
#define DUCKDB_MAJOR_VERSION 1
99
#endif
1010
#ifndef DUCKDB_VERSION
11-
#define DUCKDB_VERSION "v1.4.0-dev4146"
11+
#define DUCKDB_VERSION "v1.4.0-dev4159"
1212
#endif
1313
#ifndef DUCKDB_SOURCE_ID
14-
#define DUCKDB_SOURCE_ID "19dd651b26"
14+
#define DUCKDB_SOURCE_ID "b081b761ec"
1515
#endif
1616
#include "duckdb/function/table/system_functions.hpp"
1717
#include "duckdb/main/database.hpp"

src/duckdb/src/include/duckdb/parser/parsed_data/alter_database_info.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ enum class AlterDatabaseType : uint8_t { RENAME_DATABASE = 0 };
1616

1717
struct AlterDatabaseInfo : public AlterInfo {
1818
public:
19+
explicit AlterDatabaseInfo(AlterDatabaseType alter_database_type);
1920
AlterDatabaseInfo(AlterDatabaseType alter_database_type, string catalog_p, OnEntryNotFound if_not_found);
2021
~AlterDatabaseInfo() override;
2122

@@ -25,12 +26,15 @@ struct AlterDatabaseInfo : public AlterInfo {
2526
CatalogType GetCatalogType() const override;
2627
string ToString() const override = 0;
2728

29+
static unique_ptr<AlterInfo> Deserialize(Deserializer &deserializer);
30+
2831
protected:
2932
void Serialize(Serializer &serializer) const override;
3033
};
3134

3235
struct RenameDatabaseInfo : public AlterDatabaseInfo {
3336
public:
37+
RenameDatabaseInfo();
3438
RenameDatabaseInfo(string catalog_p, string new_name_p, OnEntryNotFound if_not_found);
3539

3640
string new_name;
@@ -39,6 +43,8 @@ struct RenameDatabaseInfo : public AlterDatabaseInfo {
3943
unique_ptr<AlterInfo> Copy() const override;
4044
string ToString() const override;
4145

46+
static unique_ptr<AlterDatabaseInfo> Deserialize(Deserializer &deserializer);
47+
4248
protected:
4349
void Serialize(Serializer &serializer) const override;
4450
};

src/duckdb/src/parser/parsed_data/alter_database_info.cpp

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33

44
namespace duckdb {
55

6+
AlterDatabaseInfo::AlterDatabaseInfo(AlterDatabaseType alter_database_type)
7+
: AlterInfo(AlterType::ALTER_DATABASE, string(), "", "", OnEntryNotFound::THROW_EXCEPTION),
8+
alter_database_type(alter_database_type) {
9+
}
10+
611
AlterDatabaseInfo::AlterDatabaseInfo(AlterDatabaseType alter_database_type, string catalog_p,
712
OnEntryNotFound if_not_found)
813
: AlterInfo(AlterType::ALTER_DATABASE, std::move(catalog_p), "", "", if_not_found),
@@ -16,9 +21,7 @@ CatalogType AlterDatabaseInfo::GetCatalogType() const {
1621
return CatalogType::DATABASE_ENTRY;
1722
}
1823

19-
void AlterDatabaseInfo::Serialize(Serializer &serializer) const {
20-
AlterInfo::Serialize(serializer);
21-
serializer.WriteProperty(100, "alter_database_type", alter_database_type);
24+
RenameDatabaseInfo::RenameDatabaseInfo() : AlterDatabaseInfo(AlterDatabaseType::RENAME_DATABASE) {
2225
}
2326

2427
RenameDatabaseInfo::RenameDatabaseInfo(string catalog_p, string new_name_p, OnEntryNotFound if_not_found)
@@ -31,12 +34,13 @@ unique_ptr<AlterInfo> RenameDatabaseInfo::Copy() const {
3134
}
3235

3336
string RenameDatabaseInfo::ToString() const {
34-
return "ALTER DATABASE " + catalog + " RENAME TO " + new_name;
35-
}
36-
37-
void RenameDatabaseInfo::Serialize(Serializer &serializer) const {
38-
AlterDatabaseInfo::Serialize(serializer);
39-
serializer.WriteProperty(200, "new_name", new_name);
37+
string result;
38+
result = "ALTER DATABASE ";
39+
if (if_not_found == OnEntryNotFound::RETURN_NULL) {
40+
result += "IF EXISTS ";
41+
}
42+
result += StringUtil::Format("%s RENAME TO %s", SQLIdentifier(catalog), SQLIdentifier(new_name));
43+
return result;
4044
}
4145

4246
} // namespace duckdb

src/duckdb/src/storage/serialization/serialize_parse_info.cpp

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "duckdb/parser/parsed_data/alter_info.hpp"
1010
#include "duckdb/parser/parsed_data/alter_table_info.hpp"
1111
#include "duckdb/parser/parsed_data/comment_on_column_info.hpp"
12+
#include "duckdb/parser/parsed_data/alter_database_info.hpp"
1213
#include "duckdb/parser/parsed_data/attach_info.hpp"
1314
#include "duckdb/parser/parsed_data/copy_database_info.hpp"
1415
#include "duckdb/parser/parsed_data/copy_info.hpp"
@@ -92,6 +93,9 @@ unique_ptr<ParseInfo> AlterInfo::Deserialize(Deserializer &deserializer) {
9293
auto allow_internal = deserializer.ReadPropertyWithDefault<bool>(205, "allow_internal");
9394
unique_ptr<AlterInfo> result;
9495
switch (type) {
96+
case AlterType::ALTER_DATABASE:
97+
result = AlterDatabaseInfo::Deserialize(deserializer);
98+
break;
9599
case AlterType::ALTER_TABLE:
96100
result = AlterTableInfo::Deserialize(deserializer);
97101
break;
@@ -196,6 +200,24 @@ unique_ptr<AlterInfo> AlterViewInfo::Deserialize(Deserializer &deserializer) {
196200
return std::move(result);
197201
}
198202

203+
void AlterDatabaseInfo::Serialize(Serializer &serializer) const {
204+
AlterInfo::Serialize(serializer);
205+
serializer.WriteProperty<AlterDatabaseType>(300, "alter_database_type", alter_database_type);
206+
}
207+
208+
unique_ptr<AlterInfo> AlterDatabaseInfo::Deserialize(Deserializer &deserializer) {
209+
auto alter_database_type = deserializer.ReadProperty<AlterDatabaseType>(300, "alter_database_type");
210+
unique_ptr<AlterDatabaseInfo> result;
211+
switch (alter_database_type) {
212+
case AlterDatabaseType::RENAME_DATABASE:
213+
result = RenameDatabaseInfo::Deserialize(deserializer);
214+
break;
215+
default:
216+
throw SerializationException("Unsupported type for deserialization of AlterDatabaseInfo!");
217+
}
218+
return std::move(result);
219+
}
220+
199221
void AddColumnInfo::Serialize(Serializer &serializer) const {
200222
AlterTableInfo::Serialize(serializer);
201223
serializer.WriteProperty<ColumnDefinition>(400, "new_column", new_column);
@@ -482,6 +504,17 @@ unique_ptr<AlterTableInfo> RenameColumnInfo::Deserialize(Deserializer &deseriali
482504
return std::move(result);
483505
}
484506

507+
void RenameDatabaseInfo::Serialize(Serializer &serializer) const {
508+
AlterDatabaseInfo::Serialize(serializer);
509+
serializer.WritePropertyWithDefault<string>(400, "new_name", new_name);
510+
}
511+
512+
unique_ptr<AlterDatabaseInfo> RenameDatabaseInfo::Deserialize(Deserializer &deserializer) {
513+
auto result = duckdb::unique_ptr<RenameDatabaseInfo>(new RenameDatabaseInfo());
514+
deserializer.ReadPropertyWithDefault<string>(400, "new_name", result->new_name);
515+
return std::move(result);
516+
}
517+
485518
void RenameFieldInfo::Serialize(Serializer &serializer) const {
486519
AlterTableInfo::Serialize(serializer);
487520
serializer.WritePropertyWithDefault<vector<string>>(400, "column_path", column_path);

0 commit comments

Comments
 (0)