Skip to content

Commit 14c77a3

Browse files
committed
vendor: Update vendored sources to duckdb/duckdb@332674c
Use an insertion order preserving map in Value::MAP (duckdb/duckdb#17389)
1 parent 03bc582 commit 14c77a3

File tree

8 files changed

+19
-10
lines changed

8 files changed

+19
-10
lines changed

src/duckdb/src/common/types/value.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,7 @@ Value Value::MAP(const LogicalType &key_type, const LogicalType &value_type, vec
805805
return result;
806806
}
807807

808-
Value Value::MAP(const unordered_map<string, string> &kv_pairs) {
808+
Value Value::MAP(const InsertionOrderPreservingMap<string> &kv_pairs) {
809809
Value result;
810810
result.type_ = LogicalType::MAP(LogicalType::VARCHAR, LogicalType::VARCHAR);
811811
result.is_null = false;

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-dev3238"
2+
#define DUCKDB_PATCH_VERSION "0-dev3243"
33
#endif
44
#ifndef DUCKDB_MINOR_VERSION
55
#define DUCKDB_MINOR_VERSION 3
@@ -8,10 +8,10 @@
88
#define DUCKDB_MAJOR_VERSION 1
99
#endif
1010
#ifndef DUCKDB_VERSION
11-
#define DUCKDB_VERSION "v1.3.0-dev3238"
11+
#define DUCKDB_VERSION "v1.3.0-dev3243"
1212
#endif
1313
#ifndef DUCKDB_SOURCE_ID
14-
#define DUCKDB_SOURCE_ID "bf5b8aa11c"
14+
#define DUCKDB_SOURCE_ID "332674c349"
1515
#endif
1616
#include "duckdb/function/table/system_functions.hpp"
1717
#include "duckdb/main/database.hpp"

src/duckdb/src/include/duckdb/catalog/catalog_entry.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class CatalogEntry {
5757
//! (optional) comment on this entry
5858
Value comment;
5959
//! (optional) extra data associated with this entry
60-
unordered_map<string, string> tags;
60+
InsertionOrderPreservingMap<string> tags;
6161

6262
private:
6363
//! Child entry

src/duckdb/src/include/duckdb/common/insertion_order_preserving_map.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,14 @@ class InsertionOrderPreservingMap {
147147
}
148148
return map[map_idx[key]].second;
149149
}
150+
151+
bool operator==(const InsertionOrderPreservingMap &other) const {
152+
return map == other.map && map_idx == other.map_idx;
153+
}
154+
155+
bool operator!=(const InsertionOrderPreservingMap &other) const {
156+
return !(*this == other);
157+
}
150158
};
151159

152160
} // namespace duckdb

src/duckdb/src/include/duckdb/common/types/value.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "duckdb/common/types/datetime.hpp"
1919
#include "duckdb/common/types/interval.hpp"
2020
#include "duckdb/common/shared_ptr.hpp"
21+
#include "duckdb/common/insertion_order_preserving_map.hpp"
2122

2223
namespace duckdb {
2324

@@ -176,7 +177,7 @@ class Value {
176177
DUCKDB_API static Value MAP(const LogicalType &key_type, const LogicalType &value_type, vector<Value> keys,
177178
vector<Value> values);
178179
//! Create a map value from a set of key-value pairs
179-
DUCKDB_API static Value MAP(const unordered_map<string, string> &kv_pairs);
180+
DUCKDB_API static Value MAP(const InsertionOrderPreservingMap<string> &kv_pairs);
180181

181182
//! Create a union value from a selected value and a tag from a set of alternatives.
182183
DUCKDB_API static Value UNION(child_list_t<LogicalType> members, uint8_t tag, Value value);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ struct CreateInfo : public ParseInfo {
4949
//! User provided comment
5050
Value comment;
5151
//! Key-value tags with additional metadata
52-
unordered_map<string, string> tags;
52+
InsertionOrderPreservingMap<string> tags;
5353

5454
public:
5555
void Serialize(Serializer &serializer) const override;

src/duckdb/src/main/capi/profiling_info-c.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ duckdb_value duckdb_profiling_info_get_metrics(duckdb_profiling_info info) {
4646
auto &node = *reinterpret_cast<duckdb::ProfilingNode *>(info);
4747
auto &profiling_info = node.GetProfilingInfo();
4848

49-
duckdb::unordered_map<duckdb::string, duckdb::string> metrics_map;
49+
duckdb::InsertionOrderPreservingMap<duckdb::string> metrics_map;
5050
for (const auto &metric : profiling_info.metrics) {
5151
auto key = EnumUtil::ToString(metric.first);
5252
if (!profiling_info.Enabled(profiling_info.settings, metric.first)) {

src/duckdb/src/storage/serialization/serialize_create_info.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ void CreateInfo::Serialize(Serializer &serializer) const {
2525
serializer.WriteProperty<OnCreateConflict>(105, "on_conflict", on_conflict);
2626
serializer.WritePropertyWithDefault<string>(106, "sql", sql);
2727
serializer.WritePropertyWithDefault<Value>(107, "comment", comment, Value());
28-
serializer.WritePropertyWithDefault<unordered_map<string, string>>(108, "tags", tags, unordered_map<string, string>());
28+
serializer.WritePropertyWithDefault<InsertionOrderPreservingMap<string>>(108, "tags", tags, InsertionOrderPreservingMap<string>());
2929
if (serializer.ShouldSerialize(2)) {
3030
serializer.WritePropertyWithDefault<LogicalDependencyList>(109, "dependencies", dependencies, LogicalDependencyList());
3131
}
@@ -40,7 +40,7 @@ unique_ptr<CreateInfo> CreateInfo::Deserialize(Deserializer &deserializer) {
4040
auto on_conflict = deserializer.ReadProperty<OnCreateConflict>(105, "on_conflict");
4141
auto sql = deserializer.ReadPropertyWithDefault<string>(106, "sql");
4242
auto comment = deserializer.ReadPropertyWithExplicitDefault<Value>(107, "comment", Value());
43-
auto tags = deserializer.ReadPropertyWithExplicitDefault<unordered_map<string, string>>(108, "tags", unordered_map<string, string>());
43+
auto tags = deserializer.ReadPropertyWithExplicitDefault<InsertionOrderPreservingMap<string>>(108, "tags", InsertionOrderPreservingMap<string>());
4444
auto dependencies = deserializer.ReadPropertyWithExplicitDefault<LogicalDependencyList>(109, "dependencies", LogicalDependencyList());
4545
deserializer.Set<CatalogType>(type);
4646
unique_ptr<CreateInfo> result;

0 commit comments

Comments
 (0)