Skip to content

Commit

Permalink
validate dangerouse construction (#11873)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanmorozov333 authored Nov 25, 2024
1 parent 71a7067 commit afbc266
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,12 @@ class TNormalForm {

std::shared_ptr<TDataForIndexesCheckers> TDataForIndexesCheckers::Build(const TProgramContainer& program) {
AFL_DEBUG(NKikimrServices::TX_COLUMNSHARD)("program", program.DebugString());
auto fStep = program.GetSteps().front();
auto& steps = program.GetStepsVerified();
if (!steps.size()) {
AFL_WARN(NKikimrServices::TX_COLUMNSHARD)("event", "no_steps_in_program");
return nullptr;
}
auto fStep = steps.front();
TNormalForm nForm;
for (auto&& s : fStep->GetAssignes()) {
if (!nForm.Add(s, program)) {
Expand Down
5 changes: 5 additions & 0 deletions ydb/core/tx/program/program.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ class TProgramContainer {
}
}

const std::vector<std::shared_ptr<NSsa::TProgramStep>>& GetStepsVerified() const {
AFL_VERIFY(!!Program);
return Program->Steps;
}

template <class TDataContainer>
inline arrow::Status ApplyProgram(std::shared_ptr<TDataContainer>& batch) const {
if (Program) {
Expand Down

0 comments on commit afbc266

Please sign in to comment.