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

Function gen_t_start

src/gpre/languages/rmc.cpp:3621–3673  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3619//
3620
3621static void gen_t_start( const act* action)
3622{
3623 TEXT dbname[80];
3624
3625 // if this is a purely default transaction, just let it through
3626
3627 const gpre_tra* trans;
3628 if (!action || !(trans = (gpre_tra*) action->act_object))
3629 {
3630 t_start_auto(0, status_vector(action), action, false);
3631 return;
3632 }
3633
3634 // build a complete statement, including tpb's. Ready db's as gpre_req.
3635
3636 const tpb* tpb_iterator;
3637 if (gpreGlob.sw_auto)
3638 for (tpb_iterator = trans->tra_tpb; tpb_iterator; tpb_iterator = tpb_iterator->tpb_tra_next)
3639 {
3640 const gpre_dbb* db = tpb_iterator->tpb_database;
3641 const TEXT* filename = db->dbb_runtime;
3642 if (filename || !(db->dbb_flags & DBB_sqlca))
3643 {
3644 printa(names[COLUMN], false, "IF %s = 0 THEN", db->dbb_name->sym_string);
3645 const USHORT namelength = static_cast<USHORT>(filename ? strlen(filename) : 0);
3646 if (filename)
3647 {
3648 sprintf(dbname, "%s%ddb", names[isc_b_pos], db->dbb_id);
3649 filename = dbname;
3650 }
3651 make_ready(db, filename, status_vector(action), 0, namelength);
3652 set_sqlcode(action);
3653 printa(names[COLUMN], false, "END-IF");
3654 }
3655 }
3656
3657 printa(names[COLUMN], true, "CALL \"%s\" USING %s, %s, %d",
3658 ISC_START_TRANSACTION,
3659 status_vector(action),
3660 trans->tra_handle ? trans->tra_handle : names[isc_trans_pos],
3661 trans->tra_db_count);
3662
3663 for (tpb_iterator = trans->tra_tpb; tpb_iterator; tpb_iterator = tpb_iterator->tpb_tra_next)
3664 {
3665 printa(names[CONTINUE], true, ", %s, %d, %s%d",
3666 tpb_iterator->tpb_database->dbb_name->sym_string,
3667 tpb_iterator->tpb_length,
3668 names[isc_tpb_pos], tpb_iterator->tpb_ident);
3669 }
3670
3671 set_sqlcode(action);
3672
3673}
3674
3675
3676//____________________________________________________________

Callers 1

RMC_actionFunction · 0.70

Calls 5

t_start_autoFunction · 0.70
status_vectorFunction · 0.70
printaFunction · 0.70
make_readyFunction · 0.70
set_sqlcodeFunction · 0.70

Tested by

no test coverage detected