/Users/deen/code/yugabyte-db/build/debugcov-clang-dynamic-arm64-ninja/postgres_build/src/backend/replication/repl_gram.c
Line | Count | Source (jump to first uncovered line) |
1 | | /* A Bison parser, made by GNU Bison 3.4.1. */ |
2 | | |
3 | | /* Bison implementation for Yacc-like parsers in C |
4 | | |
5 | | Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation, |
6 | | Inc. |
7 | | |
8 | | This program is free software: you can redistribute it and/or modify |
9 | | it under the terms of the GNU General Public License as published by |
10 | | the Free Software Foundation, either version 3 of the License, or |
11 | | (at your option) any later version. |
12 | | |
13 | | This program is distributed in the hope that it will be useful, |
14 | | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | | GNU General Public License for more details. |
17 | | |
18 | | You should have received a copy of the GNU General Public License |
19 | | along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
20 | | |
21 | | /* As a special exception, you may create a larger work that contains |
22 | | part or all of the Bison parser skeleton and distribute that work |
23 | | under terms of your choice, so long as that work isn't itself a |
24 | | parser generator using the skeleton or a modified version thereof |
25 | | as a parser skeleton. Alternatively, if you modify or redistribute |
26 | | the parser skeleton itself, you may (at your option) remove this |
27 | | special exception, which will cause the skeleton and the resulting |
28 | | Bison output files to be licensed under the GNU General Public |
29 | | License without this special exception. |
30 | | |
31 | | This special exception was added by the Free Software Foundation in |
32 | | version 2.2 of Bison. */ |
33 | | |
34 | | /* C LALR(1) parser skeleton written by Richard Stallman, by |
35 | | simplifying the original so-called "semantic" parser. */ |
36 | | |
37 | | /* All symbols defined below should begin with yy or YY, to avoid |
38 | | infringing on user name space. This should be done even for local |
39 | | variables, as they might otherwise be expanded by user macros. |
40 | | There are some unavoidable exceptions within include files to |
41 | | define necessary library symbols; they are noted "INFRINGES ON |
42 | | USER NAME SPACE" below. */ |
43 | | |
44 | | /* Undocumented macros, especially those whose name start with YY_, |
45 | | are private implementation details. Do not rely on them. */ |
46 | | |
47 | | /* Identify Bison output. */ |
48 | | #define YYBISON 1 |
49 | | |
50 | | /* Bison version. */ |
51 | | #define YYBISON_VERSION "3.4.1" |
52 | | |
53 | | /* Skeleton name. */ |
54 | | #define YYSKELETON_NAME "yacc.c" |
55 | | |
56 | | /* Pure parsers. */ |
57 | | #define YYPURE 0 |
58 | | |
59 | | /* Push parsers. */ |
60 | | #define YYPUSH 0 |
61 | | |
62 | | /* Pull parsers. */ |
63 | | #define YYPULL 1 |
64 | | |
65 | | |
66 | | /* Substitute the variable and function names. */ |
67 | | #define yyparse replication_yyparse |
68 | 0 | #define yylex replication_yylex |
69 | 0 | #define yyerror replication_yyerror |
70 | | #define yydebug replication_yydebug |
71 | 0 | #define yynerrs replication_yynerrs |
72 | | |
73 | 0 | #define yylval replication_yylval |
74 | 0 | #define yychar replication_yychar |
75 | | |
76 | | /* First part of user prologue. */ |
77 | | #line 1 "repl_gram.y" |
78 | | |
79 | | /*------------------------------------------------------------------------- |
80 | | * |
81 | | * repl_gram.y - Parser for the replication commands |
82 | | * |
83 | | * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group |
84 | | * Portions Copyright (c) 1994, Regents of the University of California |
85 | | * |
86 | | * |
87 | | * IDENTIFICATION |
88 | | * src/backend/replication/repl_gram.y |
89 | | * |
90 | | *------------------------------------------------------------------------- |
91 | | */ |
92 | | |
93 | | #include "postgres.h" |
94 | | |
95 | | #include "access/xlogdefs.h" |
96 | | #include "nodes/makefuncs.h" |
97 | | #include "nodes/replnodes.h" |
98 | | #include "replication/walsender.h" |
99 | | #include "replication/walsender_private.h" |
100 | | |
101 | | |
102 | | /* Result of the parsing is returned here */ |
103 | | Node *replication_parse_result; |
104 | | |
105 | | static SQLCmd *make_sqlcmd(void); |
106 | | |
107 | | |
108 | | /* |
109 | | * Bison doesn't allocate anything that needs to live across parser calls, |
110 | | * so we can easily have it use palloc instead of malloc. This prevents |
111 | | * memory leaks if we error out during parsing. Note this only works with |
112 | | * bison >= 2.0. However, in bison 1.875 the default is to use alloca() |
113 | | * if possible, so there's not really much problem anyhow, at least if |
114 | | * you're building with gcc. |
115 | | */ |
116 | 0 | #define YYMALLOC palloc |
117 | 0 | #define YYFREE pfree |
118 | | |
119 | | |
120 | | #line 121 "repl_gram.c" |
121 | | |
122 | | # ifndef YY_NULLPTR |
123 | | # if defined __cplusplus |
124 | | # if 201103L <= __cplusplus |
125 | | # define YY_NULLPTR nullptr |
126 | | # else |
127 | | # define YY_NULLPTR 0 |
128 | | # endif |
129 | | # else |
130 | | # define YY_NULLPTR ((void*)0) |
131 | | # endif |
132 | | # endif |
133 | | |
134 | | /* Enabling verbose error messages. */ |
135 | | #ifdef YYERROR_VERBOSE |
136 | | # undef YYERROR_VERBOSE |
137 | | # define YYERROR_VERBOSE 1 |
138 | | #else |
139 | | # define YYERROR_VERBOSE 0 |
140 | | #endif |
141 | | |
142 | | |
143 | | /* Debug traces. */ |
144 | | #ifndef YYDEBUG |
145 | | # define YYDEBUG 0 |
146 | | #endif |
147 | | #if YYDEBUG |
148 | | extern int replication_yydebug; |
149 | | #endif |
150 | | |
151 | | /* Token type. */ |
152 | | #ifndef YYTOKENTYPE |
153 | | # define YYTOKENTYPE |
154 | | enum yytokentype |
155 | | { |
156 | | SCONST = 258, |
157 | | IDENT = 259, |
158 | | UCONST = 260, |
159 | | RECPTR = 261, |
160 | | T_WORD = 262, |
161 | | K_BASE_BACKUP = 263, |
162 | | K_IDENTIFY_SYSTEM = 264, |
163 | | K_SHOW = 265, |
164 | | K_START_REPLICATION = 266, |
165 | | K_CREATE_REPLICATION_SLOT = 267, |
166 | | K_DROP_REPLICATION_SLOT = 268, |
167 | | K_TIMELINE_HISTORY = 269, |
168 | | K_LABEL = 270, |
169 | | K_PROGRESS = 271, |
170 | | K_FAST = 272, |
171 | | K_WAIT = 273, |
172 | | K_NOWAIT = 274, |
173 | | K_MAX_RATE = 275, |
174 | | K_WAL = 276, |
175 | | K_TABLESPACE_MAP = 277, |
176 | | K_NOVERIFY_CHECKSUMS = 278, |
177 | | K_TIMELINE = 279, |
178 | | K_PHYSICAL = 280, |
179 | | K_LOGICAL = 281, |
180 | | K_SLOT = 282, |
181 | | K_RESERVE_WAL = 283, |
182 | | K_TEMPORARY = 284, |
183 | | K_EXPORT_SNAPSHOT = 285, |
184 | | K_NOEXPORT_SNAPSHOT = 286, |
185 | | K_USE_SNAPSHOT = 287 |
186 | | }; |
187 | | #endif |
188 | | |
189 | | /* Value type. */ |
190 | | #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED |
191 | | union YYSTYPE |
192 | | { |
193 | | #line 47 "repl_gram.y" |
194 | | |
195 | | char *str; |
196 | | bool boolval; |
197 | | uint32 uintval; |
198 | | |
199 | | XLogRecPtr recptr; |
200 | | Node *node; |
201 | | List *list; |
202 | | DefElem *defelt; |
203 | | |
204 | | #line 205 "repl_gram.c" |
205 | | |
206 | | }; |
207 | | typedef union YYSTYPE YYSTYPE; |
208 | | # define YYSTYPE_IS_TRIVIAL 1 |
209 | | # define YYSTYPE_IS_DECLARED 1 |
210 | | #endif |
211 | | |
212 | | |
213 | | extern YYSTYPE replication_yylval; |
214 | | |
215 | | int replication_yyparse (void); |
216 | | |
217 | | |
218 | | |
219 | | |
220 | | |
221 | | #ifdef short |
222 | | # undef short |
223 | | #endif |
224 | | |
225 | | #ifdef YYTYPE_UINT8 |
226 | | typedef YYTYPE_UINT8 yytype_uint8; |
227 | | #else |
228 | | typedef unsigned char yytype_uint8; |
229 | | #endif |
230 | | |
231 | | #ifdef YYTYPE_INT8 |
232 | | typedef YYTYPE_INT8 yytype_int8; |
233 | | #else |
234 | | typedef signed char yytype_int8; |
235 | | #endif |
236 | | |
237 | | #ifdef YYTYPE_UINT16 |
238 | | typedef YYTYPE_UINT16 yytype_uint16; |
239 | | #else |
240 | | typedef unsigned short yytype_uint16; |
241 | | #endif |
242 | | |
243 | | #ifdef YYTYPE_INT16 |
244 | | typedef YYTYPE_INT16 yytype_int16; |
245 | | #else |
246 | | typedef short yytype_int16; |
247 | | #endif |
248 | | |
249 | | #ifndef YYSIZE_T |
250 | | # ifdef __SIZE_TYPE__ |
251 | 0 | # define YYSIZE_T __SIZE_TYPE__ |
252 | | # elif defined size_t |
253 | | # define YYSIZE_T size_t |
254 | | # elif ! defined YYSIZE_T |
255 | | # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ |
256 | | # define YYSIZE_T size_t |
257 | | # else |
258 | | # define YYSIZE_T unsigned |
259 | | # endif |
260 | | #endif |
261 | | |
262 | | #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) |
263 | | |
264 | | #ifndef YY_ |
265 | | # if defined YYENABLE_NLS && YYENABLE_NLS |
266 | | # if ENABLE_NLS |
267 | | # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ |
268 | | # define YY_(Msgid) dgettext ("bison-runtime", Msgid) |
269 | | # endif |
270 | | # endif |
271 | | # ifndef YY_ |
272 | 0 | # define YY_(Msgid) Msgid |
273 | | # endif |
274 | | #endif |
275 | | |
276 | | #ifndef YY_ATTRIBUTE |
277 | | # if (defined __GNUC__ \ |
278 | | && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ |
279 | | || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C |
280 | | # define YY_ATTRIBUTE(Spec) __attribute__(Spec) |
281 | | # else |
282 | | # define YY_ATTRIBUTE(Spec) /* empty */ |
283 | | # endif |
284 | | #endif |
285 | | |
286 | | #ifndef YY_ATTRIBUTE_PURE |
287 | | # define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) |
288 | | #endif |
289 | | |
290 | | #ifndef YY_ATTRIBUTE_UNUSED |
291 | | # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) |
292 | | #endif |
293 | | |
294 | | /* Suppress unused-variable warnings by "using" E. */ |
295 | | #if ! defined lint || defined __GNUC__ |
296 | 0 | # define YYUSE(E) ((void) (E)) |
297 | | #else |
298 | | # define YYUSE(E) /* empty */ |
299 | | #endif |
300 | | |
301 | | #if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ |
302 | | /* Suppress an incorrect diagnostic about yylval being uninitialized. */ |
303 | | # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ |
304 | | _Pragma ("GCC diagnostic push") \ |
305 | | _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ |
306 | | _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") |
307 | | # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ |
308 | | _Pragma ("GCC diagnostic pop") |
309 | | #else |
310 | | # define YY_INITIAL_VALUE(Value) Value |
311 | | #endif |
312 | | #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
313 | | # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
314 | | # define YY_IGNORE_MAYBE_UNINITIALIZED_END |
315 | | #endif |
316 | | #ifndef YY_INITIAL_VALUE |
317 | | # define YY_INITIAL_VALUE(Value) /* Nothing. */ |
318 | | #endif |
319 | | |
320 | | |
321 | 0 | #define YY_ASSERT(E) ((void) (0 && (E))) |
322 | | |
323 | | #if ! defined yyoverflow || YYERROR_VERBOSE |
324 | | |
325 | | /* The parser invokes alloca or malloc; define the necessary symbols. */ |
326 | | |
327 | | # ifdef YYSTACK_USE_ALLOCA |
328 | | # if YYSTACK_USE_ALLOCA |
329 | | # ifdef __GNUC__ |
330 | | # define YYSTACK_ALLOC __builtin_alloca |
331 | | # elif defined __BUILTIN_VA_ARG_INCR |
332 | | # include <alloca.h> /* INFRINGES ON USER NAME SPACE */ |
333 | | # elif defined _AIX |
334 | | # define YYSTACK_ALLOC __alloca |
335 | | # elif defined _MSC_VER |
336 | | # include <malloc.h> /* INFRINGES ON USER NAME SPACE */ |
337 | | # define alloca _alloca |
338 | | # else |
339 | | # define YYSTACK_ALLOC alloca |
340 | | # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS |
341 | | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
342 | | /* Use EXIT_SUCCESS as a witness for stdlib.h. */ |
343 | | # ifndef EXIT_SUCCESS |
344 | | # define EXIT_SUCCESS 0 |
345 | | # endif |
346 | | # endif |
347 | | # endif |
348 | | # endif |
349 | | # endif |
350 | | |
351 | | # ifdef YYSTACK_ALLOC |
352 | | /* Pacify GCC's 'empty if-body' warning. */ |
353 | | # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) |
354 | | # ifndef YYSTACK_ALLOC_MAXIMUM |
355 | | /* The OS might guarantee only one guard page at the bottom of the stack, |
356 | | and a page size can be as small as 4096 bytes. So we cannot safely |
357 | | invoke alloca (N) if N exceeds 4096. Use a slightly smaller number |
358 | | to allow for a few compiler-allocated temporary stack slots. */ |
359 | | # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ |
360 | | # endif |
361 | | # else |
362 | 0 | # define YYSTACK_ALLOC YYMALLOC |
363 | 0 | # define YYSTACK_FREE YYFREE |
364 | | # ifndef YYSTACK_ALLOC_MAXIMUM |
365 | | # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM |
366 | | # endif |
367 | | # if (defined __cplusplus && ! defined EXIT_SUCCESS \ |
368 | | && ! ((defined YYMALLOC || defined malloc) \ |
369 | | && (defined YYFREE || defined free))) |
370 | | # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ |
371 | | # ifndef EXIT_SUCCESS |
372 | | # define EXIT_SUCCESS 0 |
373 | | # endif |
374 | | # endif |
375 | | # ifndef YYMALLOC |
376 | | # define YYMALLOC malloc |
377 | | # if ! defined malloc && ! defined EXIT_SUCCESS |
378 | | void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ |
379 | | # endif |
380 | | # endif |
381 | | # ifndef YYFREE |
382 | | # define YYFREE free |
383 | | # if ! defined free && ! defined EXIT_SUCCESS |
384 | | void free (void *); /* INFRINGES ON USER NAME SPACE */ |
385 | | # endif |
386 | | # endif |
387 | | # endif |
388 | | #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ |
389 | | |
390 | | |
391 | | #if (! defined yyoverflow \ |
392 | | && (! defined __cplusplus \ |
393 | | || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) |
394 | | |
395 | | /* A type that is properly aligned for any stack member. */ |
396 | | union yyalloc |
397 | | { |
398 | | yytype_int16 yyss_alloc; |
399 | | YYSTYPE yyvs_alloc; |
400 | | }; |
401 | | |
402 | | /* The size of the maximum gap between one aligned stack and the next. */ |
403 | 0 | # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) |
404 | | |
405 | | /* The size of an array large to enough to hold all stacks, each with |
406 | | N elements. */ |
407 | | # define YYSTACK_BYTES(N) \ |
408 | 0 | ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ |
409 | 0 | + YYSTACK_GAP_MAXIMUM) |
410 | | |
411 | | # define YYCOPY_NEEDED 1 |
412 | | |
413 | | /* Relocate STACK from its old location to the new one. The |
414 | | local variables YYSIZE and YYSTACKSIZE give the old and new number of |
415 | | elements in the stack, and YYPTR gives the new location of the |
416 | | stack. Advance YYPTR to a properly aligned location for the next |
417 | | stack. */ |
418 | | # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ |
419 | 0 | do \ |
420 | 0 | { \ |
421 | 0 | YYSIZE_T yynewbytes; \ |
422 | 0 | YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ |
423 | 0 | Stack = &yyptr->Stack_alloc; \ |
424 | 0 | yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ |
425 | 0 | yyptr += yynewbytes / sizeof (*yyptr); \ |
426 | 0 | } \ |
427 | 0 | while (0) |
428 | | |
429 | | #endif |
430 | | |
431 | | #if defined YYCOPY_NEEDED && YYCOPY_NEEDED |
432 | | /* Copy COUNT objects from SRC to DST. The source and destination do |
433 | | not overlap. */ |
434 | | # ifndef YYCOPY |
435 | | # if defined __GNUC__ && 1 < __GNUC__ |
436 | | # define YYCOPY(Dst, Src, Count) \ |
437 | 0 | __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) |
438 | | # else |
439 | | # define YYCOPY(Dst, Src, Count) \ |
440 | | do \ |
441 | | { \ |
442 | | YYSIZE_T yyi; \ |
443 | | for (yyi = 0; yyi < (Count); yyi++) \ |
444 | | (Dst)[yyi] = (Src)[yyi]; \ |
445 | | } \ |
446 | | while (0) |
447 | | # endif |
448 | | # endif |
449 | | #endif /* !YYCOPY_NEEDED */ |
450 | | |
451 | | /* YYFINAL -- State number of the termination state. */ |
452 | 0 | #define YYFINAL 28 |
453 | | /* YYLAST -- Last index in YYTABLE. */ |
454 | 0 | #define YYLAST 49 |
455 | | |
456 | | /* YYNTOKENS -- Number of terminals. */ |
457 | 0 | #define YYNTOKENS 38 |
458 | | /* YYNNTS -- Number of nonterminals. */ |
459 | | #define YYNNTS 26 |
460 | | /* YYNRULES -- Number of rules. */ |
461 | | #define YYNRULES 57 |
462 | | /* YYNSTATES -- Number of states. */ |
463 | | #define YYNSTATES 76 |
464 | | |
465 | 0 | #define YYUNDEFTOK 2 |
466 | 0 | #define YYMAXUTOK 287 |
467 | | |
468 | | /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM |
469 | | as returned by yylex, with out-of-bounds checking. */ |
470 | | #define YYTRANSLATE(YYX) \ |
471 | 0 | ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) |
472 | | |
473 | | /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM |
474 | | as returned by yylex. */ |
475 | | static const yytype_uint8 yytranslate[] = |
476 | | { |
477 | | 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
478 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
479 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
480 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
481 | | 35, 36, 2, 2, 37, 2, 34, 2, 2, 2, |
482 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 33, |
483 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
484 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
485 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
486 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
487 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
488 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
489 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
490 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
491 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
492 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
493 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
494 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
495 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
496 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
497 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
498 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
499 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
500 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
501 | | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
502 | | 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, |
503 | | 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, |
504 | | 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, |
505 | | 25, 26, 27, 28, 29, 30, 31, 32 |
506 | | }; |
507 | | |
508 | | #if YYDEBUG |
509 | | /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ |
510 | | static const yytype_uint16 yyrline[] = |
511 | | { |
512 | | 0, 108, 108, 114, 115, 119, 120, 121, 122, 123, |
513 | | 124, 125, 126, 127, 134, 144, 151, 152, 161, 170, |
514 | | 173, 177, 182, 187, 192, 197, 202, 207, 212, 221, |
515 | | 232, 246, 249, 253, 258, 263, 268, 277, 285, 299, |
516 | | 314, 329, 346, 347, 351, 352, 356, 359, 363, 371, |
517 | | 376, 377, 381, 385, 392, 399, 400, 404 |
518 | | }; |
519 | | #endif |
520 | | |
521 | | #if YYDEBUG || YYERROR_VERBOSE || 0 |
522 | | /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. |
523 | | First, the terminals, then, starting at YYNTOKENS, nonterminals. */ |
524 | | static const char *const yytname[] = |
525 | | { |
526 | | "$end", "error", "$undefined", "SCONST", "IDENT", "UCONST", "RECPTR", |
527 | | "T_WORD", "K_BASE_BACKUP", "K_IDENTIFY_SYSTEM", "K_SHOW", |
528 | | "K_START_REPLICATION", "K_CREATE_REPLICATION_SLOT", |
529 | | "K_DROP_REPLICATION_SLOT", "K_TIMELINE_HISTORY", "K_LABEL", "K_PROGRESS", |
530 | | "K_FAST", "K_WAIT", "K_NOWAIT", "K_MAX_RATE", "K_WAL", |
531 | | "K_TABLESPACE_MAP", "K_NOVERIFY_CHECKSUMS", "K_TIMELINE", "K_PHYSICAL", |
532 | | "K_LOGICAL", "K_SLOT", "K_RESERVE_WAL", "K_TEMPORARY", |
533 | | "K_EXPORT_SNAPSHOT", "K_NOEXPORT_SNAPSHOT", "K_USE_SNAPSHOT", "';'", |
534 | | "'.'", "'('", "')'", "','", "$accept", "firstcmd", "opt_semicolon", |
535 | | "command", "identify_system", "show", "var_name", "base_backup", |
536 | | "base_backup_opt_list", "base_backup_opt", "create_replication_slot", |
537 | | "create_slot_opt_list", "create_slot_opt", "drop_replication_slot", |
538 | | "start_replication", "start_logical_replication", "timeline_history", |
539 | | "opt_physical", "opt_temporary", "opt_slot", "opt_timeline", |
540 | | "plugin_options", "plugin_opt_list", "plugin_opt_elem", "plugin_opt_arg", |
541 | | "sql_cmd", YY_NULLPTR |
542 | | }; |
543 | | #endif |
544 | | |
545 | | # ifdef YYPRINT |
546 | | /* YYTOKNUM[NUM] -- (External) token number corresponding to the |
547 | | (internal) symbol number NUM (which must be that of a token). */ |
548 | | static const yytype_uint16 yytoknum[] = |
549 | | { |
550 | | 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, |
551 | | 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, |
552 | | 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, |
553 | | 285, 286, 287, 59, 46, 40, 41, 44 |
554 | | }; |
555 | | # endif |
556 | | |
557 | | #define YYPACT_NINF -27 |
558 | | |
559 | | #define yypact_value_is_default(Yystate) \ |
560 | 0 | (!!((Yystate) == (-27))) |
561 | | |
562 | | #define YYTABLE_NINF -1 |
563 | | |
564 | | #define yytable_value_is_error(Yytable_value) \ |
565 | 0 | 0 |
566 | | |
567 | | /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing |
568 | | STATE-NUM. */ |
569 | | static const yytype_int8 yypact[] = |
570 | | { |
571 | | -4, -27, -27, -27, -1, -16, 11, 18, 23, 29, |
572 | | -2, -27, -27, -27, -27, -27, -27, -27, -27, -27, |
573 | | -3, -27, 0, 26, 7, 4, 17, -27, -27, -27, |
574 | | -27, 33, -27, -27, -27, 32, -27, -27, -27, -27, |
575 | | 34, 13, -27, 35, -27, -24, -27, -27, -27, -27, |
576 | | 36, 16, -27, 39, 9, 40, -27, -7, -27, 42, |
577 | | -27, -27, -27, -27, -27, -27, -27, -7, 44, -10, |
578 | | -27, -27, -27, -27, 42, -27 |
579 | | }; |
580 | | |
581 | | /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. |
582 | | Performed when YYTABLE does not specify something else to do. Zero |
583 | | means the default is an error. */ |
584 | | static const yytype_uint8 yydefact[] = |
585 | | { |
586 | | 0, 57, 20, 14, 0, 47, 0, 0, 0, 0, |
587 | | 4, 5, 12, 6, 9, 10, 7, 8, 11, 13, |
588 | | 18, 16, 15, 0, 43, 45, 37, 41, 1, 3, |
589 | | 2, 0, 22, 23, 25, 0, 24, 27, 28, 19, |
590 | | 0, 46, 42, 0, 44, 0, 38, 21, 26, 17, |
591 | | 0, 49, 32, 0, 51, 0, 39, 29, 32, 0, |
592 | | 40, 48, 36, 33, 34, 35, 31, 30, 56, 0, |
593 | | 52, 55, 54, 50, 0, 53 |
594 | | }; |
595 | | |
596 | | /* YYPGOTO[NTERM-NUM]. */ |
597 | | static const yytype_int8 yypgoto[] = |
598 | | { |
599 | | -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, |
600 | | -27, -9, -27, -27, -27, -27, -27, -27, -27, -27, |
601 | | -27, -27, -27, -26, -27, -27 |
602 | | }; |
603 | | |
604 | | /* YYDEFGOTO[NTERM-NUM]. */ |
605 | | static const yytype_int8 yydefgoto[] = |
606 | | { |
607 | | -1, 9, 30, 10, 11, 12, 22, 13, 20, 39, |
608 | | 14, 57, 66, 15, 16, 17, 18, 43, 45, 24, |
609 | | 56, 60, 69, 70, 72, 19 |
610 | | }; |
611 | | |
612 | | /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If |
613 | | positive, shift that token. If negative, reduce the rule whose |
614 | | number is the opposite. If YYTABLE_NINF, syntax error. */ |
615 | | static const yytype_uint8 yytable[] = |
616 | | { |
617 | | 1, 52, 53, 21, 2, 3, 4, 5, 6, 7, |
618 | | 8, 23, 31, 32, 33, 25, 34, 35, 36, 37, |
619 | | 38, 62, 26, 63, 64, 65, 73, 74, 27, 28, |
620 | | 41, 29, 42, 44, 40, 46, 47, 48, 49, 50, |
621 | | 55, 51, 54, 58, 59, 61, 68, 71, 75, 67 |
622 | | }; |
623 | | |
624 | | static const yytype_uint8 yycheck[] = |
625 | | { |
626 | | 4, 25, 26, 4, 8, 9, 10, 11, 12, 13, |
627 | | 14, 27, 15, 16, 17, 4, 19, 20, 21, 22, |
628 | | 23, 28, 4, 30, 31, 32, 36, 37, 5, 0, |
629 | | 4, 33, 25, 29, 34, 18, 3, 5, 4, 26, |
630 | | 24, 6, 6, 4, 35, 5, 4, 3, 74, 58 |
631 | | }; |
632 | | |
633 | | /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing |
634 | | symbol of state STATE-NUM. */ |
635 | | static const yytype_uint8 yystos[] = |
636 | | { |
637 | | 0, 4, 8, 9, 10, 11, 12, 13, 14, 39, |
638 | | 41, 42, 43, 45, 48, 51, 52, 53, 54, 63, |
639 | | 46, 4, 44, 27, 57, 4, 4, 5, 0, 33, |
640 | | 40, 15, 16, 17, 19, 20, 21, 22, 23, 47, |
641 | | 34, 4, 25, 55, 29, 56, 18, 3, 5, 4, |
642 | | 26, 6, 25, 26, 6, 24, 58, 49, 4, 35, |
643 | | 59, 5, 28, 30, 31, 32, 50, 49, 4, 60, |
644 | | 61, 3, 62, 36, 37, 61 |
645 | | }; |
646 | | |
647 | | /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ |
648 | | static const yytype_uint8 yyr1[] = |
649 | | { |
650 | | 0, 38, 39, 40, 40, 41, 41, 41, 41, 41, |
651 | | 41, 41, 41, 41, 42, 43, 44, 44, 45, 46, |
652 | | 46, 47, 47, 47, 47, 47, 47, 47, 47, 48, |
653 | | 48, 49, 49, 50, 50, 50, 50, 51, 51, 52, |
654 | | 53, 54, 55, 55, 56, 56, 57, 57, 58, 58, |
655 | | 59, 59, 60, 60, 61, 62, 62, 63 |
656 | | }; |
657 | | |
658 | | /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ |
659 | | static const yytype_uint8 yyr2[] = |
660 | | { |
661 | | 0, 2, 2, 1, 0, 1, 1, 1, 1, 1, |
662 | | 1, 1, 1, 1, 1, 2, 1, 3, 2, 2, |
663 | | 0, 2, 1, 1, 1, 1, 2, 1, 1, 5, |
664 | | 6, 2, 0, 1, 1, 1, 1, 2, 3, 5, |
665 | | 6, 2, 1, 0, 1, 0, 2, 0, 2, 0, |
666 | | 3, 0, 1, 3, 2, 1, 0, 1 |
667 | | }; |
668 | | |
669 | | |
670 | | #define yyerrok (yyerrstatus = 0) |
671 | | #define yyclearin (yychar = YYEMPTY) |
672 | 0 | #define YYEMPTY (-2) |
673 | 0 | #define YYEOF 0 |
674 | | |
675 | 0 | #define YYACCEPT goto yyacceptlab |
676 | 0 | #define YYABORT goto yyabortlab |
677 | 0 | #define YYERROR goto yyerrorlab |
678 | | |
679 | | |
680 | | #define YYRECOVERING() (!!yyerrstatus) |
681 | | |
682 | | #define YYBACKUP(Token, Value) \ |
683 | | do \ |
684 | | if (yychar == YYEMPTY) \ |
685 | | { \ |
686 | | yychar = (Token); \ |
687 | | yylval = (Value); \ |
688 | | YYPOPSTACK (yylen); \ |
689 | | yystate = *yyssp; \ |
690 | | goto yybackup; \ |
691 | | } \ |
692 | | else \ |
693 | | { \ |
694 | | yyerror (YY_("syntax error: cannot back up")); \ |
695 | | YYERROR; \ |
696 | | } \ |
697 | | while (0) |
698 | | |
699 | | /* Error token number */ |
700 | 0 | #define YYTERROR 1 |
701 | | #define YYERRCODE 256 |
702 | | |
703 | | |
704 | | |
705 | | /* Enable debugging if requested. */ |
706 | | #if YYDEBUG |
707 | | |
708 | | # ifndef YYFPRINTF |
709 | | # include <stdio.h> /* INFRINGES ON USER NAME SPACE */ |
710 | | # define YYFPRINTF fprintf |
711 | | # endif |
712 | | |
713 | | # define YYDPRINTF(Args) \ |
714 | | do { \ |
715 | | if (yydebug) \ |
716 | | YYFPRINTF Args; \ |
717 | | } while (0) |
718 | | |
719 | | /* This macro is provided for backward compatibility. */ |
720 | | #ifndef YY_LOCATION_PRINT |
721 | | # define YY_LOCATION_PRINT(File, Loc) ((void) 0) |
722 | | #endif |
723 | | |
724 | | |
725 | | # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ |
726 | | do { \ |
727 | | if (yydebug) \ |
728 | | { \ |
729 | | YYFPRINTF (stderr, "%s ", Title); \ |
730 | | yy_symbol_print (stderr, \ |
731 | | Type, Value); \ |
732 | | YYFPRINTF (stderr, "\n"); \ |
733 | | } \ |
734 | | } while (0) |
735 | | |
736 | | |
737 | | /*-----------------------------------. |
738 | | | Print this symbol's value on YYO. | |
739 | | `-----------------------------------*/ |
740 | | |
741 | | static void |
742 | | yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) |
743 | | { |
744 | | FILE *yyoutput = yyo; |
745 | | YYUSE (yyoutput); |
746 | | if (!yyvaluep) |
747 | | return; |
748 | | # ifdef YYPRINT |
749 | | if (yytype < YYNTOKENS) |
750 | | YYPRINT (yyo, yytoknum[yytype], *yyvaluep); |
751 | | # endif |
752 | | YYUSE (yytype); |
753 | | } |
754 | | |
755 | | |
756 | | /*---------------------------. |
757 | | | Print this symbol on YYO. | |
758 | | `---------------------------*/ |
759 | | |
760 | | static void |
761 | | yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) |
762 | | { |
763 | | YYFPRINTF (yyo, "%s %s (", |
764 | | yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); |
765 | | |
766 | | yy_symbol_value_print (yyo, yytype, yyvaluep); |
767 | | YYFPRINTF (yyo, ")"); |
768 | | } |
769 | | |
770 | | /*------------------------------------------------------------------. |
771 | | | yy_stack_print -- Print the state stack from its BOTTOM up to its | |
772 | | | TOP (included). | |
773 | | `------------------------------------------------------------------*/ |
774 | | |
775 | | static void |
776 | | yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) |
777 | | { |
778 | | YYFPRINTF (stderr, "Stack now"); |
779 | | for (; yybottom <= yytop; yybottom++) |
780 | | { |
781 | | int yybot = *yybottom; |
782 | | YYFPRINTF (stderr, " %d", yybot); |
783 | | } |
784 | | YYFPRINTF (stderr, "\n"); |
785 | | } |
786 | | |
787 | | # define YY_STACK_PRINT(Bottom, Top) \ |
788 | | do { \ |
789 | | if (yydebug) \ |
790 | | yy_stack_print ((Bottom), (Top)); \ |
791 | | } while (0) |
792 | | |
793 | | |
794 | | /*------------------------------------------------. |
795 | | | Report that the YYRULE is going to be reduced. | |
796 | | `------------------------------------------------*/ |
797 | | |
798 | | static void |
799 | | yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) |
800 | | { |
801 | | unsigned long yylno = yyrline[yyrule]; |
802 | | int yynrhs = yyr2[yyrule]; |
803 | | int yyi; |
804 | | YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", |
805 | | yyrule - 1, yylno); |
806 | | /* The symbols being reduced. */ |
807 | | for (yyi = 0; yyi < yynrhs; yyi++) |
808 | | { |
809 | | YYFPRINTF (stderr, " $%d = ", yyi + 1); |
810 | | yy_symbol_print (stderr, |
811 | | yystos[yyssp[yyi + 1 - yynrhs]], |
812 | | &yyvsp[(yyi + 1) - (yynrhs)] |
813 | | ); |
814 | | YYFPRINTF (stderr, "\n"); |
815 | | } |
816 | | } |
817 | | |
818 | | # define YY_REDUCE_PRINT(Rule) \ |
819 | | do { \ |
820 | | if (yydebug) \ |
821 | | yy_reduce_print (yyssp, yyvsp, Rule); \ |
822 | | } while (0) |
823 | | |
824 | | /* Nonzero means print parse trace. It is left uninitialized so that |
825 | | multiple parsers can coexist. */ |
826 | | int yydebug; |
827 | | #else /* !YYDEBUG */ |
828 | | # define YYDPRINTF(Args) |
829 | | # define YY_SYMBOL_PRINT(Title, Type, Value, Location) |
830 | | # define YY_STACK_PRINT(Bottom, Top) |
831 | | # define YY_REDUCE_PRINT(Rule) |
832 | | #endif /* !YYDEBUG */ |
833 | | |
834 | | |
835 | | /* YYINITDEPTH -- initial size of the parser's stacks. */ |
836 | | #ifndef YYINITDEPTH |
837 | 0 | # define YYINITDEPTH 200 |
838 | | #endif |
839 | | |
840 | | /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only |
841 | | if the built-in stack extension method is used). |
842 | | |
843 | | Do not make this value too large; the results are undefined if |
844 | | YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) |
845 | | evaluated with infinite-precision integer arithmetic. */ |
846 | | |
847 | | #ifndef YYMAXDEPTH |
848 | 0 | # define YYMAXDEPTH 10000 |
849 | | #endif |
850 | | |
851 | | |
852 | | #if YYERROR_VERBOSE |
853 | | |
854 | | # ifndef yystrlen |
855 | | # if defined __GLIBC__ && defined _STRING_H |
856 | | # define yystrlen strlen |
857 | | # else |
858 | | /* Return the length of YYSTR. */ |
859 | | static YYSIZE_T |
860 | | yystrlen (const char *yystr) |
861 | | { |
862 | | YYSIZE_T yylen; |
863 | | for (yylen = 0; yystr[yylen]; yylen++) |
864 | | continue; |
865 | | return yylen; |
866 | | } |
867 | | # endif |
868 | | # endif |
869 | | |
870 | | # ifndef yystpcpy |
871 | | # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE |
872 | | # define yystpcpy stpcpy |
873 | | # else |
874 | | /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in |
875 | | YYDEST. */ |
876 | | static char * |
877 | | yystpcpy (char *yydest, const char *yysrc) |
878 | | { |
879 | | char *yyd = yydest; |
880 | | const char *yys = yysrc; |
881 | | |
882 | | while ((*yyd++ = *yys++) != '\0') |
883 | | continue; |
884 | | |
885 | | return yyd - 1; |
886 | | } |
887 | | # endif |
888 | | # endif |
889 | | |
890 | | # ifndef yytnamerr |
891 | | /* Copy to YYRES the contents of YYSTR after stripping away unnecessary |
892 | | quotes and backslashes, so that it's suitable for yyerror. The |
893 | | heuristic is that double-quoting is unnecessary unless the string |
894 | | contains an apostrophe, a comma, or backslash (other than |
895 | | backslash-backslash). YYSTR is taken from yytname. If YYRES is |
896 | | null, do not copy; instead, return the length of what the result |
897 | | would have been. */ |
898 | | static YYSIZE_T |
899 | | yytnamerr (char *yyres, const char *yystr) |
900 | | { |
901 | | if (*yystr == '"') |
902 | | { |
903 | | YYSIZE_T yyn = 0; |
904 | | char const *yyp = yystr; |
905 | | |
906 | | for (;;) |
907 | | switch (*++yyp) |
908 | | { |
909 | | case '\'': |
910 | | case ',': |
911 | | goto do_not_strip_quotes; |
912 | | |
913 | | case '\\': |
914 | | if (*++yyp != '\\') |
915 | | goto do_not_strip_quotes; |
916 | | else |
917 | | goto append; |
918 | | |
919 | | append: |
920 | | default: |
921 | | if (yyres) |
922 | | yyres[yyn] = *yyp; |
923 | | yyn++; |
924 | | break; |
925 | | |
926 | | case '"': |
927 | | if (yyres) |
928 | | yyres[yyn] = '\0'; |
929 | | return yyn; |
930 | | } |
931 | | do_not_strip_quotes: ; |
932 | | } |
933 | | |
934 | | if (! yyres) |
935 | | return yystrlen (yystr); |
936 | | |
937 | | return (YYSIZE_T) (yystpcpy (yyres, yystr) - yyres); |
938 | | } |
939 | | # endif |
940 | | |
941 | | /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message |
942 | | about the unexpected token YYTOKEN for the state stack whose top is |
943 | | YYSSP. |
944 | | |
945 | | Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is |
946 | | not large enough to hold the message. In that case, also set |
947 | | *YYMSG_ALLOC to the required number of bytes. Return 2 if the |
948 | | required number of bytes is too large to store. */ |
949 | | static int |
950 | | yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, |
951 | | yytype_int16 *yyssp, int yytoken) |
952 | | { |
953 | | YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); |
954 | | YYSIZE_T yysize = yysize0; |
955 | | enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; |
956 | | /* Internationalized format string. */ |
957 | | const char *yyformat = YY_NULLPTR; |
958 | | /* Arguments of yyformat. */ |
959 | | char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; |
960 | | /* Number of reported tokens (one for the "unexpected", one per |
961 | | "expected"). */ |
962 | | int yycount = 0; |
963 | | |
964 | | /* There are many possibilities here to consider: |
965 | | - If this state is a consistent state with a default action, then |
966 | | the only way this function was invoked is if the default action |
967 | | is an error action. In that case, don't check for expected |
968 | | tokens because there are none. |
969 | | - The only way there can be no lookahead present (in yychar) is if |
970 | | this state is a consistent state with a default action. Thus, |
971 | | detecting the absence of a lookahead is sufficient to determine |
972 | | that there is no unexpected or expected token to report. In that |
973 | | case, just report a simple "syntax error". |
974 | | - Don't assume there isn't a lookahead just because this state is a |
975 | | consistent state with a default action. There might have been a |
976 | | previous inconsistent state, consistent state with a non-default |
977 | | action, or user semantic action that manipulated yychar. |
978 | | - Of course, the expected token list depends on states to have |
979 | | correct lookahead information, and it depends on the parser not |
980 | | to perform extra reductions after fetching a lookahead from the |
981 | | scanner and before detecting a syntax error. Thus, state merging |
982 | | (from LALR or IELR) and default reductions corrupt the expected |
983 | | token list. However, the list is correct for canonical LR with |
984 | | one exception: it will still contain any token that will not be |
985 | | accepted due to an error action in a later state. |
986 | | */ |
987 | | if (yytoken != YYEMPTY) |
988 | | { |
989 | | int yyn = yypact[*yyssp]; |
990 | | yyarg[yycount++] = yytname[yytoken]; |
991 | | if (!yypact_value_is_default (yyn)) |
992 | | { |
993 | | /* Start YYX at -YYN if negative to avoid negative indexes in |
994 | | YYCHECK. In other words, skip the first -YYN actions for |
995 | | this state because they are default actions. */ |
996 | | int yyxbegin = yyn < 0 ? -yyn : 0; |
997 | | /* Stay within bounds of both yycheck and yytname. */ |
998 | | int yychecklim = YYLAST - yyn + 1; |
999 | | int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; |
1000 | | int yyx; |
1001 | | |
1002 | | for (yyx = yyxbegin; yyx < yyxend; ++yyx) |
1003 | | if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR |
1004 | | && !yytable_value_is_error (yytable[yyx + yyn])) |
1005 | | { |
1006 | | if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) |
1007 | | { |
1008 | | yycount = 1; |
1009 | | yysize = yysize0; |
1010 | | break; |
1011 | | } |
1012 | | yyarg[yycount++] = yytname[yyx]; |
1013 | | { |
1014 | | YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); |
1015 | | if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) |
1016 | | yysize = yysize1; |
1017 | | else |
1018 | | return 2; |
1019 | | } |
1020 | | } |
1021 | | } |
1022 | | } |
1023 | | |
1024 | | switch (yycount) |
1025 | | { |
1026 | | # define YYCASE_(N, S) \ |
1027 | | case N: \ |
1028 | | yyformat = S; \ |
1029 | | break |
1030 | | default: /* Avoid compiler warnings. */ |
1031 | | YYCASE_(0, YY_("syntax error")); |
1032 | | YYCASE_(1, YY_("syntax error, unexpected %s")); |
1033 | | YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); |
1034 | | YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); |
1035 | | YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); |
1036 | | YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); |
1037 | | # undef YYCASE_ |
1038 | | } |
1039 | | |
1040 | | { |
1041 | | YYSIZE_T yysize1 = yysize + yystrlen (yyformat); |
1042 | | if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) |
1043 | | yysize = yysize1; |
1044 | | else |
1045 | | return 2; |
1046 | | } |
1047 | | |
1048 | | if (*yymsg_alloc < yysize) |
1049 | | { |
1050 | | *yymsg_alloc = 2 * yysize; |
1051 | | if (! (yysize <= *yymsg_alloc |
1052 | | && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) |
1053 | | *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; |
1054 | | return 1; |
1055 | | } |
1056 | | |
1057 | | /* Avoid sprintf, as that infringes on the user's name space. |
1058 | | Don't have undefined behavior even if the translation |
1059 | | produced a string with the wrong number of "%s"s. */ |
1060 | | { |
1061 | | char *yyp = *yymsg; |
1062 | | int yyi = 0; |
1063 | | while ((*yyp = *yyformat) != '\0') |
1064 | | if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) |
1065 | | { |
1066 | | yyp += yytnamerr (yyp, yyarg[yyi++]); |
1067 | | yyformat += 2; |
1068 | | } |
1069 | | else |
1070 | | { |
1071 | | yyp++; |
1072 | | yyformat++; |
1073 | | } |
1074 | | } |
1075 | | return 0; |
1076 | | } |
1077 | | #endif /* YYERROR_VERBOSE */ |
1078 | | |
1079 | | /*-----------------------------------------------. |
1080 | | | Release the memory associated to this symbol. | |
1081 | | `-----------------------------------------------*/ |
1082 | | |
1083 | | static void |
1084 | | yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) |
1085 | 0 | { |
1086 | 0 | YYUSE (yyvaluep); |
1087 | 0 | if (!yymsg) |
1088 | 0 | yymsg = "Deleting"; |
1089 | 0 | YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); |
1090 | |
|
1091 | 0 | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
1092 | 0 | YYUSE (yytype); |
1093 | 0 | YY_IGNORE_MAYBE_UNINITIALIZED_END |
1094 | 0 | } |
1095 | | |
1096 | | |
1097 | | |
1098 | | |
1099 | | /* The lookahead symbol. */ |
1100 | | int yychar; |
1101 | | |
1102 | | /* The semantic value of the lookahead symbol. */ |
1103 | | YYSTYPE yylval; |
1104 | | /* Number of syntax errors so far. */ |
1105 | | int yynerrs; |
1106 | | |
1107 | | |
1108 | | /*----------. |
1109 | | | yyparse. | |
1110 | | `----------*/ |
1111 | | |
1112 | | int |
1113 | | yyparse (void) |
1114 | 0 | { |
1115 | 0 | int yystate; |
1116 | | /* Number of tokens to shift before error messages enabled. */ |
1117 | 0 | int yyerrstatus; |
1118 | | |
1119 | | /* The stacks and their tools: |
1120 | | 'yyss': related to states. |
1121 | | 'yyvs': related to semantic values. |
1122 | | |
1123 | | Refer to the stacks through separate pointers, to allow yyoverflow |
1124 | | to reallocate them elsewhere. */ |
1125 | | |
1126 | | /* The state stack. */ |
1127 | 0 | yytype_int16 yyssa[YYINITDEPTH]; |
1128 | 0 | yytype_int16 *yyss; |
1129 | 0 | yytype_int16 *yyssp; |
1130 | | |
1131 | | /* The semantic value stack. */ |
1132 | 0 | YYSTYPE yyvsa[YYINITDEPTH]; |
1133 | 0 | YYSTYPE *yyvs; |
1134 | 0 | YYSTYPE *yyvsp; |
1135 | |
|
1136 | 0 | YYSIZE_T yystacksize; |
1137 | |
|
1138 | 0 | int yyn; |
1139 | 0 | int yyresult; |
1140 | | /* Lookahead token as an internal (translated) token number. */ |
1141 | 0 | int yytoken = 0; |
1142 | | /* The variables used to return semantic value and location from the |
1143 | | action routines. */ |
1144 | 0 | YYSTYPE yyval; |
1145 | |
|
1146 | | #if YYERROR_VERBOSE |
1147 | | /* Buffer for error messages, and its allocated size. */ |
1148 | | char yymsgbuf[128]; |
1149 | | char *yymsg = yymsgbuf; |
1150 | | YYSIZE_T yymsg_alloc = sizeof yymsgbuf; |
1151 | | #endif |
1152 | |
|
1153 | 0 | #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) |
1154 | | |
1155 | | /* The number of symbols on the RHS of the reduced rule. |
1156 | | Keep to zero when no symbol should be popped. */ |
1157 | 0 | int yylen = 0; |
1158 | |
|
1159 | 0 | yyssp = yyss = yyssa; |
1160 | 0 | yyvsp = yyvs = yyvsa; |
1161 | 0 | yystacksize = YYINITDEPTH; |
1162 | |
|
1163 | 0 | YYDPRINTF ((stderr, "Starting parse\n")); |
1164 | |
|
1165 | 0 | yystate = 0; |
1166 | 0 | yyerrstatus = 0; |
1167 | 0 | yynerrs = 0; |
1168 | 0 | yychar = YYEMPTY; /* Cause a token to be read. */ |
1169 | 0 | goto yysetstate; |
1170 | | |
1171 | | |
1172 | | /*------------------------------------------------------------. |
1173 | | | yynewstate -- push a new state, which is found in yystate. | |
1174 | | `------------------------------------------------------------*/ |
1175 | 0 | yynewstate: |
1176 | | /* In all cases, when you get here, the value and location stacks |
1177 | | have just been pushed. So pushing a state here evens the stacks. */ |
1178 | 0 | yyssp++; |
1179 | | |
1180 | | |
1181 | | /*--------------------------------------------------------------------. |
1182 | | | yynewstate -- set current state (the top of the stack) to yystate. | |
1183 | | `--------------------------------------------------------------------*/ |
1184 | 0 | yysetstate: |
1185 | 0 | YYDPRINTF ((stderr, "Entering state %d\n", yystate)); |
1186 | 0 | YY_ASSERT (0 <= yystate && yystate < YYNSTATES); |
1187 | 0 | *yyssp = (yytype_int16) yystate; |
1188 | |
|
1189 | 0 | if (yyss + yystacksize - 1 <= yyssp) |
1190 | | #if !defined yyoverflow && !defined YYSTACK_RELOCATE |
1191 | | goto yyexhaustedlab; |
1192 | | #else |
1193 | 0 | { |
1194 | | /* Get the current used size of the three stacks, in elements. */ |
1195 | 0 | YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1); |
1196 | |
|
1197 | | # if defined yyoverflow |
1198 | | { |
1199 | | /* Give user a chance to reallocate the stack. Use copies of |
1200 | | these so that the &'s don't force the real ones into |
1201 | | memory. */ |
1202 | | YYSTYPE *yyvs1 = yyvs; |
1203 | | yytype_int16 *yyss1 = yyss; |
1204 | | |
1205 | | /* Each stack pointer address is followed by the size of the |
1206 | | data in use in that stack, in bytes. This used to be a |
1207 | | conditional around just the two extra args, but that might |
1208 | | be undefined if yyoverflow is a macro. */ |
1209 | | yyoverflow (YY_("memory exhausted"), |
1210 | | &yyss1, yysize * sizeof (*yyssp), |
1211 | | &yyvs1, yysize * sizeof (*yyvsp), |
1212 | | &yystacksize); |
1213 | | yyss = yyss1; |
1214 | | yyvs = yyvs1; |
1215 | | } |
1216 | | # else /* defined YYSTACK_RELOCATE */ |
1217 | | /* Extend the stack our own way. */ |
1218 | 0 | if (YYMAXDEPTH <= yystacksize) |
1219 | 0 | goto yyexhaustedlab; |
1220 | 0 | yystacksize *= 2; |
1221 | 0 | if (YYMAXDEPTH < yystacksize) |
1222 | 0 | yystacksize = YYMAXDEPTH; |
1223 | |
|
1224 | 0 | { |
1225 | 0 | yytype_int16 *yyss1 = yyss; |
1226 | 0 | union yyalloc *yyptr = |
1227 | 0 | (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); |
1228 | 0 | if (! yyptr) |
1229 | 0 | goto yyexhaustedlab; |
1230 | 0 | YYSTACK_RELOCATE (yyss_alloc, yyss); |
1231 | 0 | YYSTACK_RELOCATE (yyvs_alloc, yyvs); |
1232 | 0 | # undef YYSTACK_RELOCATE |
1233 | 0 | if (yyss1 != yyssa) |
1234 | 0 | YYSTACK_FREE (yyss1); |
1235 | 0 | } |
1236 | 0 | # endif |
1237 | | |
1238 | 0 | yyssp = yyss + yysize - 1; |
1239 | 0 | yyvsp = yyvs + yysize - 1; |
1240 | |
|
1241 | 0 | YYDPRINTF ((stderr, "Stack size increased to %lu\n", |
1242 | 0 | (unsigned long) yystacksize)); |
1243 | |
|
1244 | 0 | if (yyss + yystacksize - 1 <= yyssp) |
1245 | 0 | YYABORT; |
1246 | 0 | } |
1247 | 0 | #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ |
1248 | | |
1249 | 0 | if (yystate == YYFINAL) |
1250 | 0 | YYACCEPT; |
1251 | | |
1252 | 0 | goto yybackup; |
1253 | | |
1254 | | |
1255 | | /*-----------. |
1256 | | | yybackup. | |
1257 | | `-----------*/ |
1258 | 0 | yybackup: |
1259 | | /* Do appropriate processing given the current state. Read a |
1260 | | lookahead token if we need one and don't already have one. */ |
1261 | | |
1262 | | /* First try to decide what to do without reference to lookahead token. */ |
1263 | 0 | yyn = yypact[yystate]; |
1264 | 0 | if (yypact_value_is_default (yyn)) |
1265 | 0 | goto yydefault; |
1266 | | |
1267 | | /* Not known => get a lookahead token if don't already have one. */ |
1268 | | |
1269 | | /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ |
1270 | 0 | if (yychar == YYEMPTY) |
1271 | 0 | { |
1272 | 0 | YYDPRINTF ((stderr, "Reading a token: ")); |
1273 | 0 | yychar = yylex (); |
1274 | 0 | } |
1275 | |
|
1276 | 0 | if (yychar <= YYEOF) |
1277 | 0 | { |
1278 | 0 | yychar = yytoken = YYEOF; |
1279 | 0 | YYDPRINTF ((stderr, "Now at end of input.\n")); |
1280 | 0 | } |
1281 | 0 | else |
1282 | 0 | { |
1283 | 0 | yytoken = YYTRANSLATE (yychar); |
1284 | 0 | YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); |
1285 | 0 | } |
1286 | | |
1287 | | /* If the proper action on seeing token YYTOKEN is to reduce or to |
1288 | | detect an error, take that action. */ |
1289 | 0 | yyn += yytoken; |
1290 | 0 | if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) |
1291 | 0 | goto yydefault; |
1292 | 0 | yyn = yytable[yyn]; |
1293 | 0 | if (yyn <= 0) |
1294 | 0 | { |
1295 | 0 | if (yytable_value_is_error (yyn)) |
1296 | 0 | goto yyerrlab; |
1297 | 0 | yyn = -yyn; |
1298 | 0 | goto yyreduce; |
1299 | 0 | } |
1300 | | |
1301 | | /* Count tokens shifted since error; after three, turn off error |
1302 | | status. */ |
1303 | 0 | if (yyerrstatus) |
1304 | 0 | yyerrstatus--; |
1305 | | |
1306 | | /* Shift the lookahead token. */ |
1307 | 0 | YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); |
1308 | | |
1309 | | /* Discard the shifted token. */ |
1310 | 0 | yychar = YYEMPTY; |
1311 | |
|
1312 | 0 | yystate = yyn; |
1313 | 0 | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
1314 | 0 | *++yyvsp = yylval; |
1315 | 0 | YY_IGNORE_MAYBE_UNINITIALIZED_END |
1316 | 0 | goto yynewstate; |
1317 | | |
1318 | | |
1319 | | /*-----------------------------------------------------------. |
1320 | | | yydefault -- do the default action for the current state. | |
1321 | | `-----------------------------------------------------------*/ |
1322 | 0 | yydefault: |
1323 | 0 | yyn = yydefact[yystate]; |
1324 | 0 | if (yyn == 0) |
1325 | 0 | goto yyerrlab; |
1326 | 0 | goto yyreduce; |
1327 | | |
1328 | | |
1329 | | /*-----------------------------. |
1330 | | | yyreduce -- do a reduction. | |
1331 | | `-----------------------------*/ |
1332 | 0 | yyreduce: |
1333 | | /* yyn is the number of a rule to reduce with. */ |
1334 | 0 | yylen = yyr2[yyn]; |
1335 | | |
1336 | | /* If YYLEN is nonzero, implement the default value of the action: |
1337 | | '$$ = $1'. |
1338 | | |
1339 | | Otherwise, the following line sets YYVAL to garbage. |
1340 | | This behavior is undocumented and Bison |
1341 | | users should not rely upon it. Assigning to YYVAL |
1342 | | unconditionally makes the parser a bit smaller, and it avoids a |
1343 | | GCC warning that YYVAL may be used uninitialized. */ |
1344 | 0 | yyval = yyvsp[1-yylen]; |
1345 | | |
1346 | |
|
1347 | 0 | YY_REDUCE_PRINT (yyn); |
1348 | 0 | switch (yyn) |
1349 | 0 | { |
1350 | 0 | case 2: |
1351 | 0 | #line 109 "repl_gram.y" |
1352 | 0 | { |
1353 | 0 | replication_parse_result = (yyvsp[-1].node); |
1354 | 0 | } |
1355 | 0 | #line 1356 "repl_gram.c" |
1356 | 0 | break; |
1357 | | |
1358 | 0 | case 14: |
1359 | 0 | #line 135 "repl_gram.y" |
1360 | 0 | { |
1361 | 0 | (yyval.node) = (Node *) makeNode(IdentifySystemCmd); |
1362 | 0 | } |
1363 | 0 | #line 1364 "repl_gram.c" |
1364 | 0 | break; |
1365 | | |
1366 | 0 | case 15: |
1367 | 0 | #line 145 "repl_gram.y" |
1368 | 0 | { |
1369 | 0 | VariableShowStmt *n = makeNode(VariableShowStmt); |
1370 | 0 | n->name = (yyvsp[0].str); |
1371 | 0 | (yyval.node) = (Node *) n; |
1372 | 0 | } |
1373 | 0 | #line 1374 "repl_gram.c" |
1374 | 0 | break; |
1375 | | |
1376 | 0 | case 16: |
1377 | 0 | #line 151 "repl_gram.y" |
1378 | 0 | { (yyval.str) = (yyvsp[0].str); } |
1379 | 0 | #line 1380 "repl_gram.c" |
1380 | 0 | break; |
1381 | | |
1382 | 0 | case 17: |
1383 | 0 | #line 153 "repl_gram.y" |
1384 | 0 | { (yyval.str) = psprintf("%s.%s", (yyvsp[-2].str), (yyvsp[0].str)); } |
1385 | 0 | #line 1386 "repl_gram.c" |
1386 | 0 | break; |
1387 | | |
1388 | 0 | case 18: |
1389 | 0 | #line 162 "repl_gram.y" |
1390 | 0 | { |
1391 | 0 | BaseBackupCmd *cmd = makeNode(BaseBackupCmd); |
1392 | 0 | cmd->options = (yyvsp[0].list); |
1393 | 0 | (yyval.node) = (Node *) cmd; |
1394 | 0 | } |
1395 | 0 | #line 1396 "repl_gram.c" |
1396 | 0 | break; |
1397 | | |
1398 | 0 | case 19: |
1399 | 0 | #line 171 "repl_gram.y" |
1400 | 0 | { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } |
1401 | 0 | #line 1402 "repl_gram.c" |
1402 | 0 | break; |
1403 | | |
1404 | 0 | case 20: |
1405 | 0 | #line 173 "repl_gram.y" |
1406 | 0 | { (yyval.list) = NIL; } |
1407 | 0 | #line 1408 "repl_gram.c" |
1408 | 0 | break; |
1409 | | |
1410 | 0 | case 21: |
1411 | 0 | #line 178 "repl_gram.y" |
1412 | 0 | { |
1413 | 0 | (yyval.defelt) = makeDefElem("label", |
1414 | 0 | (Node *)makeString((yyvsp[0].str)), -1); |
1415 | 0 | } |
1416 | 0 | #line 1417 "repl_gram.c" |
1417 | 0 | break; |
1418 | | |
1419 | 0 | case 22: |
1420 | 0 | #line 183 "repl_gram.y" |
1421 | 0 | { |
1422 | 0 | (yyval.defelt) = makeDefElem("progress", |
1423 | 0 | (Node *)makeInteger(true), -1); |
1424 | 0 | } |
1425 | 0 | #line 1426 "repl_gram.c" |
1426 | 0 | break; |
1427 | | |
1428 | 0 | case 23: |
1429 | 0 | #line 188 "repl_gram.y" |
1430 | 0 | { |
1431 | 0 | (yyval.defelt) = makeDefElem("fast", |
1432 | 0 | (Node *)makeInteger(true), -1); |
1433 | 0 | } |
1434 | 0 | #line 1435 "repl_gram.c" |
1435 | 0 | break; |
1436 | | |
1437 | 0 | case 24: |
1438 | 0 | #line 193 "repl_gram.y" |
1439 | 0 | { |
1440 | 0 | (yyval.defelt) = makeDefElem("wal", |
1441 | 0 | (Node *)makeInteger(true), -1); |
1442 | 0 | } |
1443 | 0 | #line 1444 "repl_gram.c" |
1444 | 0 | break; |
1445 | | |
1446 | 0 | case 25: |
1447 | 0 | #line 198 "repl_gram.y" |
1448 | 0 | { |
1449 | 0 | (yyval.defelt) = makeDefElem("nowait", |
1450 | 0 | (Node *)makeInteger(true), -1); |
1451 | 0 | } |
1452 | 0 | #line 1453 "repl_gram.c" |
1453 | 0 | break; |
1454 | | |
1455 | 0 | case 26: |
1456 | 0 | #line 203 "repl_gram.y" |
1457 | 0 | { |
1458 | 0 | (yyval.defelt) = makeDefElem("max_rate", |
1459 | 0 | (Node *)makeInteger((yyvsp[0].uintval)), -1); |
1460 | 0 | } |
1461 | 0 | #line 1462 "repl_gram.c" |
1462 | 0 | break; |
1463 | | |
1464 | 0 | case 27: |
1465 | 0 | #line 208 "repl_gram.y" |
1466 | 0 | { |
1467 | 0 | (yyval.defelt) = makeDefElem("tablespace_map", |
1468 | 0 | (Node *)makeInteger(true), -1); |
1469 | 0 | } |
1470 | 0 | #line 1471 "repl_gram.c" |
1471 | 0 | break; |
1472 | | |
1473 | 0 | case 28: |
1474 | 0 | #line 213 "repl_gram.y" |
1475 | 0 | { |
1476 | 0 | (yyval.defelt) = makeDefElem("noverify_checksums", |
1477 | 0 | (Node *)makeInteger(true), -1); |
1478 | 0 | } |
1479 | 0 | #line 1480 "repl_gram.c" |
1480 | 0 | break; |
1481 | | |
1482 | 0 | case 29: |
1483 | 0 | #line 222 "repl_gram.y" |
1484 | 0 | { |
1485 | 0 | CreateReplicationSlotCmd *cmd; |
1486 | 0 | cmd = makeNode(CreateReplicationSlotCmd); |
1487 | 0 | cmd->kind = REPLICATION_KIND_PHYSICAL; |
1488 | 0 | cmd->slotname = (yyvsp[-3].str); |
1489 | 0 | cmd->temporary = (yyvsp[-2].boolval); |
1490 | 0 | cmd->options = (yyvsp[0].list); |
1491 | 0 | (yyval.node) = (Node *) cmd; |
1492 | 0 | } |
1493 | 0 | #line 1494 "repl_gram.c" |
1494 | 0 | break; |
1495 | | |
1496 | 0 | case 30: |
1497 | 0 | #line 233 "repl_gram.y" |
1498 | 0 | { |
1499 | 0 | CreateReplicationSlotCmd *cmd; |
1500 | 0 | cmd = makeNode(CreateReplicationSlotCmd); |
1501 | 0 | cmd->kind = REPLICATION_KIND_LOGICAL; |
1502 | 0 | cmd->slotname = (yyvsp[-4].str); |
1503 | 0 | cmd->temporary = (yyvsp[-3].boolval); |
1504 | 0 | cmd->plugin = (yyvsp[-1].str); |
1505 | 0 | cmd->options = (yyvsp[0].list); |
1506 | 0 | (yyval.node) = (Node *) cmd; |
1507 | 0 | } |
1508 | 0 | #line 1509 "repl_gram.c" |
1509 | 0 | break; |
1510 | | |
1511 | 0 | case 31: |
1512 | 0 | #line 247 "repl_gram.y" |
1513 | 0 | { (yyval.list) = lappend((yyvsp[-1].list), (yyvsp[0].defelt)); } |
1514 | 0 | #line 1515 "repl_gram.c" |
1515 | 0 | break; |
1516 | | |
1517 | 0 | case 32: |
1518 | 0 | #line 249 "repl_gram.y" |
1519 | 0 | { (yyval.list) = NIL; } |
1520 | 0 | #line 1521 "repl_gram.c" |
1521 | 0 | break; |
1522 | | |
1523 | 0 | case 33: |
1524 | 0 | #line 254 "repl_gram.y" |
1525 | 0 | { |
1526 | 0 | (yyval.defelt) = makeDefElem("export_snapshot", |
1527 | 0 | (Node *)makeInteger(true), -1); |
1528 | 0 | } |
1529 | 0 | #line 1530 "repl_gram.c" |
1530 | 0 | break; |
1531 | | |
1532 | 0 | case 34: |
1533 | 0 | #line 259 "repl_gram.y" |
1534 | 0 | { |
1535 | 0 | (yyval.defelt) = makeDefElem("export_snapshot", |
1536 | 0 | (Node *)makeInteger(false), -1); |
1537 | 0 | } |
1538 | 0 | #line 1539 "repl_gram.c" |
1539 | 0 | break; |
1540 | | |
1541 | 0 | case 35: |
1542 | 0 | #line 264 "repl_gram.y" |
1543 | 0 | { |
1544 | 0 | (yyval.defelt) = makeDefElem("use_snapshot", |
1545 | 0 | (Node *)makeInteger(true), -1); |
1546 | 0 | } |
1547 | 0 | #line 1548 "repl_gram.c" |
1548 | 0 | break; |
1549 | | |
1550 | 0 | case 36: |
1551 | 0 | #line 269 "repl_gram.y" |
1552 | 0 | { |
1553 | 0 | (yyval.defelt) = makeDefElem("reserve_wal", |
1554 | 0 | (Node *)makeInteger(true), -1); |
1555 | 0 | } |
1556 | 0 | #line 1557 "repl_gram.c" |
1557 | 0 | break; |
1558 | | |
1559 | 0 | case 37: |
1560 | 0 | #line 278 "repl_gram.y" |
1561 | 0 | { |
1562 | 0 | DropReplicationSlotCmd *cmd; |
1563 | 0 | cmd = makeNode(DropReplicationSlotCmd); |
1564 | 0 | cmd->slotname = (yyvsp[0].str); |
1565 | 0 | cmd->wait = false; |
1566 | 0 | (yyval.node) = (Node *) cmd; |
1567 | 0 | } |
1568 | 0 | #line 1569 "repl_gram.c" |
1569 | 0 | break; |
1570 | | |
1571 | 0 | case 38: |
1572 | 0 | #line 286 "repl_gram.y" |
1573 | 0 | { |
1574 | 0 | DropReplicationSlotCmd *cmd; |
1575 | 0 | cmd = makeNode(DropReplicationSlotCmd); |
1576 | 0 | cmd->slotname = (yyvsp[-1].str); |
1577 | 0 | cmd->wait = true; |
1578 | 0 | (yyval.node) = (Node *) cmd; |
1579 | 0 | } |
1580 | 0 | #line 1581 "repl_gram.c" |
1581 | 0 | break; |
1582 | | |
1583 | 0 | case 39: |
1584 | 0 | #line 300 "repl_gram.y" |
1585 | 0 | { |
1586 | 0 | StartReplicationCmd *cmd; |
1587 | |
|
1588 | 0 | cmd = makeNode(StartReplicationCmd); |
1589 | 0 | cmd->kind = REPLICATION_KIND_PHYSICAL; |
1590 | 0 | cmd->slotname = (yyvsp[-3].str); |
1591 | 0 | cmd->startpoint = (yyvsp[-1].recptr); |
1592 | 0 | cmd->timeline = (yyvsp[0].uintval); |
1593 | 0 | (yyval.node) = (Node *) cmd; |
1594 | 0 | } |
1595 | 0 | #line 1596 "repl_gram.c" |
1596 | 0 | break; |
1597 | | |
1598 | 0 | case 40: |
1599 | 0 | #line 315 "repl_gram.y" |
1600 | 0 | { |
1601 | 0 | StartReplicationCmd *cmd; |
1602 | 0 | cmd = makeNode(StartReplicationCmd); |
1603 | 0 | cmd->kind = REPLICATION_KIND_LOGICAL; |
1604 | 0 | cmd->slotname = (yyvsp[-3].str); |
1605 | 0 | cmd->startpoint = (yyvsp[-1].recptr); |
1606 | 0 | cmd->options = (yyvsp[0].list); |
1607 | 0 | (yyval.node) = (Node *) cmd; |
1608 | 0 | } |
1609 | 0 | #line 1610 "repl_gram.c" |
1610 | 0 | break; |
1611 | | |
1612 | 0 | case 41: |
1613 | 0 | #line 330 "repl_gram.y" |
1614 | 0 | { |
1615 | 0 | TimeLineHistoryCmd *cmd; |
1616 | |
|
1617 | 0 | if ((yyvsp[0].uintval) <= 0) |
1618 | 0 | ereport(ERROR, |
1619 | 0 | (errcode(ERRCODE_SYNTAX_ERROR), |
1620 | 0 | (errmsg("invalid timeline %u", (yyvsp[0].uintval))))); |
1621 | | |
1622 | 0 | cmd = makeNode(TimeLineHistoryCmd); |
1623 | 0 | cmd->timeline = (yyvsp[0].uintval); |
1624 | |
|
1625 | 0 | (yyval.node) = (Node *) cmd; |
1626 | 0 | } |
1627 | 0 | #line 1628 "repl_gram.c" |
1628 | 0 | break; |
1629 | | |
1630 | 0 | case 44: |
1631 | 0 | #line 351 "repl_gram.y" |
1632 | 0 | { (yyval.boolval) = true; } |
1633 | 0 | #line 1634 "repl_gram.c" |
1634 | 0 | break; |
1635 | | |
1636 | 0 | case 45: |
1637 | 0 | #line 352 "repl_gram.y" |
1638 | 0 | { (yyval.boolval) = false; } |
1639 | 0 | #line 1640 "repl_gram.c" |
1640 | 0 | break; |
1641 | | |
1642 | 0 | case 46: |
1643 | 0 | #line 357 "repl_gram.y" |
1644 | 0 | { (yyval.str) = (yyvsp[0].str); } |
1645 | 0 | #line 1646 "repl_gram.c" |
1646 | 0 | break; |
1647 | | |
1648 | 0 | case 47: |
1649 | 0 | #line 359 "repl_gram.y" |
1650 | 0 | { (yyval.str) = NULL; } |
1651 | 0 | #line 1652 "repl_gram.c" |
1652 | 0 | break; |
1653 | | |
1654 | 0 | case 48: |
1655 | 0 | #line 364 "repl_gram.y" |
1656 | 0 | { |
1657 | 0 | if ((yyvsp[0].uintval) <= 0) |
1658 | 0 | ereport(ERROR, |
1659 | 0 | (errcode(ERRCODE_SYNTAX_ERROR), |
1660 | 0 | (errmsg("invalid timeline %u", (yyvsp[0].uintval))))); |
1661 | 0 | (yyval.uintval) = (yyvsp[0].uintval); |
1662 | 0 | } |
1663 | 0 | #line 1664 "repl_gram.c" |
1664 | 0 | break; |
1665 | | |
1666 | 0 | case 49: |
1667 | 0 | #line 371 "repl_gram.y" |
1668 | 0 | { (yyval.uintval) = 0; } |
1669 | 0 | #line 1670 "repl_gram.c" |
1670 | 0 | break; |
1671 | | |
1672 | 0 | case 50: |
1673 | 0 | #line 376 "repl_gram.y" |
1674 | 0 | { (yyval.list) = (yyvsp[-1].list); } |
1675 | 0 | #line 1676 "repl_gram.c" |
1676 | 0 | break; |
1677 | | |
1678 | 0 | case 51: |
1679 | 0 | #line 377 "repl_gram.y" |
1680 | 0 | { (yyval.list) = NIL; } |
1681 | 0 | #line 1682 "repl_gram.c" |
1682 | 0 | break; |
1683 | | |
1684 | 0 | case 52: |
1685 | 0 | #line 382 "repl_gram.y" |
1686 | 0 | { |
1687 | 0 | (yyval.list) = list_make1((yyvsp[0].defelt)); |
1688 | 0 | } |
1689 | 0 | #line 1690 "repl_gram.c" |
1690 | 0 | break; |
1691 | | |
1692 | 0 | case 53: |
1693 | 0 | #line 386 "repl_gram.y" |
1694 | 0 | { |
1695 | 0 | (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].defelt)); |
1696 | 0 | } |
1697 | 0 | #line 1698 "repl_gram.c" |
1698 | 0 | break; |
1699 | | |
1700 | 0 | case 54: |
1701 | 0 | #line 393 "repl_gram.y" |
1702 | 0 | { |
1703 | 0 | (yyval.defelt) = makeDefElem((yyvsp[-1].str), (yyvsp[0].node), -1); |
1704 | 0 | } |
1705 | 0 | #line 1706 "repl_gram.c" |
1706 | 0 | break; |
1707 | | |
1708 | 0 | case 55: |
1709 | 0 | #line 399 "repl_gram.y" |
1710 | 0 | { (yyval.node) = (Node *) makeString((yyvsp[0].str)); } |
1711 | 0 | #line 1712 "repl_gram.c" |
1712 | 0 | break; |
1713 | | |
1714 | 0 | case 56: |
1715 | 0 | #line 400 "repl_gram.y" |
1716 | 0 | { (yyval.node) = NULL; } |
1717 | 0 | #line 1718 "repl_gram.c" |
1718 | 0 | break; |
1719 | | |
1720 | 0 | case 57: |
1721 | 0 | #line 404 "repl_gram.y" |
1722 | 0 | { (yyval.node) = (Node *) make_sqlcmd(); } |
1723 | 0 | #line 1724 "repl_gram.c" |
1724 | 0 | break; |
1725 | | |
1726 | | |
1727 | 0 | #line 1728 "repl_gram.c" |
1728 | | |
1729 | 0 | default: break; |
1730 | 0 | } |
1731 | | /* User semantic actions sometimes alter yychar, and that requires |
1732 | | that yytoken be updated with the new translation. We take the |
1733 | | approach of translating immediately before every use of yytoken. |
1734 | | One alternative is translating here after every semantic action, |
1735 | | but that translation would be missed if the semantic action invokes |
1736 | | YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or |
1737 | | if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an |
1738 | | incorrect destructor might then be invoked immediately. In the |
1739 | | case of YYERROR or YYBACKUP, subsequent parser actions might lead |
1740 | | to an incorrect destructor call or verbose syntax error message |
1741 | | before the lookahead is translated. */ |
1742 | 0 | YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); |
1743 | |
|
1744 | 0 | YYPOPSTACK (yylen); |
1745 | 0 | yylen = 0; |
1746 | 0 | YY_STACK_PRINT (yyss, yyssp); |
1747 | |
|
1748 | 0 | *++yyvsp = yyval; |
1749 | | |
1750 | | /* Now 'shift' the result of the reduction. Determine what state |
1751 | | that goes to, based on the state we popped back to and the rule |
1752 | | number reduced by. */ |
1753 | 0 | { |
1754 | 0 | const int yylhs = yyr1[yyn] - YYNTOKENS; |
1755 | 0 | const int yyi = yypgoto[yylhs] + *yyssp; |
1756 | 0 | yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp |
1757 | 0 | ? yytable[yyi] |
1758 | 0 | : yydefgoto[yylhs]); |
1759 | 0 | } |
1760 | |
|
1761 | 0 | goto yynewstate; |
1762 | | |
1763 | | |
1764 | | /*--------------------------------------. |
1765 | | | yyerrlab -- here on detecting error. | |
1766 | | `--------------------------------------*/ |
1767 | 0 | yyerrlab: |
1768 | | /* Make sure we have latest lookahead translation. See comments at |
1769 | | user semantic actions for why this is necessary. */ |
1770 | 0 | yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); |
1771 | | |
1772 | | /* If not already recovering from an error, report this error. */ |
1773 | 0 | if (!yyerrstatus) |
1774 | 0 | { |
1775 | 0 | ++yynerrs; |
1776 | 0 | #if ! YYERROR_VERBOSE |
1777 | 0 | yyerror (YY_("syntax error")); |
1778 | | #else |
1779 | | # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ |
1780 | | yyssp, yytoken) |
1781 | | { |
1782 | | char const *yymsgp = YY_("syntax error"); |
1783 | | int yysyntax_error_status; |
1784 | | yysyntax_error_status = YYSYNTAX_ERROR; |
1785 | | if (yysyntax_error_status == 0) |
1786 | | yymsgp = yymsg; |
1787 | | else if (yysyntax_error_status == 1) |
1788 | | { |
1789 | | if (yymsg != yymsgbuf) |
1790 | | YYSTACK_FREE (yymsg); |
1791 | | yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); |
1792 | | if (!yymsg) |
1793 | | { |
1794 | | yymsg = yymsgbuf; |
1795 | | yymsg_alloc = sizeof yymsgbuf; |
1796 | | yysyntax_error_status = 2; |
1797 | | } |
1798 | | else |
1799 | | { |
1800 | | yysyntax_error_status = YYSYNTAX_ERROR; |
1801 | | yymsgp = yymsg; |
1802 | | } |
1803 | | } |
1804 | | yyerror (yymsgp); |
1805 | | if (yysyntax_error_status == 2) |
1806 | | goto yyexhaustedlab; |
1807 | | } |
1808 | | # undef YYSYNTAX_ERROR |
1809 | | #endif |
1810 | 0 | } |
1811 | | |
1812 | | |
1813 | | |
1814 | 0 | if (yyerrstatus == 3) |
1815 | 0 | { |
1816 | | /* If just tried and failed to reuse lookahead token after an |
1817 | | error, discard it. */ |
1818 | |
|
1819 | 0 | if (yychar <= YYEOF) |
1820 | 0 | { |
1821 | | /* Return failure if at end of input. */ |
1822 | 0 | if (yychar == YYEOF) |
1823 | 0 | YYABORT; |
1824 | 0 | } |
1825 | 0 | else |
1826 | 0 | { |
1827 | 0 | yydestruct ("Error: discarding", |
1828 | 0 | yytoken, &yylval); |
1829 | 0 | yychar = YYEMPTY; |
1830 | 0 | } |
1831 | 0 | } |
1832 | | |
1833 | | /* Else will try to reuse lookahead token after shifting the error |
1834 | | token. */ |
1835 | 0 | goto yyerrlab1; |
1836 | | |
1837 | | |
1838 | | /*---------------------------------------------------. |
1839 | | | yyerrorlab -- error raised explicitly by YYERROR. | |
1840 | | `---------------------------------------------------*/ |
1841 | 0 | yyerrorlab: |
1842 | | /* Pacify compilers when the user code never invokes YYERROR and the |
1843 | | label yyerrorlab therefore never appears in user code. */ |
1844 | 0 | if (0) |
1845 | 0 | YYERROR; |
1846 | | |
1847 | | /* Do not reclaim the symbols of the rule whose action triggered |
1848 | | this YYERROR. */ |
1849 | 0 | YYPOPSTACK (yylen); |
1850 | 0 | yylen = 0; |
1851 | 0 | YY_STACK_PRINT (yyss, yyssp); |
1852 | 0 | yystate = *yyssp; |
1853 | 0 | goto yyerrlab1; |
1854 | | |
1855 | | |
1856 | | /*-------------------------------------------------------------. |
1857 | | | yyerrlab1 -- common code for both syntax error and YYERROR. | |
1858 | | `-------------------------------------------------------------*/ |
1859 | 0 | yyerrlab1: |
1860 | 0 | yyerrstatus = 3; /* Each real token shifted decrements this. */ |
1861 | |
|
1862 | 0 | for (;;) |
1863 | 0 | { |
1864 | 0 | yyn = yypact[yystate]; |
1865 | 0 | if (!yypact_value_is_default (yyn)) |
1866 | 0 | { |
1867 | 0 | yyn += YYTERROR; |
1868 | 0 | if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) |
1869 | 0 | { |
1870 | 0 | yyn = yytable[yyn]; |
1871 | 0 | if (0 < yyn) |
1872 | 0 | break; |
1873 | 0 | } |
1874 | 0 | } |
1875 | | |
1876 | | /* Pop the current state because it cannot handle the error token. */ |
1877 | 0 | if (yyssp == yyss) |
1878 | 0 | YYABORT; |
1879 | | |
1880 | | |
1881 | 0 | yydestruct ("Error: popping", |
1882 | 0 | yystos[yystate], yyvsp); |
1883 | 0 | YYPOPSTACK (1); |
1884 | 0 | yystate = *yyssp; |
1885 | 0 | YY_STACK_PRINT (yyss, yyssp); |
1886 | 0 | } |
1887 | | |
1888 | 0 | YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN |
1889 | 0 | *++yyvsp = yylval; |
1890 | 0 | YY_IGNORE_MAYBE_UNINITIALIZED_END |
1891 | | |
1892 | | |
1893 | | /* Shift the error token. */ |
1894 | 0 | YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); |
1895 | |
|
1896 | 0 | yystate = yyn; |
1897 | 0 | goto yynewstate; |
1898 | | |
1899 | | |
1900 | | /*-------------------------------------. |
1901 | | | yyacceptlab -- YYACCEPT comes here. | |
1902 | | `-------------------------------------*/ |
1903 | 0 | yyacceptlab: |
1904 | 0 | yyresult = 0; |
1905 | 0 | goto yyreturn; |
1906 | | |
1907 | | |
1908 | | /*-----------------------------------. |
1909 | | | yyabortlab -- YYABORT comes here. | |
1910 | | `-----------------------------------*/ |
1911 | 0 | yyabortlab: |
1912 | 0 | yyresult = 1; |
1913 | 0 | goto yyreturn; |
1914 | | |
1915 | | |
1916 | 0 | #if !defined yyoverflow || YYERROR_VERBOSE |
1917 | | /*-------------------------------------------------. |
1918 | | | yyexhaustedlab -- memory exhaustion comes here. | |
1919 | | `-------------------------------------------------*/ |
1920 | 0 | yyexhaustedlab: |
1921 | 0 | yyerror (YY_("memory exhausted")); |
1922 | 0 | yyresult = 2; |
1923 | | /* Fall through. */ |
1924 | 0 | #endif |
1925 | | |
1926 | | |
1927 | | /*-----------------------------------------------------. |
1928 | | | yyreturn -- parsing is finished, return the result. | |
1929 | | `-----------------------------------------------------*/ |
1930 | 0 | yyreturn: |
1931 | 0 | if (yychar != YYEMPTY) |
1932 | 0 | { |
1933 | | /* Make sure we have latest lookahead translation. See comments at |
1934 | | user semantic actions for why this is necessary. */ |
1935 | 0 | yytoken = YYTRANSLATE (yychar); |
1936 | 0 | yydestruct ("Cleanup: discarding lookahead", |
1937 | 0 | yytoken, &yylval); |
1938 | 0 | } |
1939 | | /* Do not reclaim the symbols of the rule whose action triggered |
1940 | | this YYABORT or YYACCEPT. */ |
1941 | 0 | YYPOPSTACK (yylen); |
1942 | 0 | YY_STACK_PRINT (yyss, yyssp); |
1943 | 0 | while (yyssp != yyss) |
1944 | 0 | { |
1945 | 0 | yydestruct ("Cleanup: popping", |
1946 | 0 | yystos[*yyssp], yyvsp); |
1947 | 0 | YYPOPSTACK (1); |
1948 | 0 | } |
1949 | 0 | #ifndef yyoverflow |
1950 | 0 | if (yyss != yyssa) |
1951 | 0 | YYSTACK_FREE (yyss); |
1952 | 0 | #endif |
1953 | | #if YYERROR_VERBOSE |
1954 | | if (yymsg != yymsgbuf) |
1955 | | YYSTACK_FREE (yymsg); |
1956 | | #endif |
1957 | 0 | return yyresult; |
1958 | 0 | } |
1959 | | #line 406 "repl_gram.y" |
1960 | | |
1961 | | |
1962 | | static SQLCmd * |
1963 | | make_sqlcmd(void) |
1964 | 0 | { |
1965 | 0 | SQLCmd *cmd = makeNode(SQLCmd); |
1966 | 0 | int tok; |
1967 | | |
1968 | | /* Just move lexer to the end of command. */ |
1969 | 0 | for (;;) |
1970 | 0 | { |
1971 | 0 | tok = yylex(); |
1972 | 0 | if (tok == ';' || tok == 0) |
1973 | 0 | break; |
1974 | 0 | } |
1975 | 0 | return cmd; |
1976 | 0 | } |
1977 | | |
1978 | | #include "repl_scanner.c" |