From 7c116c0629092e76d38fd84faecc9e079f90bd5f Mon Sep 17 00:00:00 2001 From: Ari Lazier Date: Mon, 4 Jan 2016 16:37:07 -0800 Subject: [PATCH] pr fixes --- results.cpp | 4 ++-- shared_realm.cpp | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/results.cpp b/results.cpp index e8d4bfd2..437cfff7 100644 --- a/results.cpp +++ b/results.cpp @@ -324,9 +324,9 @@ Results Results::filter(Query&& q) const } Results::UnsupportedColumnTypeException::UnsupportedColumnTypeException(size_t column, const Table* table) -: column_index(column) +: std::runtime_error((std::string)"Operation not supported on '" + table->get_column_name(column).data() + "' columns") +, column_index(column) , column_name(table->get_column_name(column)) , column_type(table->get_column_type(column)) -, std::runtime_error((std::string)"Operation not supported on '" + table->get_column_name(column).data() + "' columns") { } diff --git a/shared_realm.cpp b/shared_realm.cpp index 7c48bf55..fd85e8f9 100644 --- a/shared_realm.cpp +++ b/shared_realm.cpp @@ -212,6 +212,9 @@ bool Realm::update_schema(std::unique_ptr schema, uint64_t version) old_config.read_only = true; old_config.schema = std::move(old_schema); + m_config.schema = std::move(schema); + m_config.schema_version = version; + auto migration_function = [&](Group*, Schema&) { SharedRealm old_realm(new Realm(old_config)); auto updated_realm = shared_from_this(); @@ -224,9 +227,8 @@ bool Realm::update_schema(std::unique_ptr schema, uint64_t version) // update and migrate begin_transaction(); bool changed = ObjectStore::update_realm_with_schema(read_group(), *old_config.schema, - version, const_cast(*schema), migration_function); - m_config.schema = std::move(schema); - m_config.schema_version = version; + version, *m_config.schema, + migration_function); commit_transaction(); return changed; }