@@ -46,23 +46,27 @@ ColInfo get_col_info(const Table* table)
4646}
4747
4848void add_list_to_repl (CollectionBase& list, Replication& repl, util::UniqueFunction<void (Mixed)> update_embedded);
49+
4950void add_dictionary_to_repl (Dictionary& dict, Replication& repl, util::UniqueFunction<void (Mixed)> update_embedded)
5051{
5152 size_t sz = dict.size ();
5253 for (size_t n = 0 ; n < sz; ++n) {
5354 const auto & [key, val] = dict.get_pair (n);
54- repl.dictionary_insert (dict, n, key, val);
5555 if (val.is_type (type_List)) {
56+ repl.dictionary_insert (dict, n, key, Mixed{0 , CollectionType::List});
5657 auto n_list = dict.get_list ({key.get_string ()});
57- add_list_to_repl (*n_list, *dict. get_table ()-> get_repl () , nullptr );
58+ add_list_to_repl (*n_list, repl , nullptr );
5859 }
5960 else if (val.is_type (type_Dictionary)) {
60- repl.dictionary_insert (dict, n, key, val );
61+ repl.dictionary_insert (dict, n, key, Mixed{ 0 , CollectionType::Dictionary} );
6162 auto n_dict = dict.get_dictionary ({key.get_string ()});
62- add_dictionary_to_repl (*n_dict, *dict. get_table ()-> get_repl () , nullptr );
63+ add_dictionary_to_repl (*n_dict, repl , nullptr );
6364 }
64- else if (update_embedded) {
65- update_embedded (val);
65+ else {
66+ repl.dictionary_insert (dict, n, key, val);
67+ if (update_embedded) {
68+ update_embedded (val);
69+ }
6670 }
6771 }
6872}
@@ -72,17 +76,21 @@ void add_list_to_repl(CollectionBase& list, Replication& repl, util::UniqueFunct
7276 auto sz = list.size ();
7377 for (size_t n = 0 ; n < sz; n++) {
7478 auto val = list.get_any (n);
75- repl.list_insert (list, n, val, n);
7679 if (val.is_type (type_List)) {
80+ repl.list_insert (list, n, Mixed{0 , CollectionType::List}, n);
7781 auto n_list = list.get_list ({n});
78- add_list_to_repl (*n_list, *list. get_table ()-> get_repl () , nullptr );
82+ add_list_to_repl (*n_list, repl , nullptr );
7983 }
8084 else if (val.is_type (type_Dictionary)) {
85+ repl.list_insert (list, n, Mixed{0 , CollectionType::Dictionary}, n);
8186 auto n_dict = list.get_dictionary ({n});
82- add_dictionary_to_repl (*n_dict, *list. get_table ()-> get_repl () , nullptr );
87+ add_dictionary_to_repl (*n_dict, repl , nullptr );
8388 }
84- else if (update_embedded) {
85- update_embedded (val);
89+ else {
90+ repl.list_insert (list, n, val, n);
91+ if (update_embedded) {
92+ update_embedded (val);
93+ }
8694 }
8795 }
8896}
0 commit comments