| 184 | } |
| 185 | |
| 186 | void UpdatesFx::check_update_conditions( |
| 187 | std::vector<QueryCondition> qcs, |
| 188 | std::vector<std::vector<sm::UpdateValue>> uvs, |
| 189 | uint64_t timestamp, |
| 190 | bool encrypt) { |
| 191 | // Open array. |
| 192 | std::unique_ptr<Array> array; |
| 193 | if (encrypt) { |
| 194 | array = std::make_unique<Array>( |
| 195 | ctx_, |
| 196 | SPARSE_ARRAY_NAME, |
| 197 | TILEDB_READ, |
| 198 | TemporalPolicy(TimeTravel, timestamp), |
| 199 | EncryptionAlgorithm(AESGCM, key_.c_str())); |
| 200 | } else { |
| 201 | array = std::make_unique<Array>( |
| 202 | ctx_, |
| 203 | SPARSE_ARRAY_NAME, |
| 204 | TILEDB_READ, |
| 205 | TemporalPolicy(TimeTravel, timestamp)); |
| 206 | } |
| 207 | auto array_ptr = array->ptr(); |
| 208 | |
| 209 | // Load delete conditions. |
| 210 | auto&& [conditions, update_values] = load_delete_and_update_conditions( |
| 211 | ctx_.ptr().get()->resources(), *array_ptr->opened_array().get()); |
| 212 | REQUIRE(conditions.size() == qcs.size()); |
| 213 | |
| 214 | for (uint64_t i = 0; i < qcs.size(); i++) { |
| 215 | // Compare to negated condition. |
| 216 | auto cmp = qcs[i].ptr()->query_condition_->negated_condition(); |
| 217 | CHECK(tiledb::test::ast_equal(conditions.at(i).ast(), cmp.ast())); |
| 218 | auto& loaded_update_values = update_values.at(i); |
| 219 | for (uint64_t j = 0; j < uvs[i].size(); j++) { |
| 220 | CHECK(uvs[i][j].field_name() == loaded_update_values[j].field_name()); |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | array->close(); |
| 225 | } |
| 226 | |
| 227 | void UpdatesFx::remove_array(const std::string& array_name) { |
| 228 | if (!is_array(array_name)) |
nothing calls this directly
no test coverage detected