aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzverevgeny <zverevgeny@ydb.tech>2023-09-14 07:20:52 +0300
committerzverevgeny <zverevgeny@ydb.tech>2023-09-14 07:42:29 +0300
commite19cc91cb397cdec4e9ec46165f5086969f7bccc (patch)
tree5dee3ce5bb58111cbd0ee397bb4fab0667013dbc
parent1ca9dcb19e7a0dc0b160e69229e763f45197fd03 (diff)
downloadydb-e19cc91cb397cdec4e9ec46165f5086969f7bccc.tar.gz
YQL-16186 fix memory leak, remove dead code
-rw-r--r--ydb/library/yql/sql/v1/match_recognize.cpp2
-rw-r--r--ydb/library/yql/sql/v1/match_recognize.h6
-rw-r--r--ydb/library/yql/sql/v1/sql_expression.cpp2
3 files changed, 1 insertions, 9 deletions
diff --git a/ydb/library/yql/sql/v1/match_recognize.cpp b/ydb/library/yql/sql/v1/match_recognize.cpp
index 4012bd36f9..ee95fbfafa 100644
--- a/ydb/library/yql/sql/v1/match_recognize.cpp
+++ b/ydb/library/yql/sql/v1/match_recognize.cpp
@@ -178,7 +178,7 @@ const auto DefaultNavigatingFunction = "MatchRecognizeDefaultNavigating";
bool TMatchRecognizeVarAccessNode::DoInit(TContext& ctx, ISource* src) {
//If referenced var is the var that is currently being defined
//then it's a reference to the last row in a partition
- Node = new TMatchRecognizeNavigate(ctx.Pos(), DefaultNavigatingFunction, TVector<TNodePtr>{this});
+ Node = new TMatchRecognizeNavigate(ctx.Pos(), DefaultNavigatingFunction, TVector<TNodePtr>{this->Clone()});
return Node->Init(ctx, src);
}
diff --git a/ydb/library/yql/sql/v1/match_recognize.h b/ydb/library/yql/sql/v1/match_recognize.h
index 22d4292f20..c61e996318 100644
--- a/ydb/library/yql/sql/v1/match_recognize.h
+++ b/ydb/library/yql/sql/v1/match_recognize.h
@@ -78,7 +78,6 @@ public:
, Var(var)
, TheSameVar(theSameVar)
, Column(column)
- , WithinNavigationFunction(false)
{
}
@@ -94,10 +93,6 @@ public:
return Column;
}
- void SetWithinNavigationFunction() {
- WithinNavigationFunction = true;
- }
-
bool DoInit(TContext& ctx, ISource* src) override;
TAstNode* Translate(TContext& ctx) const override {
@@ -125,7 +120,6 @@ private:
const TString Var;
const bool TheSameVar; //reference the same var as being defined by this expression;
const TString Column;
- bool WithinNavigationFunction;
};
class TMatchRecognizeNavigate: public TAstListNode {
diff --git a/ydb/library/yql/sql/v1/sql_expression.cpp b/ydb/library/yql/sql/v1/sql_expression.cpp
index d0ea13d67b..5d5089b0cd 100644
--- a/ydb/library/yql/sql/v1/sql_expression.cpp
+++ b/ydb/library/yql/sql/v1/sql_expression.cpp
@@ -862,8 +862,6 @@ TNodePtr TSqlExpression::RowPatternVarAccess(const TString& alias, const TRule_u
case TRule_an_id_or_type::ALT_NOT_SET:
break;
}
- return MatchRecognizeVarAccess(*this, alias, block.GetAlt3().GetRule_an_id_or_type1(),
- Ctx.GetMatchRecognizeDefineVar() == alias);
case TRule_unary_subexpr_suffix_TBlock1_TAlt3_TBlock1_TBlock2::ALT_NOT_SET:
Y_FAIL("You should change implementation according to grammar changes");
}