Skip to content

Commit e841ca6

Browse files
authored
Track sql lang function name before expand (#8333)
1 parent e539101 commit e841ca6

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

ydb/library/yql/parser/pg_catalog/catalog.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2981,6 +2981,7 @@ std::variant<const TProcDesc*, const TTypeDesc*> LookupProcWithCasts(const TStri
29812981
if (NPrivate::IsExactMatch(d->ArgTypes, d->VariadicType, argTypeIds)) {
29822982
// At most one exact match is possible, so look no further
29832983
// https://www.postgresql.org/docs/14/typeconv-func.html, step 2
2984+
catalog.ExportFunction(d->Name);
29842985
return d;
29852986
}
29862987

@@ -3031,6 +3032,7 @@ std::variant<const TProcDesc*, const TTypeDesc*> LookupProcWithCasts(const TStri
30313032
switch (candidates.size()) {
30323033
case 1:
30333034
// https://www.postgresql.org/docs/14/typeconv-func.html, end of steps 4.a, 4.c or 4.d
3035+
catalog.ExportFunction(candidates[0]->Name);
30343036
return candidates[0];
30353037

30363038
case 0:
@@ -3048,6 +3050,7 @@ std::variant<const TProcDesc*, const TTypeDesc*> LookupProcWithCasts(const TStri
30483050

30493051
if (1 == candidates.size()) {
30503052
// https://www.postgresql.org/docs/14/typeconv-func.html, end of step 4.e
3053+
catalog.ExportFunction(candidates[0]->Name);
30513054
return candidates[0];
30523055
}
30533056

@@ -3084,6 +3087,7 @@ std::variant<const TProcDesc*, const TTypeDesc*> LookupProcWithCasts(const TStri
30843087
}
30853088

30863089
if (finalCandidate) {
3090+
catalog.ExportFunction(finalCandidate->Name);
30873091
return finalCandidate;
30883092
}
30893093
}

ydb/library/yql/parser/pg_catalog/used_procs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@
9696
"bitgt",
9797
"bit_in",
9898
"bitle",
99+
"bit_length",
99100
"bitlt",
100101
"bitne",
101102
"bitnot",

ydb/library/yql/tests/sql/yt_native_file/part12/canondata/result.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2961,9 +2961,9 @@
29612961
],
29622962
"test.test[pg_catalog-pg_description_pg_syntax-default.txt-Results]": [
29632963
{
2964-
"checksum": "d392406fcda7b661799b7a045bdff0f0",
2964+
"checksum": "c409b6d485074ebf17560f4723affc3d",
29652965
"size": 2768,
2966-
"uri": "https://{canondata_backend}/1942415/c522571b1a600ba12066095e70b51c341bb2be67/resource.tar.gz#test.test_pg_catalog-pg_description_pg_syntax-default.txt-Results_/results.txt"
2966+
"uri": "https://{canondata_backend}/1773845/589814889e9fb4d6d34f5e6d53336daf3a27b51e/resource.tar.gz#test.test_pg_catalog-pg_description_pg_syntax-default.txt-Results_/results.txt"
29672967
}
29682968
],
29692969
"test.test[pg_catalog-pg_timezone_abbrevs-default.txt-Debug]": [

0 commit comments

Comments
 (0)