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

Function gen_t_start

src/gpre/languages/ada.cpp:2990–3036  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2988//
2989
2990static void gen_t_start( const act* action, int column)
2991{
2992 // for automatically generated transactions, and transactions that are
2993 // explicitly started, but don't have any arguments so don't get a TPB,
2994 // generate something plausible.
2995
2996 const gpre_tra* trans;
2997 if (!action || !(trans = (gpre_tra*) action->act_object))
2998 {
2999 t_start_auto(action, 0, status_vector(action), column, false);
3000 return;
3001 }
3002
3003 // build a complete statement, including tpb's.
3004 // first generate any appropriate ready statements,
3005 // and fill in the tpb vector (aka TEB).
3006
3007 int count = 0;
3008 for (const tpb* tpb_iterator = trans->tra_tpb; tpb_iterator;
3009 tpb_iterator = tpb_iterator->tpb_tra_next)
3010 {
3011 count++;
3012 const gpre_dbb* db = tpb_iterator->tpb_database;
3013 if (gpreGlob.sw_auto)
3014 {
3015 const TEXT* filename = db->dbb_runtime;
3016 if (filename || !(db->dbb_flags & DBB_sqlca))
3017 {
3018 printa(column, "if (%s%s = 0) then", gpreGlob.ada_package, db->dbb_name->sym_string);
3019 align(column + INDENT);
3020 make_ready(db, filename, status_vector(action), column + INDENT, 0);
3021 endif(column);
3022 }
3023 }
3024
3025 printa(column, "isc_teb(%d).tpb_len := %d;", count, tpb_iterator->tpb_length);
3026 printa(column, "isc_teb(%d).tpb_ptr := isc_tpb_%d'address;", count, tpb_iterator->tpb_ident);
3027 printa(column, "isc_teb(%d).dbb_ptr := %s%s'address;",
3028 count, gpreGlob.ada_package, db->dbb_name->sym_string);
3029 }
3030
3031 printa(column, "firebird.start_multiple (%s %s%s, %d, isc_teb'address);", status_vector(action),
3032 gpreGlob.ada_package, trans->tra_handle ? (const char*) trans->tra_handle : "gds_trans",
3033 trans->tra_db_count);
3034
3035 set_sqlcode(action, column);
3036}
3037
3038
3039//____________________________________________________________

Callers 1

ADA_actionFunction · 0.70

Calls 7

t_start_autoFunction · 0.70
status_vectorFunction · 0.70
printaFunction · 0.70
alignFunction · 0.70
make_readyFunction · 0.70
endifFunction · 0.70
set_sqlcodeFunction · 0.70

Tested by

no test coverage detected