Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions ydb/library/yql/parser/pg_wrapper/interface/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@ bool ParsePgIntervalModifier(const TString& str, i32& ret);
std::unique_ptr<NUdf::IPgBuilder> CreatePgBuilder();
bool HasPgKernel(ui32 procOid);

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

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

1 change: 1 addition & 0 deletions ydb/library/yql/parser/pg_wrapper/pg_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ extern "C" {

#undef Min
#undef Max
#undef Abs
#undef bind
#undef open
#undef FATAL
Expand Down
14 changes: 14 additions & 0 deletions ydb/library/yql/parser/pg_wrapper/pg_utils_wrappers.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include <ydb/library/yql/parser/pg_wrapper/pg_compat.h>
#include <ydb/library/yql/parser/pg_wrapper/interface/utils.h>

extern "C" {
#include <utils/builtins.h>
}


namespace NYql {
ui64 HexEncode(const char *src, size_t len, char *dst) {
return ::hex_encode(src, len, dst);
}
}

2 changes: 2 additions & 0 deletions ydb/library/yql/parser/pg_wrapper/ya.make
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ SRCS(
config.cpp
cost_mocks.cpp
syscache.cpp
pg_utils_wrappers.cpp
)

IF (ARCH_X86_64)
Expand Down Expand Up @@ -70,6 +71,7 @@ PEERDIR(
ydb/library/yql/minikql/arrow
ydb/library/yql/minikql/computation
ydb/library/yql/parser/pg_catalog
ydb/library/yql/parser/pg_wrapper/interface
ydb/library/yql/providers/common/codec
ydb/library/yql/public/issue
ydb/library/yql/public/udf
Expand Down
7 changes: 5 additions & 2 deletions ydb/library/yql/sql/pg_dummy/pg_sql_dummy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -498,11 +498,14 @@ TString GetPostgresServerVersionStr() {

} // namespace NKikimr::NPg

ui64 hex_encode(const char *src, size_t len, char *dst) {
namespace NYql {

ui64 HexEncode(const char *src, size_t len, char *dst) {
Y_UNUSED(src);
Y_UNUSED(len);
Y_UNUSED(dst);

return 0;
throw yexception() << "HexEncode in pg_dummy does nothing";
}

} // NYql
2 changes: 1 addition & 1 deletion ydb/library/yql/tools/pgrun/pgrun.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@ TString GetCellData(const NYT::TNode& cell, const TColumn& column) {
result.resize(expectedSize);
result[0] = '\\';
result[1] = 'x';
const auto cnt = hex_encode(rawValue.data(), rawValue.size(), result.begin() + 2);
const auto cnt = HexEncode(rawValue.data(), rawValue.size(), result.begin() + 2);

Y_ASSERT(cnt + 2 == expectedSize);

Expand Down