MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / execute

Method execute

src/dsql/DsqlBatch.cpp:457–796  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

455}
456
457Firebird::IBatchCompletionState* DsqlBatch::execute(thread_db* tdbb)
458{
459 // todo - add new trace event here
460 // TraceDSQLExecute trace(req_dbb->dbb_attachment, this);
461
462 jrd_tra* transaction = tdbb->getTransaction();
463
464 // execution timer
465 thread_db::TimerGuard timerGuard(tdbb, m_dsqlRequest->setupTimer(tdbb), true);
466
467 // sync internal buffers
468 m_messages.done();
469
470 // insert blobs here
471 if (m_blobMeta.hasData())
472 {
473 // This code expects the following to work correctly
474 fb_assert(RAM_BATCH % BLOB_STREAM_ALIGN == 0);
475
476 blobSetSize(); // needed after appendBlobData()
477 m_blobs.done(); // sync internal buffers
478
479 struct BlobFlow
480 {
481 ULONG remains;
482 UCHAR* data;
483 ULONG currentBlobSize;
484 ULONG byteCount;
485
486 BlobFlow()
487 : remains(0), data(NULL), currentBlobSize(0), byteCount(0)
488 { }
489
490 void newHdr(ULONG blobSize)
491 {
492 currentBlobSize = blobSize;
493 move3(SIZEOF_BLOB_HEAD);
494 }
495
496 void move(ULONG step)
497 {
498 move3(step);
499 currentBlobSize -= step;
500 }
501
502 bool align(ULONG alignment)
503 {
504 ULONG a = byteCount % alignment;
505 if (a)
506 {
507 a = alignment - a;
508 move3(a);
509 if (currentBlobSize)
510 currentBlobSize -= a;
511 }
512 return a;
513 }
514

Callers

nothing calls this directly

Calls 15

ERRD_postFunction · 0.85
GdsClass · 0.85
NumClass · 0.85
isBpbSegmentedFunction · 0.85
FB_ALIGNFunction · 0.85
EXE_unwindFunction · 0.85
EXE_startFunction · 0.85
QuadClass · 0.85
EXE_sendFunction · 0.85
EXE_receiveFunction · 0.85
ERR_post_warningFunction · 0.85
WarningClass · 0.85

Tested by

no test coverage detected