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

Function t_start_auto

src/gpre/languages/ftn.cpp:4013–4079  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4011//
4012
4013static void t_start_auto(const gpre_req* request, const TEXT* vector, const act* action, bool test)
4014{
4015 TEXT buffer[256], temp[40];
4016 buffer[0] = 0;
4017 const TEXT* trname = request_trans(action, request);
4018
4019 // this is a default transaction, make sure all databases are ready
4020
4021 int count = 0;
4022 for (const gpre_dbb* db = gpreGlob.isc_databases; db; db = db->dbb_next)
4023 {
4024 if (gpreGlob.sw_auto)
4025 {
4026 const TEXT* filename = db->dbb_runtime;
4027 if (filename || !(db->dbb_flags & DBB_sqlca))
4028 {
4029 if (buffer[0])
4030 printa(COLUMN, "IF (%s .EQ. 0 .AND. %s(2) .EQ. 0) THEN",
4031 db->dbb_name->sym_string, vector);
4032 else
4033 printa(COLUMN, "IF (%s .EQ. 0) THEN", db->dbb_name->sym_string);
4034 make_ready(db, filename, vector, 0);
4035 printa(COLUMN, "END IF");
4036 if (buffer[0])
4037 strcat(buffer, " .AND. ");
4038 sprintf(temp, "%s .NE. 0", db->dbb_name->sym_string);
4039 strcat(buffer, temp);
4040 }
4041 }
4042
4043 count++;
4044#ifdef HPUX
4045 printa(COLUMN, "ISC_TEB%d_LEN = 0", count);
4046 printa(COLUMN, "ISC_TEB%d_TPB = ISC_NULL", count);
4047 printa(COLUMN, "ISC_TEB%d_DBB = ISC_BADDRESS (%s)", count, db->dbb_name->sym_string);
4048#endif
4049 }
4050
4051 if (gpreGlob.sw_auto)
4052 {
4053 if (!buffer[0])
4054 strcpy(buffer, ".TRUE.");
4055 if (test)
4056 printa(COLUMN, "IF ((%s) .AND. (%s .EQ. 0)) THEN", buffer, trname);
4057 else
4058 printa(COLUMN, "IF (%s) THEN", buffer);
4059 }
4060
4061#ifdef HPUX
4062 printa(COLUMN_INDENT, "CALL ISC_START_MULTIPLE (%s, %s, %s%d%s, ISC_TEB)",
4063 vector, trname, I2CONST_1, count, I2CONST_2);
4064#else
4065 printa(COLUMN_INDENT, "CALL ISC_START_TRANSACTION (%s, %s, %s%d%s",
4066 vector, trname, I2CONST_1, count, I2CONST_2);
4067
4068 for (const gpre_dbb* db2 = gpreGlob.isc_databases; db2; db2 = db2->dbb_next)
4069 {
4070 printa(CONTINUE, ", %s, %s0%s, 0", db2->dbb_name->sym_string, I2CONST_1, I2CONST_2);

Callers 9

gen_blob_openFunction · 0.70
gen_compileFunction · 0.70
gen_ddlFunction · 0.70
gen_dyn_executeFunction · 0.70
gen_dyn_immediateFunction · 0.70
gen_dyn_openFunction · 0.70
gen_dyn_prepareFunction · 0.70
gen_procedureFunction · 0.70
gen_t_startFunction · 0.70

Calls 4

status_and_stopFunction · 0.85
request_transFunction · 0.70
printaFunction · 0.70
make_readyFunction · 0.70

Tested by

no test coverage detected