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

Function gen_t_start

src/gpre/languages/ftn.cpp:3355–3420  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3353//
3354
3355static void gen_t_start(const act* action)
3356{
3357 // if this is a purely default transaction, just let it through
3358 gpre_tra* trans;
3359 if (!action || !(trans = (gpre_tra*) action->act_object))
3360 {
3361 t_start_auto(0, status_vector(), action, false);
3362 return;
3363 }
3364
3365 // build a complete statement, including tpb's. Ready db's as req.
3366
3367 const tpb* tpb_iterator;
3368 if (gpreGlob.sw_auto)
3369 for (tpb_iterator = trans->tra_tpb; tpb_iterator; tpb_iterator = tpb_iterator->tpb_tra_next)
3370 {
3371 const gpre_dbb* db = tpb_iterator->tpb_database;
3372 const TEXT* filename = db->dbb_runtime;
3373 if (filename || !(db->dbb_flags & DBB_sqlca))
3374 {
3375 printa(COLUMN, "IF (%s .EQ. 0) THEN", db->dbb_name->sym_string);
3376 make_ready(db, filename, status_vector(), 0);
3377 status_and_stop(action);
3378 printa(COLUMN, "END IF");
3379 }
3380 }
3381
3382#ifdef HPUX
3383 // If this is HPUX we should be building a teb vector here
3384 // with the tpb address and length specified
3385
3386 int count = 0;
3387 for (tpb_iterator = trans->tra_tpb; tpb_iterator; tpb_iterator = tpb_iterator->tpb_tra_next)
3388 {
3389 count++;
3390 const gpre_dbb* db = tpb_iterator->tpb_database;
3391 printa(COLUMN, "ISC_TEB%d_LEN = %d", count, tpb_iterator->tpb_length);
3392 printa(COLUMN, "ISC_TEB%d_TPB = ISC_BADDRESS (ISC_TPB_%d)", count, tpb_iterator->tpb_ident);
3393 printa(COLUMN, "ISC_TEB%d_DBB = ISC_BADDRESS (%s)", count, db->dbb_name->sym_string);
3394 }
3395
3396 printa(COLUMN, "CALL ISC_START_MULTIPLE (%s, %s, %d, ISC_TEB)",
3397 status_vector(),
3398 trans->tra_handle ? trans->tra_handle : "gds__trans",
3399 trans->tra_db_count);
3400
3401#else
3402
3403 printa(COLUMN, "CALL ISC_START_TRANSACTION (%s, %s, %s%d%s",
3404 status_vector(),
3405 trans->tra_handle ? trans->tra_handle : "GDS__TRANS",
3406 I2CONST_1, trans->tra_db_count, I2CONST_2);
3407
3408 for (tpb_iterator = trans->tra_tpb; tpb_iterator; tpb_iterator = tpb_iterator->tpb_tra_next)
3409 {
3410 printa(CONTINUE, ", %s, %s%d%s, isc_tpb_%d",
3411 tpb_iterator->tpb_database->dbb_name->sym_string,
3412 I2CONST_1, tpb_iterator->tpb_length, I2CONST_2,

Callers 1

FTN_actionFunction · 0.70

Calls 5

status_and_stopFunction · 0.85
t_start_autoFunction · 0.70
status_vectorFunction · 0.70
printaFunction · 0.70
make_readyFunction · 0.70

Tested by

no test coverage detected