| 293 | } |
| 294 | |
| 295 | void Replicator::insertRecord(CheckStatusWrapper* status, |
| 296 | Transaction* transaction, |
| 297 | const char* relName, |
| 298 | IReplicatedRecord* record) |
| 299 | { |
| 300 | try |
| 301 | { |
| 302 | for (unsigned id = 0; id < record->getCount(); id++) |
| 303 | { |
| 304 | IReplicatedField* field = record->getField(id); |
| 305 | if (field != nullptr) |
| 306 | { |
| 307 | auto type = field->getType(); |
| 308 | if (type == SQL_ARRAY || type == SQL_BLOB) |
| 309 | { |
| 310 | const auto blobId = (ISC_QUAD*) field->getData(); |
| 311 | |
| 312 | if (blobId && !BlobWrapper::blobIsNull(*blobId)) |
| 313 | storeBlob(transaction, *blobId); |
| 314 | } |
| 315 | } |
| 316 | } |
| 317 | |
| 318 | const auto length = record->getRawLength(); |
| 319 | const auto data = record->getRawData(); |
| 320 | |
| 321 | auto& txnData = transaction->getData(); |
| 322 | |
| 323 | const auto atom = txnData.defineAtom(relName); |
| 324 | |
| 325 | txnData.putTag(opInsertRecord); |
| 326 | txnData.putInt32(atom); |
| 327 | txnData.putInt32(length); |
| 328 | txnData.putBinary(length, data); |
| 329 | |
| 330 | if (txnData.getSize() > m_config->bufferSize) |
| 331 | flush(txnData, FLUSH_OVERFLOW); |
| 332 | } |
| 333 | catch (const Exception& ex) |
| 334 | { |
| 335 | ex.stuffException(status); |
| 336 | } |
| 337 | } |
| 338 | |
| 339 | void Replicator::updateRecord(CheckStatusWrapper* status, |
| 340 | Transaction* transaction, |
nothing calls this directly
no test coverage detected