diff options
author | vvvv <[email protected]> | 2025-03-20 22:15:41 +0300 |
---|---|---|
committer | vvvv <[email protected]> | 2025-03-20 22:30:37 +0300 |
commit | b0562c0e5a08f64cb9b64c37259f9c220dba4e3e (patch) | |
tree | 7a5d33185f5cc80ee74ba0ff3b2fd5c4747d8929 /yql/essentials/sql/v1 | |
parent | c10c049689d0bec259b1b566f13615e103ea521b (diff) |
YQL-19746 fix
commit_hash:49e5e33ed38f7fd623cef80d2765d464a353ff9c
Diffstat (limited to 'yql/essentials/sql/v1')
-rw-r--r-- | yql/essentials/sql/v1/select.cpp | 6 | ||||
-rw-r--r-- | yql/essentials/sql/v1/source.cpp | 2 | ||||
-rw-r--r-- | yql/essentials/sql/v1/source.h | 4 | ||||
-rw-r--r-- | yql/essentials/sql/v1/sql_ut_common.h | 11 |
4 files changed, 17 insertions, 6 deletions
diff --git a/yql/essentials/sql/v1/select.cpp b/yql/essentials/sql/v1/select.cpp index 98029daa511..832495bc3c8 100644 --- a/yql/essentials/sql/v1/select.cpp +++ b/yql/essentials/sql/v1/select.cpp @@ -132,7 +132,7 @@ public: return false; } } - src->AddDependentSource(Source.Get()); + src->AddDependentSource(Source); } if (Node && WithTables) { TTableList tableList; @@ -497,7 +497,7 @@ public: } if (src) { - src->AddDependentSource(source.Get()); + src->AddDependentSource(source); } if (!source->Init(ctx, src)) { return false; @@ -1274,7 +1274,7 @@ public: } if (src) { - src->AddDependentSource(Source.Get()); + src->AddDependentSource(Source); } if (!Source->Init(ctx, src)) { return false; diff --git a/yql/essentials/sql/v1/source.cpp b/yql/essentials/sql/v1/source.cpp index c2fb13b103b..28afe17d9c3 100644 --- a/yql/essentials/sql/v1/source.cpp +++ b/yql/essentials/sql/v1/source.cpp @@ -649,7 +649,7 @@ TMaybe<TString> ISource::FindColumnMistype(const TString& name) const { return result ? result : FindMistypeIn(ExprAliases, name); } -void ISource::AddDependentSource(ISource* usedSource) { +void ISource::AddDependentSource(TSourcePtr usedSource) { UsedSources.push_back(usedSource); } diff --git a/yql/essentials/sql/v1/source.h b/yql/essentials/sql/v1/source.h index f89be5dd982..6eb040f2e42 100644 --- a/yql/essentials/sql/v1/source.h +++ b/yql/essentials/sql/v1/source.h @@ -105,7 +105,7 @@ namespace NSQLTranslationV1 { virtual TMaybe<TString> FindColumnMistype(const TString& name) const; virtual bool InitFilters(TContext& ctx); - void AddDependentSource(ISource* usedSource); + void AddDependentSource(TSourcePtr usedSource); bool IsAlias(EExprSeat exprSeat, const TString& label) const; bool IsExprAlias(const TString& label) const; bool IsExprSeat(EExprSeat exprSeat, EExprType type = EExprType::WithExpression) const; @@ -144,7 +144,7 @@ namespace NSQLTranslationV1 { TLegacyHoppingWindowSpecPtr LegacyHoppingWindowSpec; TNodePtr SessionWindow; TNodePtr HoppingWindow; - TVector<ISource*> UsedSources; + TVector<TSourcePtr> UsedSources; TString FlattenMode; bool FlattenColumns = false; THashMap<TString, ui32> GenIndexes; diff --git a/yql/essentials/sql/v1/sql_ut_common.h b/yql/essentials/sql/v1/sql_ut_common.h index 734d19b8a33..36fe641ba63 100644 --- a/yql/essentials/sql/v1/sql_ut_common.h +++ b/yql/essentials/sql/v1/sql_ut_common.h @@ -8485,3 +8485,14 @@ Y_UNIT_TEST_SUITE(OlapPartitionCount) { UNIT_ASSERT_STRING_CONTAINS(res.Issues.ToString(), "PARTITION_COUNT can be used only with STORE=COLUMN"); } } + +Y_UNIT_TEST_SUITE(Crashes) { + Y_UNIT_TEST(IncorrectCorrQuery) { + NYql::TAstParseResult res = SqlToYql(R"sql( + use plato; + SELECT COUNT(DISTINCT EXISTS (SELECT 1 FROM t1 AS t2)) FROM Input AS t1 + )sql"); + + UNIT_ASSERT_C(res.IsOk(), res.Issues.ToString()); + } +} |