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C73OG3YSAC YTAYNN7VNYZNLGUSGY3EF33MGQWMJW76FKV657SBKASQFQC7EB3AC 32KJOERMPFWZZZCIN6TGGVX72GMAJT6VCCIP7S65EHNF3KM42KWAC IK2UBDAU6QKUXHJG3SXJKYGIIXRDKI6UVRTFC6ZVDXDCGNCMEWVAC WDGARQ76X6RLSFPJTW52BZYFKBC7DPSTABI7HHIKNYHBYXSUNTHQC txn.parameterized("update Jobsets set startTime = $1 where project = $2 and name = $3")(now)(jobset.name.first)(jobset.name.second).exec();
txn.exec_params0("update Jobsets set startTime = $1 where project = $2 and name = $3",now,jobset.name.first,jobset.name.second);
txn.parameterized("update Jobsets set triggerTime = null where project = $1 and name = $2 and startTime is not null and triggerTime <= startTime")(jobset.name.first)(jobset.name.second).exec();
txn.exec_params0("update Jobsets set triggerTime = null where project = $1 and name = $2 and startTime is not null and triggerTime <= startTime",jobset.name.first,jobset.name.second);
txn.parameterized("update Jobsets set startTime = null where project = $1 and name = $2")(jobset.name.first)(jobset.name.second).exec();
txn.exec_params0("update Jobsets set startTime = null where project = $1 and name = $2",jobset.name.first,jobset.name.second);
txn.parameterized("update Jobsets set errorMsg = $1, lastCheckedTime = $2, errorTime = $2, fetchErrorMsg = null where project = $3 and name = $4")(fmt("evaluation %s", statusToString(status)))(now)(jobset.name.first)(jobset.name.second).exec();
txn.exec_params0("update Jobsets set errorMsg = $1, lastCheckedTime = $2, errorTime = $2, fetchErrorMsg = null where project = $3 and name = $4",fmt("evaluation %s", statusToString(status)),now,jobset.name.first,jobset.name.second);
txn.parameterized("update Builds set finished = 1, buildStatus = $2, startTime = $3, stopTime = $4, isCachedBuild = $5, notificationPendingSince = $4 where id = $1 and finished = 0")(build2->id)((int) (build2->drvPath != step->drvPath && result.buildStatus() == bsFailed ? bsDepFailed : result.buildStatus()))(result.startTime)(result.stopTime)(result.stepStatus == bsCachedFailure ? 1 : 0).exec();
txn.exec_params0("update Builds set finished = 1, buildStatus = $2, startTime = $3, stopTime = $4, isCachedBuild = $5, notificationPendingSince = $4 where id = $1 and finished = 0",build2->id,(int) (build2->drvPath != step->drvPath && result.buildStatus() == bsFailed ? bsDepFailed : result.buildStatus()),result.startTime,result.stopTime,result.stepStatus == bsCachedFailure ? 1 : 0);
txn.parameterized("update BuildSteps set busy = 0, status = $1, stopTime = $2 where busy != 0")((int) bsAborted)(stopTime, stopTime != 0).exec();
txn.exec_params0("update BuildSteps set busy = 0, status = $1, stopTime = $2 where busy != 0",(int) bsAborted,stopTime != 0 ? std::make_optional(stopTime) : std::nullopt);
auto res = txn.parameterized("select max(stepnr) from BuildSteps where build = $1")(buildId).exec();return res[0][0].is_null() ? 1 : res[0][0].as<int>() + 1;
auto res = txn.exec_params1("select max(stepnr) from BuildSteps where build = $1", buildId);return res[0].is_null() ? 1 : res[0].as<int>() + 1;
auto r = txn.parameterized("insert into BuildSteps (build, stepnr, type, drvPath, busy, startTime, system, status, propagatedFrom, errorMsg, stopTime, machine) values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12) on conflict do nothing")(buildId)(stepNr)(0) // == build(step->drvPath)(status == bsBusy ? 1 : 0)(startTime, startTime != 0)(step->drv.platform)((int) status, status != bsBusy)(propagatedFrom, propagatedFrom != 0)(errorMsg, errorMsg != "")(startTime, startTime != 0 && status != bsBusy)(machine).exec();
auto r = txn.exec_params("insert into BuildSteps (build, stepnr, type, drvPath, busy, startTime, system, status, propagatedFrom, errorMsg, stopTime, machine) values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12) on conflict do nothing",buildId,stepNr,0, // == buildstep->drvPath,status == bsBusy ? 1 : 0,startTime != 0 ? std::make_optional(startTime) : std::nullopt,step->drv.platform,status != bsBusy ? std::make_optional((int) status) : std::nullopt,propagatedFrom != 0 ? std::make_optional(propagatedFrom) : std::nullopt, // internal::paramserrorMsg != "" ? std::make_optional(errorMsg) : std::nullopt,startTime != 0 && status != bsBusy ? std::make_optional(startTime) : std::nullopt,machine);
txn.parameterized("insert into BuildStepOutputs (build, stepnr, name, path) values ($1, $2, $3, $4)")(buildId)(stepNr)(output.first)(output.second.path).exec();
txn.exec_params0("insert into BuildStepOutputs (build, stepnr, name, path) values ($1, $2, $3, $4)",buildId, stepNr, output.first, output.second.path);
if (txn.parameterized("update BuildSteps set busy = $1 where build = $2 and stepnr = $3 and busy != 0 and status is null")((int) stepState)(buildId)(stepNr).exec().affected_rows() != 1)
if (txn.exec_params("update BuildSteps set busy = $1 where build = $2 and stepnr = $3 and busy != 0 and status is null",(int) stepState,buildId,stepNr).affected_rows() != 1)
txn.parameterized("update BuildSteps set busy = 0, status = $1, errorMsg = $4, startTime = $5, stopTime = $6, machine = $7, overhead = $8, timesBuilt = $9, isNonDeterministic = $10 where build = $2 and stepnr = $3")((int) result.stepStatus)(buildId)(stepNr)(result.errorMsg, result.errorMsg != "")(result.startTime)(result.stopTime)(machine, machine != "")(result.overhead, result.overhead != 0)(result.timesBuilt, result.timesBuilt > 0)(result.isNonDeterministic, result.timesBuilt > 1).exec();
txn.exec_params0("update BuildSteps set busy = 0, status = $1, errorMsg = $4, startTime = $5, stopTime = $6, machine = $7, overhead = $8, timesBuilt = $9, isNonDeterministic = $10 where build = $2 and stepnr = $3",(int) result.stepStatus, buildId, stepNr,result.errorMsg != "" ? std::make_optional(result.errorMsg) : std::nullopt,result.startTime, result.stopTime,machine != "" ? std::make_optional(machine) : std::nullopt,result.overhead != 0 ? std::make_optional(result.overhead) : std::nullopt,result.timesBuilt > 0 ? std::make_optional(result.timesBuilt) : std::nullopt,result.timesBuilt > 1 ? std::make_optional(result.isNonDeterministic) : std::nullopt);
auto r = txn.parameterized("insert into BuildSteps (build, stepnr, type, drvPath, busy, status, startTime, stopTime) values ($1, $2, $3, $4, $5, $6, $7, $8) on conflict do nothing")(build->id)(stepNr)(1) // == substitution(drvPath)(0)(0)(startTime)(stopTime).exec();
auto r = txn.exec_params("insert into BuildSteps (build, stepnr, type, drvPath, busy, status, startTime, stopTime) values ($1, $2, $3, $4, $5, $6, $7, $8) on conflict do nothing",build->id,stepNr,1, // == substitutiondrvPath,0,0,startTime,stopTime);
txn.parameterized("insert into BuildStepOutputs (build, stepnr, name, path) values ($1, $2, $3, $4)")(build->id)(stepNr)(outputName)(storePath).exec();
txn.exec_params0("insert into BuildStepOutputs (build, stepnr, name, path) values ($1, $2, $3, $4)",build->id, stepNr, outputName, storePath);
txn.parameterized("update Builds set finished = 1, buildStatus = $2, startTime = $3, stopTime = $4, size = $5, closureSize = $6, releaseName = $7, isCachedBuild = $8, notificationPendingSince = $4 where id = $1")(build->id)((int) (res.failed ? bsFailedWithOutput : bsSuccess))(startTime)(stopTime)(res.size)(res.closureSize)(res.releaseName, res.releaseName != "")(isCachedBuild ? 1 : 0).exec();
txn.exec_params0("update Builds set finished = 1, buildStatus = $2, startTime = $3, stopTime = $4, size = $5, closureSize = $6, releaseName = $7, isCachedBuild = $8, notificationPendingSince = $4 where id = $1",build->id,(int) (res.failed ? bsFailedWithOutput : bsSuccess),startTime,stopTime,res.size,res.closureSize,res.releaseName != "" ? std::make_optional(res.releaseName) : std::nullopt,isCachedBuild ? 1 : 0);
txn.parameterized("insert into BuildProducts (build, productnr, type, subtype, fileSize, sha1hash, sha256hash, path, name, defaultPath) values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)")(build->id)(productNr++)(product.type)(product.subtype)(product.fileSize, product.isRegular)(product.sha1hash.to_string(Base16, false), product.isRegular)(product.sha256hash.to_string(Base16, false), product.isRegular)(product.path)(product.name)(product.defaultPath).exec();
txn.exec_params0("insert into BuildProducts (build, productnr, type, subtype, fileSize, sha1hash, sha256hash, path, name, defaultPath) values ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)",build->id,productNr++,product.type,product.subtype,product.isRegular ? std::make_optional(product.fileSize) : std::nullopt,product.isRegular ? std::make_optional(product.sha1hash.to_string(Base16, false)) : std::nullopt,product.isRegular ? std::make_optional(product.sha256hash.to_string(Base16, false)) : std::nullopt,product.path,product.name,product.defaultPath);
txn.parameterized("insert into BuildMetrics (build, name, unit, value, project, jobset, job, timestamp) values ($1, $2, $3, $4, $5, $6, $7, $8)")(build->id)(metric.second.name)(metric.second.unit, metric.second.unit != "")(metric.second.value)(build->projectName)(build->jobsetName)(build->jobName)(build->timestamp).exec();
txn.exec_params0("insert into BuildMetrics (build, name, unit, value, project, jobset, job, timestamp) values ($1, $2, $3, $4, $5, $6, $7, $8)",build->id,metric.second.name,metric.second.unit != "" ? std::make_optional(metric.second.unit) : std::nullopt,metric.second.value,build->projectName,build->jobsetName,build->jobName,build->timestamp);
txn.parameterized("update BuildSteps set busy = 0, status = $1 where build = $2 and stepnr = $3 and busy != 0")((int) bsAborted)(step.first)(step.second).exec();
txn.exec_params0("update BuildSteps set busy = 0, status = $1 where build = $2 and stepnr = $3 and busy != 0",(int) bsAborted,step.first,step.second);
txn.parameterized("update Builds set finished = 1, buildStatus = $2, startTime = $3, stopTime = $3 where id = $1 and finished = 0")(build->id)((int) bsAborted)(time(0)).exec();
txn.exec_params0("update Builds set finished = 1, buildStatus = $2, startTime = $3, stopTime = $3 where id = $1 and finished = 0",build->id,(int) bsAborted,time(0));
auto res = txn.parameterized("select max(build) from BuildSteps where drvPath = $1 and startTime != 0 and stopTime != 0 and status = 1")(ex.step->drvPath).exec();if (!res[0][0].is_null()) propagatedFrom = res[0][0].as<BuildID>();
auto res = txn.exec_params1("select max(build) from BuildSteps where drvPath = $1 and startTime != 0 and stopTime != 0 and status = 1",ex.step->drvPath);if (!res[0].is_null()) propagatedFrom = res[0].as<BuildID>();
auto res = txn.parameterized("select max(s.build) from BuildSteps s join BuildStepOutputs o on s.build = o.build where path = $1 and startTime != 0 and stopTime != 0 and status = 1")(output.second.path).exec();
auto res = txn.exec_params("select max(s.build) from BuildSteps s join BuildStepOutputs o on s.build = o.build where path = $1 and startTime != 0 and stopTime != 0 and status = 1",output.second.path);
"where id = $1 and finished = 0")(build->id)((int) (ex.step->drvPath == build->drvPath ? bsFailed : bsDepFailed))(time(0)).exec();
"where id = $1 and finished = 0",build->id,(int) (ex.step->drvPath == build->drvPath ? bsFailed : bsDepFailed),time(0));
auto res = txn.parameterized("select schedulingShares from Jobsets where project = $1 and name = $2")(projectName)(jobsetName).exec();
auto res = txn.exec_params1("select schedulingShares from Jobsets where project = $1 and name = $2",projectName,jobsetName);
"where s.startTime is not null and s.stopTime > $1 and project = $2 and jobset = $3")(time(0) - Jobset::schedulingWindow * 10)(projectName)(jobsetName).exec();for (auto const & row : res) {
"where s.startTime is not null and s.stopTime > $1 and project = $2 and jobset = $3",time(0) - Jobset::schedulingWindow * 10,projectName,jobsetName);for (auto const & row : res2) {
res.failed = r[0][1].as<int>() == bsFailedWithOutput;res.releaseName = r[0][2].is_null() ? "" : r[0][2].as<std::string>();res.closureSize = r[0][3].is_null() ? 0 : r[0][3].as<unsigned long long>();res.size = r[0][4].is_null() ? 0 : r[0][4].as<unsigned long long>();
res.failed = r[1].as<int>() == bsFailedWithOutput;res.releaseName = r[2].is_null() ? "" : r[2].as<std::string>();res.closureSize = r[3].is_null() ? 0 : r[3].as<unsigned long long>();res.size = r[4].is_null() ? 0 : r[4].as<unsigned long long>();
auto products = txn.parameterized("select type, subtype, fileSize, sha1hash, sha256hash, path, name, defaultPath from BuildProducts where build = $1 order by productnr")(id).exec();
auto products = txn.exec_params("select type, subtype, fileSize, sha1hash, sha256hash, path, name, defaultPath from BuildProducts where build = $1 order by productnr",id);