aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvvvv <vvvv@yandex-team.ru>2022-02-18 18:39:10 +0300
committervvvv <vvvv@yandex-team.ru>2022-02-18 18:39:10 +0300
commit6bb39bdb243edc3adf72eedf5700c691617c615d (patch)
treef8d8453d2f558d88f48daf9428cd8382468064d7
parent5ac55b01de51e962878b17d5f18ad48afc8c1659 (diff)
downloadydb-6bb39bdb243edc3adf72eedf5700c691617c615d.tar.gz
YQL-13710 more patches
ref:219a463c6a97bb894e1311464018d9a2afcb5a17
-rw-r--r--ydb/library/yql/parser/pg_query_wrapper/copy_src.py22
-rw-r--r--ydb/library/yql/parser/pg_query_wrapper/postgresql/src/backend/bootstrap/bootparse.c4
-rw-r--r--ydb/library/yql/parser/pg_query_wrapper/postgresql/src/backend/bootstrap/bootscanner.c20
-rw-r--r--ydb/library/yql/parser/pg_query_wrapper/postgresql/src/backend/replication/repl_gram.c4
-rw-r--r--ydb/library/yql/parser/pg_query_wrapper/postgresql/src/backend/replication/repl_scanner.c20
-rw-r--r--ydb/library/yql/parser/pg_query_wrapper/postgresql/src/backend/replication/syncrep_gram.c4
-rw-r--r--ydb/library/yql/parser/pg_query_wrapper/postgresql/src/backend/replication/syncrep_scanner.c20
-rw-r--r--ydb/library/yql/parser/pg_query_wrapper/postgresql/src/backend/utils/adt/jsonpath_scan.c20
-rw-r--r--ydb/library/yql/parser/pg_query_wrapper/postgresql/src/backend/utils/misc/guc-file.c20
-rw-r--r--ydb/library/yql/parser/pg_query_wrapper/vars.txt8
10 files changed, 86 insertions, 56 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 58df98a136..100bcb1d0d 100644
--- a/ydb/library/yql/parser/pg_query_wrapper/copy_src.py
+++ b/ydb/library/yql/parser/pg_query_wrapper/copy_src.py
@@ -12,6 +12,7 @@ skip_func = False
split_def = False
def_type = None
def_var = None
+ignore_func = False
def fix_line(line, all_lines, pos):
global define_for_yylval
@@ -23,6 +24,11 @@ def fix_line(line, all_lines, pos):
skip_func = True
return line
+ global ignore_func
+ if line.startswith("yyparse"):
+ ignore_func = True
+ return line
+
global split_def
global def_type
global def_var
@@ -58,6 +64,13 @@ def fix_line(line, all_lines, pos):
return None
skip_func=False
+ if ignore_func:
+ if line.startswith("{"):
+ return line
+ if not line.startswith("}"):
+ return line
+ ignore_func=False
+
if line.startswith("#") or line.startswith(" ") or line.startswith("\t"):
return line
@@ -182,6 +195,15 @@ def get_vars():
all_vars.remove("enumRelOpts")
all_vars.remove("stringRelOpts")
+ all_vars.add("yychar")
+ all_vars.add("yyin")
+ all_vars.add("yyout")
+ all_vars.add("yyleng")
+ all_vars.add("yynerrs")
+ all_vars.add("yytext")
+ all_vars.add("yy_flex_debug")
+ all_vars.add("yylineno")
+
with open("vars.txt","w") as f:
for a in sorted(all_vars):
print(a, file=f)
diff --git a/ydb/library/yql/parser/pg_query_wrapper/postgresql/src/backend/bootstrap/bootparse.c b/ydb/library/yql/parser/pg_query_wrapper/postgresql/src/backend/bootstrap/bootparse.c
index 4ff53215c2..0c35192a99 100644
--- a/ydb/library/yql/parser/pg_query_wrapper/postgresql/src/backend/bootstrap/bootparse.c
+++ b/ydb/library/yql/parser/pg_query_wrapper/postgresql/src/backend/bootstrap/bootparse.c
@@ -1175,12 +1175,12 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
/* The lookahead symbol. */
-int yychar;
+__thread int yychar;
/* The semantic value of the lookahead symbol. */
__thread YYSTYPE boot_yylval;
/* Number of syntax errors so far. */
-int yynerrs;
+__thread int yynerrs;
/*----------.
diff --git a/ydb/library/yql/parser/pg_query_wrapper/postgresql/src/backend/bootstrap/bootscanner.c b/ydb/library/yql/parser/pg_query_wrapper/postgresql/src/backend/bootstrap/bootscanner.c
index 36e1593c2e..19cae62b4f 100644
--- a/ydb/library/yql/parser/pg_query_wrapper/postgresql/src/backend/bootstrap/bootscanner.c
+++ b/ydb/library/yql/parser/pg_query_wrapper/postgresql/src/backend/bootstrap/bootscanner.c
@@ -414,9 +414,9 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
typedef size_t yy_size_t;
#endif
-extern int yyleng;
+extern __thread int yyleng;
-extern FILE *yyin, *yyout;
+extern __thread FILE *yyin, *yyout;
#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
@@ -527,7 +527,7 @@ static __thread YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array
/* yy_hold_char holds the character lost when yytext is formed. */
static __thread char yy_hold_char;
static __thread int yy_n_chars; /* number of characters read into yy_ch_buf */
-int yyleng;
+__thread int yyleng;
/* Points to current character in buffer. */
static __thread char *yy_c_buf_p = NULL;
@@ -587,14 +587,14 @@ void yyfree ( void * );
#define YY_SKIP_YYWRAP
typedef flex_uint8_t YY_CHAR;
-FILE *yyin = NULL, *yyout = NULL;
+__thread FILE *yyin = NULL, *yyout = NULL;
typedef int yy_state_type;
-extern int yylineno;
-int yylineno = 1;
+extern __thread int yylineno;
+__thread int yylineno = 1;
-extern char *yytext;
+extern __thread char *yytext;
#ifdef yytext_ptr
#undef yytext_ptr
#endif
@@ -773,8 +773,8 @@ static const flex_int16_t yy_chk[192] =
static __thread yy_state_type yy_last_accepting_state;
static __thread char *yy_last_accepting_cpos;
-extern int yy_flex_debug;
-int yy_flex_debug = 0;
+extern __thread int yy_flex_debug;
+__thread int yy_flex_debug = 0;
/* The intent behind this definition is that it'll catch
* any uses of REJECT which flex missed.
@@ -783,7 +783,7 @@ int yy_flex_debug = 0;
#define yymore() yymore_used_but_not_detected
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
-char *yytext;
+__thread char *yytext;
#line 1 "bootscanner.l"
#line 2 "bootscanner.l"
/*-------------------------------------------------------------------------
diff --git a/ydb/library/yql/parser/pg_query_wrapper/postgresql/src/backend/replication/repl_gram.c b/ydb/library/yql/parser/pg_query_wrapper/postgresql/src/backend/replication/repl_gram.c
index c972d86637..15f284443a 100644
--- a/ydb/library/yql/parser/pg_query_wrapper/postgresql/src/backend/replication/repl_gram.c
+++ b/ydb/library/yql/parser/pg_query_wrapper/postgresql/src/backend/replication/repl_gram.c
@@ -1099,12 +1099,12 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
/* The lookahead symbol. */
-int yychar;
+__thread int yychar;
/* The semantic value of the lookahead symbol. */
__thread YYSTYPE replication_yylval;
/* Number of syntax errors so far. */
-int yynerrs;
+__thread int yynerrs;
/*----------.
diff --git a/ydb/library/yql/parser/pg_query_wrapper/postgresql/src/backend/replication/repl_scanner.c b/ydb/library/yql/parser/pg_query_wrapper/postgresql/src/backend/replication/repl_scanner.c
index 6e9d35f883..e634f7d4cc 100644
--- a/ydb/library/yql/parser/pg_query_wrapper/postgresql/src/backend/replication/repl_scanner.c
+++ b/ydb/library/yql/parser/pg_query_wrapper/postgresql/src/backend/replication/repl_scanner.c
@@ -414,9 +414,9 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
typedef size_t yy_size_t;
#endif
-extern int yyleng;
+extern __thread int yyleng;
-extern FILE *yyin, *yyout;
+extern __thread FILE *yyin, *yyout;
#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
@@ -527,7 +527,7 @@ static __thread YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array
/* yy_hold_char holds the character lost when yytext is formed. */
static __thread char yy_hold_char;
static __thread int yy_n_chars; /* number of characters read into yy_ch_buf */
-int yyleng;
+__thread int yyleng;
/* Points to current character in buffer. */
static __thread char *yy_c_buf_p = NULL;
@@ -587,14 +587,14 @@ void yyfree ( void * );
#define YY_SKIP_YYWRAP
typedef flex_uint8_t YY_CHAR;
-FILE *yyin = NULL, *yyout = NULL;
+__thread FILE *yyin = NULL, *yyout = NULL;
typedef int yy_state_type;
-extern int yylineno;
-int yylineno = 1;
+extern __thread int yylineno;
+__thread int yylineno = 1;
-extern char *yytext;
+extern __thread char *yytext;
#ifdef yytext_ptr
#undef yytext_ptr
#endif
@@ -929,8 +929,8 @@ static const flex_int16_t yy_chk[644] =
static __thread yy_state_type yy_last_accepting_state;
static __thread char *yy_last_accepting_cpos;
-extern int yy_flex_debug;
-int yy_flex_debug = 0;
+extern __thread int yy_flex_debug;
+__thread int yy_flex_debug = 0;
/* The intent behind this definition is that it'll catch
* any uses of REJECT which flex missed.
@@ -939,7 +939,7 @@ int yy_flex_debug = 0;
#define yymore() yymore_used_but_not_detected
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
-char *yytext;
+__thread char *yytext;
#line 1 "repl_scanner.l"
#line 2 "repl_scanner.l"
/*-------------------------------------------------------------------------
diff --git a/ydb/library/yql/parser/pg_query_wrapper/postgresql/src/backend/replication/syncrep_gram.c b/ydb/library/yql/parser/pg_query_wrapper/postgresql/src/backend/replication/syncrep_gram.c
index 974001a94a..c7beec460b 100644
--- a/ydb/library/yql/parser/pg_query_wrapper/postgresql/src/backend/replication/syncrep_gram.c
+++ b/ydb/library/yql/parser/pg_query_wrapper/postgresql/src/backend/replication/syncrep_gram.c
@@ -1008,12 +1008,12 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
/* The lookahead symbol. */
-int yychar;
+__thread int yychar;
/* The semantic value of the lookahead symbol. */
__thread YYSTYPE syncrep_yylval;
/* Number of syntax errors so far. */
-int yynerrs;
+__thread int yynerrs;
/*----------.
diff --git a/ydb/library/yql/parser/pg_query_wrapper/postgresql/src/backend/replication/syncrep_scanner.c b/ydb/library/yql/parser/pg_query_wrapper/postgresql/src/backend/replication/syncrep_scanner.c
index 2a2b61b85e..b163179b11 100644
--- a/ydb/library/yql/parser/pg_query_wrapper/postgresql/src/backend/replication/syncrep_scanner.c
+++ b/ydb/library/yql/parser/pg_query_wrapper/postgresql/src/backend/replication/syncrep_scanner.c
@@ -414,9 +414,9 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
typedef size_t yy_size_t;
#endif
-extern int yyleng;
+extern __thread int yyleng;
-extern FILE *yyin, *yyout;
+extern __thread FILE *yyin, *yyout;
#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
@@ -527,7 +527,7 @@ static __thread YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array
/* yy_hold_char holds the character lost when yytext is formed. */
static __thread char yy_hold_char;
static __thread int yy_n_chars; /* number of characters read into yy_ch_buf */
-int yyleng;
+__thread int yyleng;
/* Points to current character in buffer. */
static __thread char *yy_c_buf_p = NULL;
@@ -587,14 +587,14 @@ void yyfree ( void * );
#define YY_SKIP_YYWRAP
typedef flex_uint8_t YY_CHAR;
-FILE *yyin = NULL, *yyout = NULL;
+__thread FILE *yyin = NULL, *yyout = NULL;
typedef int yy_state_type;
-extern int yylineno;
-int yylineno = 1;
+extern __thread int yylineno;
+__thread int yylineno = 1;
-extern char *yytext;
+extern __thread char *yytext;
#ifdef yytext_ptr
#undef yytext_ptr
#endif
@@ -710,8 +710,8 @@ static const flex_int16_t yy_chk[64] =
static __thread yy_state_type yy_last_accepting_state;
static __thread char *yy_last_accepting_cpos;
-extern int yy_flex_debug;
-int yy_flex_debug = 0;
+extern __thread int yy_flex_debug;
+__thread int yy_flex_debug = 0;
/* The intent behind this definition is that it'll catch
* any uses of REJECT which flex missed.
@@ -720,7 +720,7 @@ int yy_flex_debug = 0;
#define yymore() yymore_used_but_not_detected
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
-char *yytext;
+__thread char *yytext;
#line 1 "syncrep_scanner.l"
#line 2 "syncrep_scanner.l"
/*-------------------------------------------------------------------------
diff --git a/ydb/library/yql/parser/pg_query_wrapper/postgresql/src/backend/utils/adt/jsonpath_scan.c b/ydb/library/yql/parser/pg_query_wrapper/postgresql/src/backend/utils/adt/jsonpath_scan.c
index 4eaddf1ace..816bef036f 100644
--- a/ydb/library/yql/parser/pg_query_wrapper/postgresql/src/backend/utils/adt/jsonpath_scan.c
+++ b/ydb/library/yql/parser/pg_query_wrapper/postgresql/src/backend/utils/adt/jsonpath_scan.c
@@ -426,9 +426,9 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
typedef size_t yy_size_t;
#endif
-extern int yyleng;
+extern __thread int yyleng;
-extern FILE *yyin, *yyout;
+extern __thread FILE *yyin, *yyout;
#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
@@ -539,7 +539,7 @@ static __thread YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array
/* yy_hold_char holds the character lost when yytext is formed. */
static __thread char yy_hold_char;
static __thread int yy_n_chars; /* number of characters read into yy_ch_buf */
-int yyleng;
+__thread int yyleng;
/* Points to current character in buffer. */
static __thread char *yy_c_buf_p = NULL;
@@ -599,14 +599,14 @@ void yyfree ( void * );
#define YY_SKIP_YYWRAP
typedef flex_uint8_t YY_CHAR;
-FILE *yyin = NULL, *yyout = NULL;
+__thread FILE *yyin = NULL, *yyout = NULL;
typedef const struct yy_trans_info *yy_state_type;
-extern int yylineno;
-int yylineno = 1;
+extern __thread int yylineno;
+__thread int yylineno = 1;
-extern char *yytext;
+extern __thread char *yytext;
#ifdef yytext_ptr
#undef yytext_ptr
#endif
@@ -2386,8 +2386,8 @@ static __thread const struct yy_trans_info *yy_start_state_list[11] =
} ;
-extern int yy_flex_debug;
-int yy_flex_debug = 0;
+extern __thread int yy_flex_debug;
+__thread int yy_flex_debug = 0;
/* The intent behind this definition is that it'll catch
* any uses of REJECT which flex missed.
@@ -2396,7 +2396,7 @@ int yy_flex_debug = 0;
#define yymore() yymore_used_but_not_detected
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
-char *yytext;
+__thread char *yytext;
#line 1 "jsonpath_scan.l"
#line 2 "jsonpath_scan.l"
/*-------------------------------------------------------------------------
diff --git a/ydb/library/yql/parser/pg_query_wrapper/postgresql/src/backend/utils/misc/guc-file.c b/ydb/library/yql/parser/pg_query_wrapper/postgresql/src/backend/utils/misc/guc-file.c
index 701db7b8d5..a96bed05d4 100644
--- a/ydb/library/yql/parser/pg_query_wrapper/postgresql/src/backend/utils/misc/guc-file.c
+++ b/ydb/library/yql/parser/pg_query_wrapper/postgresql/src/backend/utils/misc/guc-file.c
@@ -414,9 +414,9 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
typedef size_t yy_size_t;
#endif
-extern int yyleng;
+extern __thread int yyleng;
-extern FILE *yyin, *yyout;
+extern __thread FILE *yyin, *yyout;
#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
@@ -527,7 +527,7 @@ static __thread YY_BUFFER_STATE * yy_buffer_stack = NULL; /**< Stack as an array
/* yy_hold_char holds the character lost when yytext is formed. */
static __thread char yy_hold_char;
static __thread int yy_n_chars; /* number of characters read into yy_ch_buf */
-int yyleng;
+__thread int yyleng;
/* Points to current character in buffer. */
static __thread char *yy_c_buf_p = NULL;
@@ -587,14 +587,14 @@ void yyfree ( void * );
#define YY_SKIP_YYWRAP
typedef flex_uint8_t YY_CHAR;
-FILE *yyin = NULL, *yyout = NULL;
+__thread FILE *yyin = NULL, *yyout = NULL;
typedef int yy_state_type;
-extern int yylineno;
-int yylineno = 1;
+extern __thread int yylineno;
+__thread int yylineno = 1;
-extern char *yytext;
+extern __thread char *yytext;
#ifdef yytext_ptr
#undef yytext_ptr
#endif
@@ -734,8 +734,8 @@ static const flex_int16_t yy_chk[168] =
static __thread yy_state_type yy_last_accepting_state;
static __thread char *yy_last_accepting_cpos;
-extern int yy_flex_debug;
-int yy_flex_debug = 0;
+extern __thread int yy_flex_debug;
+__thread int yy_flex_debug = 0;
/* The intent behind this definition is that it'll catch
* any uses of REJECT which flex missed.
@@ -744,7 +744,7 @@ int yy_flex_debug = 0;
#define yymore() yymore_used_but_not_detected
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
-char *yytext;
+__thread char *yytext;
#line 1 "guc-file.l"
/* -*-pgsql-c-*- */
/*
diff --git a/ydb/library/yql/parser/pg_query_wrapper/vars.txt b/ydb/library/yql/parser/pg_query_wrapper/vars.txt
index 1dd390df73..6d79349aa4 100644
--- a/ydb/library/yql/parser/pg_query_wrapper/vars.txt
+++ b/ydb/library/yql/parser/pg_query_wrapper/vars.txt
@@ -1495,6 +1495,7 @@ yy_buffer_stack_max
yy_buffer_stack_top
yy_c_buf_p
yy_did_buffer_switch_on_eof
+yy_flex_debug
yy_hold_char
yy_init
yy_last_accepting_cpos
@@ -1502,6 +1503,13 @@ yy_last_accepting_state
yy_n_chars
yy_start
yy_start_state_list
+yychar
+yyin
+yyleng
yyline
+yylineno
+yynerrs
+yyout
+yytext
zero_damaged_pages
zoneabbrevtbl