Skip to content

Commit 032ead9

Browse files
authored
Merge d3fc4ec into ef84e11
2 parents ef84e11 + d3fc4ec commit 032ead9

File tree

6 files changed

+21
-10
lines changed

6 files changed

+21
-10
lines changed

ydb/library/yql/parser/pg_wrapper/interface/utils.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ bool ParsePgIntervalModifier(const TString& str, i32& ret);
1515
std::unique_ptr<NUdf::IPgBuilder> CreatePgBuilder();
1616
bool HasPgKernel(ui32 procOid);
1717

18+
ui64 HexEncode(const char *src, size_t len, char *dst);
1819
} // NYql
1920

20-
extern "C" {
21-
// copied from postgres/src/include/utils/builtins.h
22-
ui64 hex_encode(const char *src, size_t len, char *dst);
23-
}
24-

ydb/library/yql/parser/pg_wrapper/pg_compat.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ extern "C" {
2323

2424
#undef Min
2525
#undef Max
26+
#undef Abs
2627
#undef bind
2728
#undef open
2829
#undef FATAL
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#include <ydb/library/yql/parser/pg_wrapper/interface/interface.h>
2+
#include <ydb/library/yql/parser/pg_wrapper/pg_compat.h>
3+
4+
extern "C" {
5+
#include <utils/builtins.h>
6+
}
7+
8+
9+
namespace NYql {
10+
ui64 HexEncode(const char *src, size_t len, char *dst) {
11+
return ::hex_encode(src, len, dst);
12+
}
13+
}
14+

ydb/library/yql/parser/pg_wrapper/ya.make

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ SRCS(
3737
config.cpp
3838
cost_mocks.cpp
3939
syscache.cpp
40+
pg_utils_wrappers.cpp
4041
)
4142

4243
IF (ARCH_X86_64)

ydb/library/yql/sql/pg_dummy/pg_sql_dummy.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -496,13 +496,12 @@ TString GetPostgresServerVersionStr() {
496496
return "pg_sql_dummy";
497497
}
498498

499-
} // namespace NKikimr::NPg
500-
501-
ui64 hex_encode(const char *src, size_t len, char *dst) {
499+
ui64 HexEncode(const char *src, size_t len, char *dst) {
502500
Y_UNUSED(src);
503501
Y_UNUSED(len);
504502
Y_UNUSED(dst);
505503

506-
return 0;
504+
throw yexception() << "HexEncode in pg_dummy does nothing";
507505
}
508506

507+
} // namespace NKikimr::NPg

ydb/library/yql/tools/pgrun/pgrun.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,7 @@ TString GetCellData(const NYT::TNode& cell, const TColumn& column) {
825825
result.resize(expectedSize);
826826
result[0] = '\\';
827827
result[1] = 'x';
828-
const auto cnt = hex_encode(rawValue.data(), rawValue.size(), result.begin() + 2);
828+
const auto cnt = HexEncode(rawValue.data(), rawValue.size(), result.begin() + 2);
829829

830830
Y_ASSERT(cnt + 2 == expectedSize);
831831

0 commit comments

Comments
 (0)