@@ -2315,13 +2315,15 @@ class Op_collection_modify
2315
2315
void add_operation (typename Impl::Operation op,
2316
2316
const string &field) override
2317
2317
{
2318
+ set_prepare_state (PS_EXECUTE);
2318
2319
m_update.emplace_back (op, field);
2319
2320
}
2320
2321
2321
2322
void add_operation (typename Impl::Operation op,
2322
2323
const string &field,
2323
2324
const Value &val) override
2324
2325
{
2326
+ set_prepare_state (PS_EXECUTE);
2325
2327
m_update.emplace_back (op, field, val);
2326
2328
}
2327
2329
@@ -2334,12 +2336,15 @@ class Op_collection_modify
2334
2336
const string &field,
2335
2337
cdk::Expression &expr)
2336
2338
{
2339
+ set_prepare_state (PS_EXECUTE);
2337
2340
m_update.emplace_back (op, field, expr);
2338
2341
}
2339
2342
2340
2343
2341
2344
void clear_modifications () override
2342
2345
{
2346
+ if (m_update.size () != 0 )
2347
+ set_prepare_state (PS_EXECUTE);
2343
2348
m_update.clear ();
2344
2349
}
2345
2350
@@ -2742,7 +2747,12 @@ class Op_table_update
2742
2747
2743
2748
void add_set (const string &field, const Value &val) override
2744
2749
{
2745
- m_set_values.emplace (field, val);
2750
+ auto el = m_set_values.emplace (field, val);
2751
+ // substitute if exists
2752
+ if (!el.second )
2753
+ {
2754
+ el.first ->second = val;
2755
+ }
2746
2756
Base::set_prepare_state (PS_EXECUTE);
2747
2757
}
2748
2758
0 commit comments