Skip to content

Commit a7e04bb

Browse files
committed
Merge branch 'next-major' into feature/string-compression
2 parents 1afc39e + 18e5d20 commit a7e04bb

20 files changed

+62
-295
lines changed

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,27 @@
2121

2222
----------------------------------------------
2323

24+
# 14.10.4 Release notes
25+
26+
### Enhancements
27+
* None.
28+
29+
### Fixed
30+
* When a public name is defined on a property, calling `realm::Results::sort()` or `realm::Results::distinct()` with the internal name could throw an error like `Cannot sort on key path 'NAME': property 'PersonObject.NAME' does not exist`. ([realm/realm-js#6779](https://github.com/realm/realm-js/issues/6779), since v12.12.0)
31+
32+
### Breaking changes
33+
* None.
34+
35+
### Compatibility
36+
* Fileformat: Generates files with format v24. Reads and automatically upgrade from fileformat v10. If you want to upgrade from an earlier file format version you will have to use RealmCore v13.x.y or earlier.
37+
38+
-----------
39+
40+
### Internals
41+
* Fix a thread sanitizer failure in the "unregister connection change listener during callback" test ([PR #7871](https://github.com/realm/realm-core/pull/7871)).
42+
43+
----------------------------------------------
44+
2445
# 14.10.3 Release notes
2546

2647
### Enhancements

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import PackageDescription
44
import Foundation
55

6-
let versionStr = "14.10.3"
6+
let versionStr = "14.10.4"
77
let versionPieces = versionStr.split(separator: "-")
88
let versionCompontents = versionPieces[0].split(separator: ".")
99
let versionExtra = versionPieces.count > 1 ? versionPieces[1] : ""

dependencies.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PACKAGE_NAME: realm-core
2-
VERSION: 14.10.3
2+
VERSION: 14.10.4
33
OPENSSL_VERSION: 3.2.0
44
ZLIB_VERSION: 1.2.13
55
# https://github.com/10gen/baas/commits
6-
# 9d1b4d6 is 2024 May 8
7-
BAAS_VERSION: 9d1b4d628babadfb606ebcadb93b1e5cae3c9565
6+
# 2f308db is 2024 July 10
7+
BAAS_VERSION: 2f308db6f65333728a101d1fecbb792f9659a5ce

src/realm/array.cpp

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,40 +1068,6 @@ bool QueryStateFindAll<IntegerColumn>::match(size_t index) noexcept
10681068
return (m_limit > m_match_count);
10691069
}
10701070

1071-
void Array::typed_print(std::string prefix) const
1072-
{
1073-
std::cout << "Generic Array " << header_to_string(get_header()) << " @ " << m_ref;
1074-
if (!is_attached()) {
1075-
std::cout << " Unattached";
1076-
return;
1077-
}
1078-
if (size() == 0) {
1079-
std::cout << " Empty" << std::endl;
1080-
return;
1081-
}
1082-
std::cout << " size = " << size() << " {";
1083-
if (has_refs()) {
1084-
std::cout << std::endl;
1085-
for (unsigned n = 0; n < size(); ++n) {
1086-
auto pref = prefix + " " + to_string(n) + ":\t";
1087-
RefOrTagged rot = get_as_ref_or_tagged(n);
1088-
if (rot.is_ref() && rot.get_as_ref()) {
1089-
Array a(m_alloc);
1090-
a.init_from_ref(rot.get_as_ref());
1091-
std::cout << pref;
1092-
a.typed_print(pref);
1093-
}
1094-
else if (rot.is_tagged()) {
1095-
std::cout << pref << rot.get_as_int() << std::endl;
1096-
}
1097-
}
1098-
std::cout << prefix << "}" << std::endl;
1099-
}
1100-
else {
1101-
std::cout << " Leaf of unknown type }" << std::endl;
1102-
}
1103-
}
1104-
11051071
ref_type ArrayPayload::typed_write(ref_type ref, _impl::ArrayWriterBase& out, Allocator& alloc)
11061072
{
11071073
Array arr(alloc);

src/realm/array.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,8 +507,6 @@ class Array : public Node, public ArrayParent {
507507
/// log2. Possible results {0, 1, 2, 4, 8, 16, 32, 64}
508508
static uint8_t bit_width(int64_t value);
509509

510-
void typed_print(std::string prefix) const;
511-
512510
protected:
513511
friend class NodeTree;
514512
void copy_on_write();

src/realm/bplustree.cpp

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -867,37 +867,6 @@ ref_type BPlusTreeBase::typed_write(ref_type ref, _impl::ArrayWriterBase& out, A
867867
return written_node.write(out);
868868
}
869869

870-
void BPlusTreeBase::typed_print(std::string prefix, Allocator& alloc, ref_type root, ColumnType col_type)
871-
{
872-
char* header = alloc.translate(root);
873-
Array a(alloc);
874-
a.init_from_ref(root);
875-
if (NodeHeader::get_is_inner_bptree_node_from_header(header)) {
876-
std::cout << "{" << std::endl;
877-
REALM_ASSERT(a.has_refs());
878-
for (unsigned j = 0; j < a.size(); ++j) {
879-
auto pref = prefix + " " + std::to_string(j) + ":\t";
880-
RefOrTagged rot = a.get_as_ref_or_tagged(j);
881-
if (rot.is_ref() && rot.get_as_ref()) {
882-
if (j == 0) {
883-
std::cout << pref << "BPTree offsets as ArrayUnsigned as ";
884-
Array a(alloc);
885-
a.init_from_ref(rot.get_as_ref());
886-
a.typed_print(prefix);
887-
}
888-
else {
889-
std::cout << pref << "Subtree beeing ";
890-
BPlusTreeBase::typed_print(pref, alloc, rot.get_as_ref(), col_type);
891-
}
892-
}
893-
}
894-
}
895-
else {
896-
std::cout << "BPTree Leaf[" << col_type << "] as ";
897-
a.typed_print(prefix);
898-
}
899-
}
900-
901870
size_t BPlusTreeBase::size_from_header(const char* header)
902871
{
903872
auto node_size = Array::get_size_from_header(header);

src/realm/bplustree.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,6 @@ class BPlusTreeBase {
230230
}
231231

232232
static ref_type typed_write(ref_type, _impl::ArrayWriterBase&, Allocator&, TypedWriteFunc);
233-
static void typed_print(std::string prefix, Allocator& alloc, ref_type root, ColumnType col_type);
234-
235233

236234
protected:
237235
template <class U>

src/realm/cluster.cpp

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1700,76 +1700,4 @@ ref_type Cluster::typed_write(ref_type ref, _impl::ArrayWriterBase& out) const
17001700
}
17011701
return written_cluster.write(out);
17021702
}
1703-
1704-
void Cluster::typed_print(std::string prefix) const
1705-
{
1706-
REALM_ASSERT_DEBUG(!get_is_inner_bptree_node_from_header(get_header()));
1707-
std::cout << "Cluster of size " << size() << " " << header_to_string(get_header()) << std::endl;
1708-
const auto table = get_owning_table();
1709-
for (unsigned j = 0; j < size(); ++j) {
1710-
RefOrTagged rot = get_as_ref_or_tagged(j);
1711-
auto pref = prefix + " " + std::to_string(j) + ":\t";
1712-
if (rot.is_ref() && rot.get_as_ref()) {
1713-
if (j == 0) {
1714-
std::cout << pref << "Keys as ArrayUnsigned as ";
1715-
Array a(m_alloc);
1716-
a.init_from_ref(rot.get_as_ref());
1717-
a.typed_print(pref);
1718-
}
1719-
else {
1720-
auto col_key = table->m_leaf_ndx2colkey[j - 1];
1721-
auto col_type = col_key.get_type();
1722-
auto col_attr = col_key.get_attrs();
1723-
std::string attr_string;
1724-
if (col_attr.test(col_attr_Dictionary))
1725-
attr_string = "Dict:";
1726-
if (col_attr.test(col_attr_List))
1727-
attr_string = "List:";
1728-
if (col_attr.test(col_attr_Set))
1729-
attr_string = "Set:";
1730-
if (col_attr.test(col_attr_Nullable))
1731-
attr_string += "Null:";
1732-
std::cout << pref << "Column[" << attr_string << col_type << "] as ";
1733-
// special cases for the types we want to compress
1734-
if (col_attr.test(col_attr_List) || col_attr.test(col_attr_Set)) {
1735-
// That is a single bplustree
1736-
// propagation of nullable missing here?
1737-
// handling of mixed missing here?
1738-
BPlusTreeBase::typed_print(pref, m_alloc, rot.get_as_ref(), col_type);
1739-
}
1740-
else if (col_attr.test(col_attr_Dictionary)) {
1741-
Array dict_top(m_alloc);
1742-
dict_top.init_from_ref(rot.get_as_ref());
1743-
if (dict_top.size() == 0) {
1744-
std::cout << "{ empty }" << std::endl;
1745-
continue;
1746-
}
1747-
std::cout << "{" << std::endl;
1748-
auto ref0 = dict_top.get_as_ref(0);
1749-
if (ref0) {
1750-
auto p = pref + " 0:\t";
1751-
std::cout << p;
1752-
BPlusTreeBase::typed_print(p, m_alloc, ref0, col_type);
1753-
}
1754-
if (dict_top.size() == 1) {
1755-
continue; // is this really possible? or should all dicts have both trees?
1756-
}
1757-
auto ref1 = dict_top.get_as_ref(1);
1758-
if (ref1) {
1759-
auto p = pref + " 1:\t";
1760-
std::cout << p;
1761-
BPlusTreeBase::typed_print(p, m_alloc, dict_top.get_as_ref(1), col_type);
1762-
}
1763-
}
1764-
else {
1765-
// handle all other cases as generic arrays
1766-
Array a(m_alloc);
1767-
a.init_from_ref(rot.get_as_ref());
1768-
a.typed_print(pref);
1769-
}
1770-
}
1771-
}
1772-
}
1773-
}
1774-
17751703
} // namespace realm

src/realm/cluster.hpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -214,13 +214,6 @@ class ClusterNode : public Array {
214214
}
215215
virtual ref_type typed_write(ref_type ref, _impl::ArrayWriterBase& out) const = 0;
216216

217-
virtual void typed_print(std::string prefix) const
218-
{
219-
static_cast<void>(get_owning_table());
220-
std::cout << "ClusterNode as ";
221-
Array::typed_print(prefix);
222-
}
223-
224217
protected:
225218
#if REALM_MAX_BPNODE_SIZE > 256
226219
static constexpr int node_shift_factor = 8;
@@ -328,7 +321,6 @@ class Cluster : public ClusterNode {
328321
void verify() const;
329322
void dump_objects(int64_t key_offset, std::string lead) const override;
330323
virtual ref_type typed_write(ref_type ref, _impl::ArrayWriterBase& out) const override;
331-
virtual void typed_print(std::string prefix) const override;
332324
static void remove_backlinks(const Table* origin_table, ObjKey origin_key, ColKey col,
333325
const std::vector<ObjKey>& keys, CascadeState& state);
334326
static void remove_backlinks(const Table* origin_table, ObjKey origin_key, ColKey col,

src/realm/cluster_tree.cpp

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -165,43 +165,6 @@ class ClusterNodeInner : public ClusterNode {
165165
return written_node.write(out);
166166
}
167167

168-
virtual void typed_print(std::string prefix) const override
169-
{
170-
REALM_ASSERT(get_is_inner_bptree_node_from_header(get_header()));
171-
REALM_ASSERT(has_refs());
172-
std::cout << "ClusterNodeInner " << header_to_string(get_header()) << std::endl;
173-
for (unsigned j = 0; j < size(); ++j) {
174-
RefOrTagged rot = get_as_ref_or_tagged(j);
175-
auto pref = prefix + " " + std::to_string(j) + ":\t";
176-
if (rot.is_ref() && rot.get_as_ref()) {
177-
if (j == 0) {
178-
std::cout << pref << "Keys as ArrayUnsigned as ";
179-
Array a(m_alloc);
180-
a.init_from_ref(rot.get_as_ref());
181-
a.typed_print(pref);
182-
}
183-
else {
184-
auto header = m_alloc.translate(rot.get_as_ref());
185-
MemRef m(header, rot.get_as_ref(), m_alloc);
186-
if (get_is_inner_bptree_node_from_header(header)) {
187-
ClusterNodeInner a(m_alloc, m_tree_top);
188-
a.init(m);
189-
std::cout << pref;
190-
a.typed_print(pref);
191-
}
192-
else {
193-
Cluster a(j, m_alloc, m_tree_top);
194-
a.init(m);
195-
std::cout << pref;
196-
a.typed_print(pref);
197-
}
198-
}
199-
}
200-
// just ignore entries, which are not refs.
201-
}
202-
Array::typed_print(prefix);
203-
}
204-
205168
private:
206169
static constexpr size_t s_key_ref_index = 0;
207170
static constexpr size_t s_sub_tree_depth_index = 1;

src/realm/cluster_tree.hpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -195,17 +195,6 @@ class ClusterTree {
195195
return m_root->typed_write(ref, out);
196196
}
197197

198-
void typed_print(std::string prefix) const
199-
{
200-
if (m_root) {
201-
std::cout << prefix << "ClusterTree as ";
202-
m_root->typed_print(prefix);
203-
}
204-
else {
205-
std::cout << "Emtpy ClusterTree" << std::endl;
206-
}
207-
}
208-
209198
protected:
210199
friend class Obj;
211200
friend class Cluster;

src/realm/group.cpp

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -960,48 +960,6 @@ ref_type Group::typed_write_tables(_impl::ArrayWriterBase& out) const
960960
}
961961
return dest.write(out);
962962
}
963-
void Group::table_typed_print(std::string prefix, ref_type ref) const
964-
{
965-
REALM_ASSERT(m_top.get_as_ref(1) == ref);
966-
Array a(m_alloc);
967-
a.init_from_ref(ref);
968-
REALM_ASSERT(a.has_refs());
969-
for (unsigned j = 0; j < a.size(); ++j) {
970-
auto pref = prefix + " " + to_string(j) + ":\t";
971-
RefOrTagged rot = a.get_as_ref_or_tagged(j);
972-
if (rot.is_tagged() || rot.get_as_ref() == 0)
973-
continue;
974-
auto table_accessor = do_get_table(j);
975-
REALM_ASSERT(table_accessor);
976-
table_accessor->typed_print(pref, rot.get_as_ref());
977-
}
978-
}
979-
void Group::typed_print(std::string prefix) const
980-
{
981-
std::cout << "Group top array" << std::endl;
982-
for (unsigned j = 0; j < m_top.size(); ++j) {
983-
auto pref = prefix + " " + to_string(j) + ":\t";
984-
RefOrTagged rot = m_top.get_as_ref_or_tagged(j);
985-
if (rot.is_ref() && rot.get_as_ref()) {
986-
if (j == 1) {
987-
// Tables
988-
std::cout << pref << "All Tables" << std::endl;
989-
table_typed_print(pref, rot.get_as_ref());
990-
}
991-
else {
992-
Array a(m_alloc);
993-
a.init_from_ref(rot.get_as_ref());
994-
std::cout << pref;
995-
a.typed_print(pref);
996-
}
997-
}
998-
else {
999-
std::cout << pref << rot.get_as_int() << std::endl;
1000-
}
1001-
}
1002-
std::cout << "}" << std::endl;
1003-
}
1004-
1005963

1006964
ref_type Group::DefaultTableWriter::write_names(_impl::OutputStream& out)
1007965
{

src/realm/group.hpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -516,8 +516,6 @@ class Group : public ArrayParent {
516516
}
517517
#endif
518518
ref_type typed_write_tables(_impl::ArrayWriterBase& out) const;
519-
void table_typed_print(std::string prefix, ref_type ref) const;
520-
void typed_print(std::string prefix) const;
521519

522520
protected:
523521
static constexpr size_t s_table_name_ndx = 0;
@@ -1129,10 +1127,6 @@ class Group::TableWriter {
11291127
virtual ref_type write_names(_impl::OutputStream&) = 0;
11301128
virtual ref_type write_tables(_impl::OutputStream&) = 0;
11311129
virtual HistoryInfo write_history(_impl::OutputStream&) = 0;
1132-
void typed_print(std::string prefix)
1133-
{
1134-
m_group->typed_print(prefix);
1135-
}
11361130

11371131
virtual ~TableWriter() noexcept {}
11381132

src/realm/node.hpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -263,11 +263,6 @@ class Node : public NodeHeader {
263263
}
264264
}
265265

266-
void typed_print(int) const
267-
{
268-
std::cout << "Generic Node ERROR\n";
269-
}
270-
271266
protected:
272267
/// The total size in bytes (including the header) of a new empty
273268
/// array. Must be a multiple of 8 (i.e., 64-bit aligned).

src/realm/object-store/results.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,9 @@ static std::vector<ExtendedColumnKey> parse_keypath(StringData keypath, Schema c
871871
begin = sep + (sep != end);
872872

873873
auto prop = object_schema->property_for_public_name(key);
874+
if (!prop) {
875+
prop = object_schema->property_for_name(key);
876+
}
874877
check(prop, "property '%1.%2' does not exist", object_schema->name, key);
875878
if (is_dictionary(prop->type)) {
876879
check(index.length(), "missing dictionary key");

0 commit comments

Comments
 (0)