<commit_before>#include <iostream>
#include <iomanip>

#include <memory>
#include <realm/column_mixed.hpp>

using namespace realm;
using namespace realm::util;


MixedColumn::~MixedColumn() noexcept
{
}


void MixedColumn::update_from_parent(size_t old_baseline) noexcept
{
    if (!get_root_array()->update_from_parent(old_baseline))
        return;

    m_types->update_from_parent(old_baseline);
    m_data->update_from_parent(old_baseline);
    if (m_binary_data)
        m_binary_data->update_from_parent(old_baseline);
}

void MixedColumn::create(Allocator& alloc, ref_type ref, Table* table, size_t column_ndx)
{
    std::unique_ptr<Array> top;
    std::unique_ptr<IntegerColumn> types;
    std::unique_ptr<RefsColumn> data;
    std::unique_ptr<BinaryColumn> binary_data;
    std::unique_ptr<TimestampColumn> timestamp_data;
    top.reset(new Array(alloc)); // Throws
    top->init_from_ref(ref);
    REALM_ASSERT(top->size() == 2 || top->size() == 3);
    ref_type types_ref = top->get_as_ref(0);
    ref_type data_ref  = top->get_as_ref(1);
    types.reset(new IntegerColumn(alloc, types_ref)); // Throws
    types->set_parent(&*top, 0);
    data.reset(new RefsColumn(alloc, data_ref, table, column_ndx)); // Throws
    data->set_parent(&*top, 1);
    REALM_ASSERT_3(types->size(), ==, data->size());

    // Binary data column with values that does not fit in data column is only
    // there if needed
    if (top->size() >= 3) {
        ref_type binary_data_ref = top->get_as_ref(2);<commit_msg>MixedColumn should also update_from_parent the embedded TimestampColumn.<commit_after>#include <iostream>
#include <iomanip>

#include <memory>
#include <realm/column_mixed.hpp>

using namespace realm;
using namespace realm::util;


MixedColumn::~MixedColumn() noexcept
{
}


void MixedColumn::update_from_parent(size_t old_baseline) noexcept
{
    if (!get_root_array()->update_from_parent(old_baseline))
        return;

    m_types->update_from_parent(old_baseline);
    m_data->update_from_parent(old_baseline);
    if (m_binary_data)
        m_binary_data->update_from_parent(old_baseline);
    if (m_timestamp)
        m_timestamp->update_from_parent(old_baseline);
}

void MixedColumn::create(Allocator& alloc, ref_type ref, Table* table, size_t column_ndx)
{
    std::unique_ptr<Array> top;
    std::unique_ptr<IntegerColumn> types;
    std::unique_ptr<RefsColumn> data;
    std::unique_ptr<BinaryColumn> binary_data;
    std::unique_ptr<TimestampColumn> timestamp_data;
    top.reset(new Array(alloc)); // Throws
    top->init_from_ref(ref);
    REALM_ASSERT(top->size() == 2 || top->size() == 3);
    ref_type types_ref = top->get_as_ref(0);
    ref_type data_ref  = top->get_as_ref(1);
    types.reset(new IntegerColumn(alloc, types_ref)); // Throws
    types->set_parent(&*top, 0);
    data.reset(new RefsColumn(alloc, data_ref, table, column_ndx)); // Throws
    data->set_parent(&*top, 1);
    REALM_ASSERT_3(types->size(), ==, data->size());

    // Binary data column with values that does not fit in data column is only
    // there if needed
    if (top->size() >= 3) {
        ref_type binary_data_ref = top->get_as_ref(2);
{'fraction_non_alphanumeric': 0.13464591933947284, 'fraction_numerical': 0.0057161003493172435, 'mean_word_length': 4.585106382978723, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 54, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5079481', 'n_tokens_mistral': 1108, 'n_tokens_neox': 1070, 'n_words': 208}