@@ -306,21 +306,7 @@ void Replicator::insertRecord(CheckStatusWrapper* status,
306
306
{
307
307
try
308
308
{
309
- for (unsigned id = 0 ; id < record->getCount (); id++)
310
- {
311
- IReplicatedField* field = record->getField (id);
312
- if (field != nullptr )
313
- {
314
- auto type = field->getType ();
315
- if (type == SQL_ARRAY || type == SQL_BLOB)
316
- {
317
- const auto blobId = (ISC_QUAD*) field->getData ();
318
-
319
- if (blobId && !BlobWrapper::blobIsNull (*blobId))
320
- storeBlob (transaction, *blobId);
321
- }
322
- }
323
- }
309
+ storeBlobs (transaction, record);
324
310
325
311
const auto length = record->getRawLength ();
326
312
const auto data = record->getRawData ();
@@ -353,21 +339,7 @@ void Replicator::updateRecord(CheckStatusWrapper* status,
353
339
{
354
340
try
355
341
{
356
- for (unsigned id = 0 ; id < newRecord->getCount (); id++)
357
- {
358
- IReplicatedField* field = newRecord->getField (id);
359
- if (field != nullptr )
360
- {
361
- auto type = field->getType ();
362
- if (type == SQL_ARRAY || type == SQL_BLOB)
363
- {
364
- const auto blobId = (ISC_QUAD*) field->getData ();
365
-
366
- if (blobId && !BlobWrapper::blobIsNull (*blobId))
367
- storeBlob (transaction, *blobId);
368
- }
369
- }
370
- }
342
+ storeBlobs (transaction, newRecord);
371
343
372
344
const auto orgLength = orgRecord->getRawLength ();
373
345
const auto orgData = orgRecord->getRawData ();
@@ -454,6 +426,25 @@ void Replicator::executeSqlIntl(CheckStatusWrapper* status,
454
426
}
455
427
}
456
428
429
+ void Replicator::storeBlobs (Transaction* transaction, Firebird::IReplicatedRecord* record)
430
+ {
431
+ for (unsigned id = 0 ; id < record->getCount (); id++)
432
+ {
433
+ IReplicatedField* field = record->getField (id);
434
+ if (field == nullptr )
435
+ continue ;
436
+
437
+ auto type = field->getType ();
438
+ if (type == SQL_ARRAY || type == SQL_BLOB)
439
+ {
440
+ const auto blobId = (ISC_QUAD*) field->getData ();
441
+
442
+ if (blobId && !BlobWrapper::blobIsNull (*blobId))
443
+ storeBlob (transaction, *blobId);
444
+ }
445
+ }
446
+ }
447
+
457
448
void Replicator::cleanupTransaction (CheckStatusWrapper* status,
458
449
SINT64 number)
459
450
{
0 commit comments