aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvvvv <vvvv@yandex-team.ru>2022-02-17 22:37:33 +0300
committervvvv <vvvv@yandex-team.ru>2022-02-17 22:37:33 +0300
commit55c6ad7179b9300375e9a16a3956dc706fcb560b (patch)
tree0213ec9ca99e19e4c4d697f53c599fb40d8c8e50
parenta4e5577781d9f1162779286558a90252430f6200 (diff)
downloadydb-55c6ad7179b9300375e9a16a3956dc706fcb560b.tar.gz
YQL-13710 more patches
ref:c39e3264ddeb6eb0862817a1504a8bfc4ed908c9
-rw-r--r--ydb/library/yql/parser/pg_query_wrapper/copy_src.py26
-rw-r--r--ydb/library/yql/parser/pg_query_wrapper/postgresql/src/backend/replication/walreceiver.c4
2 files changed, 24 insertions, 6 deletions
diff --git a/ydb/library/yql/parser/pg_query_wrapper/copy_src.py b/ydb/library/yql/parser/pg_query_wrapper/copy_src.py
index e087a8e9a6..3a86e33bd3 100644
--- a/ydb/library/yql/parser/pg_query_wrapper/copy_src.py
+++ b/ydb/library/yql/parser/pg_query_wrapper/copy_src.py
@@ -10,8 +10,10 @@ thread_funcs = []
define_for_yylval = None
skip_func = False
split_def = False
+def_type = None
+def_var = None
-def fix_line(line):
+def fix_line(line, all_lines, pos):
global define_for_yylval
if line.startswith("#define yylval"):
define_for_yylval=line[14:].strip()
@@ -22,13 +24,28 @@ def fix_line(line):
return line
global split_def
+ global def_type
+ global def_var
if line.startswith("static struct xllist"):
split_def = True
+ def_type = "xllist"
+ def_var = "records";
return "typedef struct xllist\n";
if split_def and line.startswith("}"):
split_def = False;
- return "} xllist; static __thread xllist records;\n"
+ return "} " + def_type + "; static __thread " + def_type + " " + def_var + ";\n"
+
+ if line.strip()=="static struct":
+ i = pos
+ while i < len(all_lines):
+ if all_lines[i].startswith("}"):
+ name = all_lines[i][1:].replace(";","").strip()
+ split_def = True
+ def_type = name + "_t"
+ def_var = name
+ return "typedef struct " + def_type + "\n";
+ i += 1
if "ConfigureNames" in line and line.strip().endswith("[] ="):
skip_func = True
@@ -103,8 +120,9 @@ def mycopy2(src, dst):
return
with open(src,"r") as fsrc:
with open(dst,"w") as fdst:
- for line in fsrc:
- line = fix_line(line)
+ all_lines = list(fsrc)
+ for pos,line in enumerate(all_lines):
+ line = fix_line(line,all_lines,pos)
if line is not None:
fdst.write(line)
diff --git a/ydb/library/yql/parser/pg_query_wrapper/postgresql/src/backend/replication/walreceiver.c b/ydb/library/yql/parser/pg_query_wrapper/postgresql/src/backend/replication/walreceiver.c
index e2c04895df..98536a7c05 100644
--- a/ydb/library/yql/parser/pg_query_wrapper/postgresql/src/backend/replication/walreceiver.c
+++ b/ydb/library/yql/parser/pg_query_wrapper/postgresql/src/backend/replication/walreceiver.c
@@ -115,11 +115,11 @@ static __thread volatile sig_atomic_t got_SIGTERM = false;
* LogstreamResult indicates the byte positions that we have already
* written/fsynced.
*/
-static struct
+typedef struct LogstreamResult_t
{
XLogRecPtr Write; /* last byte + 1 written out in the standby */
XLogRecPtr Flush; /* last byte + 1 flushed in the standby */
-} LogstreamResult;
+} LogstreamResult_t; static __thread LogstreamResult_t LogstreamResult;
static __thread StringInfoData reply_message;
static __thread StringInfoData incoming_message;