Line data Source code
1 : /* A Bison parser, made by GNU Bison 3.7.5. */
2 :
3 : /* Bison implementation for Yacc-like parsers in C
4 :
5 : Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 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 : /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
38 : especially those whose name start with YY_ or yy_. They are
39 : private implementation details that can be changed or removed. */
40 :
41 : /* All symbols defined below should begin with yy or YY, to avoid
42 : infringing on user name space. This should be done even for local
43 : variables, as they might otherwise be expanded by user macros.
44 : There are some unavoidable exceptions within include files to
45 : define necessary library symbols; they are noted "INFRINGES ON
46 : USER NAME SPACE" below. */
47 :
48 : /* Identify Bison output, and Bison version. */
49 : #define YYBISON 30705
50 :
51 : /* Bison version string. */
52 : #define YYBISON_VERSION "3.7.5"
53 :
54 : /* Skeleton name. */
55 : #define YYSKELETON_NAME "yacc.c"
56 :
57 : /* Pure parsers. */
58 : #define YYPURE 0
59 :
60 : /* Push parsers. */
61 : #define YYPUSH 0
62 :
63 : /* Pull parsers. */
64 : #define YYPULL 1
65 :
66 :
67 : /* Substitute the variable and function names. */
68 : #define yyparse boot_yyparse
69 : #define yylex boot_yylex
70 : #define yyerror boot_yyerror
71 : #define yydebug boot_yydebug
72 : #define yynerrs boot_yynerrs
73 : #define yylval boot_yylval
74 : #define yychar boot_yychar
75 :
76 : /* First part of user prologue. */
77 : #line 1 "bootparse.y"
78 :
79 : /*-------------------------------------------------------------------------
80 : *
81 : * bootparse.y
82 : * yacc grammar for the "bootstrap" mode (BKI file format)
83 : *
84 : * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
85 : * Portions Copyright (c) 1994, Regents of the University of California
86 : *
87 : *
88 : * IDENTIFICATION
89 : * src/backend/bootstrap/bootparse.y
90 : *
91 : *-------------------------------------------------------------------------
92 : */
93 :
94 : #include "postgres.h"
95 :
96 : #include <unistd.h>
97 :
98 : #include "bootstrap/bootstrap.h"
99 : #include "catalog/heap.h"
100 : #include "catalog/namespace.h"
101 : #include "catalog/pg_am.h"
102 : #include "catalog/pg_authid.h"
103 : #include "catalog/pg_class.h"
104 : #include "catalog/pg_namespace.h"
105 : #include "catalog/pg_tablespace.h"
106 : #include "catalog/toasting.h"
107 : #include "commands/defrem.h"
108 : #include "miscadmin.h"
109 : #include "nodes/makefuncs.h"
110 : #include "utils/memutils.h"
111 :
112 :
113 : /*
114 : * Bison doesn't allocate anything that needs to live across parser calls,
115 : * so we can easily have it use palloc instead of malloc. This prevents
116 : * memory leaks if we error out during parsing.
117 : */
118 : #define YYMALLOC palloc
119 : #define YYFREE pfree
120 :
121 : static MemoryContext per_line_ctx = NULL;
122 :
123 : static void
124 : do_start(void)
125 : {
126 : Assert(CurrentMemoryContext == CurTransactionContext);
127 : /* First time through, create the per-line working context */
128 : if (per_line_ctx == NULL)
129 : per_line_ctx = AllocSetContextCreate(CurTransactionContext,
130 : "bootstrap per-line processing",
131 : ALLOCSET_DEFAULT_SIZES);
132 : MemoryContextSwitchTo(per_line_ctx);
133 : }
134 :
135 :
136 : static void
137 : do_end(void)
138 : {
139 : /* Reclaim memory allocated while processing this line */
140 : MemoryContextSwitchTo(CurTransactionContext);
141 : MemoryContextReset(per_line_ctx);
142 : CHECK_FOR_INTERRUPTS(); /* allow SIGINT to kill bootstrap run */
143 : if (isatty(0))
144 : {
145 : printf("bootstrap> ");
146 : fflush(stdout);
147 : }
148 : }
149 :
150 :
151 : static int num_columns_read = 0;
152 :
153 :
154 : #line 155 "bootparse.c"
155 :
156 : # ifndef YY_CAST
157 : # ifdef __cplusplus
158 : # define YY_CAST(Type, Val) static_cast<Type> (Val)
159 : # define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
160 : # else
161 : # define YY_CAST(Type, Val) ((Type) (Val))
162 : # define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
163 : # endif
164 : # endif
165 : # ifndef YY_NULLPTR
166 : # if defined __cplusplus
167 : # if 201103L <= __cplusplus
168 : # define YY_NULLPTR nullptr
169 : # else
170 : # define YY_NULLPTR 0
171 : # endif
172 : # else
173 : # define YY_NULLPTR ((void*)0)
174 : # endif
175 : # endif
176 :
177 : #include "bootparse.h"
178 : /* Symbol kind. */
179 : enum yysymbol_kind_t
180 : {
181 : YYSYMBOL_YYEMPTY = -2,
182 : YYSYMBOL_YYEOF = 0, /* "end of file" */
183 : YYSYMBOL_YYerror = 1, /* error */
184 : YYSYMBOL_YYUNDEF = 2, /* "invalid token" */
185 : YYSYMBOL_ID = 3, /* ID */
186 : YYSYMBOL_COMMA = 4, /* COMMA */
187 : YYSYMBOL_EQUALS = 5, /* EQUALS */
188 : YYSYMBOL_LPAREN = 6, /* LPAREN */
189 : YYSYMBOL_RPAREN = 7, /* RPAREN */
190 : YYSYMBOL_NULLVAL = 8, /* NULLVAL */
191 : YYSYMBOL_OPEN = 9, /* OPEN */
192 : YYSYMBOL_XCLOSE = 10, /* XCLOSE */
193 : YYSYMBOL_XCREATE = 11, /* XCREATE */
194 : YYSYMBOL_INSERT_TUPLE = 12, /* INSERT_TUPLE */
195 : YYSYMBOL_XDECLARE = 13, /* XDECLARE */
196 : YYSYMBOL_INDEX = 14, /* INDEX */
197 : YYSYMBOL_ON = 15, /* ON */
198 : YYSYMBOL_USING = 16, /* USING */
199 : YYSYMBOL_XBUILD = 17, /* XBUILD */
200 : YYSYMBOL_INDICES = 18, /* INDICES */
201 : YYSYMBOL_UNIQUE = 19, /* UNIQUE */
202 : YYSYMBOL_XTOAST = 20, /* XTOAST */
203 : YYSYMBOL_OBJ_ID = 21, /* OBJ_ID */
204 : YYSYMBOL_XBOOTSTRAP = 22, /* XBOOTSTRAP */
205 : YYSYMBOL_XSHARED_RELATION = 23, /* XSHARED_RELATION */
206 : YYSYMBOL_XROWTYPE_OID = 24, /* XROWTYPE_OID */
207 : YYSYMBOL_XFORCE = 25, /* XFORCE */
208 : YYSYMBOL_XNOT = 26, /* XNOT */
209 : YYSYMBOL_XNULL = 27, /* XNULL */
210 : YYSYMBOL_YYACCEPT = 28, /* $accept */
211 : YYSYMBOL_TopLevel = 29, /* TopLevel */
212 : YYSYMBOL_Boot_Queries = 30, /* Boot_Queries */
213 : YYSYMBOL_Boot_Query = 31, /* Boot_Query */
214 : YYSYMBOL_Boot_OpenStmt = 32, /* Boot_OpenStmt */
215 : YYSYMBOL_Boot_CloseStmt = 33, /* Boot_CloseStmt */
216 : YYSYMBOL_Boot_CreateStmt = 34, /* Boot_CreateStmt */
217 : YYSYMBOL_35_1 = 35, /* $@1 */
218 : YYSYMBOL_36_2 = 36, /* $@2 */
219 : YYSYMBOL_Boot_InsertStmt = 37, /* Boot_InsertStmt */
220 : YYSYMBOL_38_3 = 38, /* $@3 */
221 : YYSYMBOL_Boot_DeclareIndexStmt = 39, /* Boot_DeclareIndexStmt */
222 : YYSYMBOL_Boot_DeclareUniqueIndexStmt = 40, /* Boot_DeclareUniqueIndexStmt */
223 : YYSYMBOL_Boot_DeclareToastStmt = 41, /* Boot_DeclareToastStmt */
224 : YYSYMBOL_Boot_BuildIndsStmt = 42, /* Boot_BuildIndsStmt */
225 : YYSYMBOL_boot_index_params = 43, /* boot_index_params */
226 : YYSYMBOL_boot_index_param = 44, /* boot_index_param */
227 : YYSYMBOL_optbootstrap = 45, /* optbootstrap */
228 : YYSYMBOL_optsharedrelation = 46, /* optsharedrelation */
229 : YYSYMBOL_optrowtypeoid = 47, /* optrowtypeoid */
230 : YYSYMBOL_boot_column_list = 48, /* boot_column_list */
231 : YYSYMBOL_boot_column_def = 49, /* boot_column_def */
232 : YYSYMBOL_boot_column_nullness = 50, /* boot_column_nullness */
233 : YYSYMBOL_oidspec = 51, /* oidspec */
234 : YYSYMBOL_boot_column_val_list = 52, /* boot_column_val_list */
235 : YYSYMBOL_boot_column_val = 53, /* boot_column_val */
236 : YYSYMBOL_boot_ident = 54 /* boot_ident */
237 : };
238 : typedef enum yysymbol_kind_t yysymbol_kind_t;
239 :
240 :
241 :
242 :
243 : #ifdef short
244 : # undef short
245 : #endif
246 :
247 : /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
248 : <limits.h> and (if available) <stdint.h> are included
249 : so that the code can choose integer types of a good width. */
250 :
251 : #ifndef __PTRDIFF_MAX__
252 : # include <limits.h> /* INFRINGES ON USER NAME SPACE */
253 : # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
254 : # include <stdint.h> /* INFRINGES ON USER NAME SPACE */
255 : # define YY_STDINT_H
256 : # endif
257 : #endif
258 :
259 : /* Narrow types that promote to a signed type and that can represent a
260 : signed or unsigned integer of at least N bits. In tables they can
261 : save space and decrease cache pressure. Promoting to a signed type
262 : helps avoid bugs in integer arithmetic. */
263 :
264 : #ifdef __INT_LEAST8_MAX__
265 : typedef __INT_LEAST8_TYPE__ yytype_int8;
266 : #elif defined YY_STDINT_H
267 : typedef int_least8_t yytype_int8;
268 : #else
269 : typedef signed char yytype_int8;
270 : #endif
271 :
272 : #ifdef __INT_LEAST16_MAX__
273 : typedef __INT_LEAST16_TYPE__ yytype_int16;
274 : #elif defined YY_STDINT_H
275 : typedef int_least16_t yytype_int16;
276 : #else
277 : typedef short yytype_int16;
278 : #endif
279 :
280 : /* Work around bug in HP-UX 11.23, which defines these macros
281 : incorrectly for preprocessor constants. This workaround can likely
282 : be removed in 2023, as HPE has promised support for HP-UX 11.23
283 : (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of
284 : <https://h20195.www2.hpe.com/V2/getpdf.aspx/4AA4-7673ENW.pdf>. */
285 : #ifdef __hpux
286 : # undef UINT_LEAST8_MAX
287 : # undef UINT_LEAST16_MAX
288 : # define UINT_LEAST8_MAX 255
289 : # define UINT_LEAST16_MAX 65535
290 : #endif
291 :
292 : #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
293 : typedef __UINT_LEAST8_TYPE__ yytype_uint8;
294 : #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
295 : && UINT_LEAST8_MAX <= INT_MAX)
296 : typedef uint_least8_t yytype_uint8;
297 : #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
298 : typedef unsigned char yytype_uint8;
299 : #else
300 : typedef short yytype_uint8;
301 : #endif
302 :
303 : #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
304 : typedef __UINT_LEAST16_TYPE__ yytype_uint16;
305 : #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
306 : && UINT_LEAST16_MAX <= INT_MAX)
307 : typedef uint_least16_t yytype_uint16;
308 : #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
309 : typedef unsigned short yytype_uint16;
310 : #else
311 : typedef int yytype_uint16;
312 : #endif
313 :
314 : #ifndef YYPTRDIFF_T
315 : # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
316 : # define YYPTRDIFF_T __PTRDIFF_TYPE__
317 : # define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
318 : # elif defined PTRDIFF_MAX
319 : # ifndef ptrdiff_t
320 : # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
321 : # endif
322 : # define YYPTRDIFF_T ptrdiff_t
323 : # define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
324 : # else
325 : # define YYPTRDIFF_T long
326 : # define YYPTRDIFF_MAXIMUM LONG_MAX
327 : # endif
328 : #endif
329 :
330 : #ifndef YYSIZE_T
331 : # ifdef __SIZE_TYPE__
332 : # define YYSIZE_T __SIZE_TYPE__
333 : # elif defined size_t
334 : # define YYSIZE_T size_t
335 : # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
336 : # include <stddef.h> /* INFRINGES ON USER NAME SPACE */
337 : # define YYSIZE_T size_t
338 : # else
339 : # define YYSIZE_T unsigned
340 : # endif
341 : #endif
342 :
343 : #define YYSIZE_MAXIMUM \
344 : YY_CAST (YYPTRDIFF_T, \
345 : (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
346 : ? YYPTRDIFF_MAXIMUM \
347 : : YY_CAST (YYSIZE_T, -1)))
348 :
349 : #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
350 :
351 :
352 : /* Stored state numbers (used for stacks). */
353 : typedef yytype_int8 yy_state_t;
354 :
355 : /* State numbers in computations. */
356 : typedef int yy_state_fast_t;
357 :
358 : #ifndef YY_
359 : # if defined YYENABLE_NLS && YYENABLE_NLS
360 : # if ENABLE_NLS
361 : # include <libintl.h> /* INFRINGES ON USER NAME SPACE */
362 : # define YY_(Msgid) dgettext ("bison-runtime", Msgid)
363 : # endif
364 : # endif
365 : # ifndef YY_
366 : # define YY_(Msgid) Msgid
367 : # endif
368 : #endif
369 :
370 :
371 : #ifndef YY_ATTRIBUTE_PURE
372 : # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
373 : # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
374 : # else
375 : # define YY_ATTRIBUTE_PURE
376 : # endif
377 : #endif
378 :
379 : #ifndef YY_ATTRIBUTE_UNUSED
380 : # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
381 : # define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
382 : # else
383 : # define YY_ATTRIBUTE_UNUSED
384 : # endif
385 : #endif
386 :
387 : /* Suppress unused-variable warnings by "using" E. */
388 : #if ! defined lint || defined __GNUC__
389 : # define YY_USE(E) ((void) (E))
390 : #else
391 : # define YY_USE(E) /* empty */
392 : #endif
393 :
394 : #if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
395 : /* Suppress an incorrect diagnostic about yylval being uninitialized. */
396 : # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
397 : _Pragma ("GCC diagnostic push") \
398 : _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
399 : _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
400 : # define YY_IGNORE_MAYBE_UNINITIALIZED_END \
401 : _Pragma ("GCC diagnostic pop")
402 : #else
403 : # define YY_INITIAL_VALUE(Value) Value
404 : #endif
405 : #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
406 : # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
407 : # define YY_IGNORE_MAYBE_UNINITIALIZED_END
408 : #endif
409 : #ifndef YY_INITIAL_VALUE
410 : # define YY_INITIAL_VALUE(Value) /* Nothing. */
411 : #endif
412 :
413 : #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
414 : # define YY_IGNORE_USELESS_CAST_BEGIN \
415 : _Pragma ("GCC diagnostic push") \
416 : _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
417 : # define YY_IGNORE_USELESS_CAST_END \
418 : _Pragma ("GCC diagnostic pop")
419 : #endif
420 : #ifndef YY_IGNORE_USELESS_CAST_BEGIN
421 : # define YY_IGNORE_USELESS_CAST_BEGIN
422 : # define YY_IGNORE_USELESS_CAST_END
423 : #endif
424 :
425 :
426 : #define YY_ASSERT(E) ((void) (0 && (E)))
427 :
428 : #if !defined yyoverflow
429 :
430 : /* The parser invokes alloca or malloc; define the necessary symbols. */
431 :
432 : # ifdef YYSTACK_USE_ALLOCA
433 : # if YYSTACK_USE_ALLOCA
434 : # ifdef __GNUC__
435 : # define YYSTACK_ALLOC __builtin_alloca
436 : # elif defined __BUILTIN_VA_ARG_INCR
437 : # include <alloca.h> /* INFRINGES ON USER NAME SPACE */
438 : # elif defined _AIX
439 : # define YYSTACK_ALLOC __alloca
440 : # elif defined _MSC_VER
441 : # include <malloc.h> /* INFRINGES ON USER NAME SPACE */
442 : # define alloca _alloca
443 : # else
444 : # define YYSTACK_ALLOC alloca
445 : # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
446 : # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
447 : /* Use EXIT_SUCCESS as a witness for stdlib.h. */
448 : # ifndef EXIT_SUCCESS
449 : # define EXIT_SUCCESS 0
450 : # endif
451 : # endif
452 : # endif
453 : # endif
454 : # endif
455 :
456 : # ifdef YYSTACK_ALLOC
457 : /* Pacify GCC's 'empty if-body' warning. */
458 : # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
459 : # ifndef YYSTACK_ALLOC_MAXIMUM
460 : /* The OS might guarantee only one guard page at the bottom of the stack,
461 : and a page size can be as small as 4096 bytes. So we cannot safely
462 : invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
463 : to allow for a few compiler-allocated temporary stack slots. */
464 : # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
465 : # endif
466 : # else
467 : # define YYSTACK_ALLOC YYMALLOC
468 : # define YYSTACK_FREE YYFREE
469 : # ifndef YYSTACK_ALLOC_MAXIMUM
470 : # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
471 : # endif
472 : # if (defined __cplusplus && ! defined EXIT_SUCCESS \
473 : && ! ((defined YYMALLOC || defined malloc) \
474 : && (defined YYFREE || defined free)))
475 : # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
476 : # ifndef EXIT_SUCCESS
477 : # define EXIT_SUCCESS 0
478 : # endif
479 : # endif
480 : # ifndef YYMALLOC
481 : # define YYMALLOC malloc
482 : # if ! defined malloc && ! defined EXIT_SUCCESS
483 : void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
484 : # endif
485 : # endif
486 : # ifndef YYFREE
487 : # define YYFREE free
488 : # if ! defined free && ! defined EXIT_SUCCESS
489 : void free (void *); /* INFRINGES ON USER NAME SPACE */
490 : # endif
491 : # endif
492 : # endif
493 : #endif /* !defined yyoverflow */
494 :
495 : #if (! defined yyoverflow \
496 : && (! defined __cplusplus \
497 : || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
498 :
499 : /* A type that is properly aligned for any stack member. */
500 : union yyalloc
501 : {
502 : yy_state_t yyss_alloc;
503 : YYSTYPE yyvs_alloc;
504 : };
505 :
506 : /* The size of the maximum gap between one aligned stack and the next. */
507 : # define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
508 :
509 : /* The size of an array large to enough to hold all stacks, each with
510 : N elements. */
511 : # define YYSTACK_BYTES(N) \
512 : ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \
513 : + YYSTACK_GAP_MAXIMUM)
514 :
515 : # define YYCOPY_NEEDED 1
516 :
517 : /* Relocate STACK from its old location to the new one. The
518 : local variables YYSIZE and YYSTACKSIZE give the old and new number of
519 : elements in the stack, and YYPTR gives the new location of the
520 : stack. Advance YYPTR to a properly aligned location for the next
521 : stack. */
522 : # define YYSTACK_RELOCATE(Stack_alloc, Stack) \
523 : do \
524 : { \
525 : YYPTRDIFF_T yynewbytes; \
526 : YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
527 : Stack = &yyptr->Stack_alloc; \
528 : yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
529 : yyptr += yynewbytes / YYSIZEOF (*yyptr); \
530 : } \
531 : while (0)
532 :
533 : #endif
534 :
535 : #if defined YYCOPY_NEEDED && YYCOPY_NEEDED
536 : /* Copy COUNT objects from SRC to DST. The source and destination do
537 : not overlap. */
538 : # ifndef YYCOPY
539 : # if defined __GNUC__ && 1 < __GNUC__
540 : # define YYCOPY(Dst, Src, Count) \
541 : __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
542 : # else
543 : # define YYCOPY(Dst, Src, Count) \
544 : do \
545 : { \
546 : YYPTRDIFF_T yyi; \
547 : for (yyi = 0; yyi < (Count); yyi++) \
548 : (Dst)[yyi] = (Src)[yyi]; \
549 : } \
550 : while (0)
551 : # endif
552 : # endif
553 : #endif /* !YYCOPY_NEEDED */
554 :
555 : /* YYFINAL -- State number of the termination state. */
556 : #define YYFINAL 46
557 : /* YYLAST -- Last index in YYTABLE. */
558 : #define YYLAST 169
559 :
560 : /* YYNTOKENS -- Number of terminals. */
561 : #define YYNTOKENS 28
562 : /* YYNNTS -- Number of nonterminals. */
563 : #define YYNNTS 27
564 : /* YYNRULES -- Number of rules. */
565 : #define YYNRULES 65
566 : /* YYNSTATES -- Number of states. */
567 : #define YYNSTATES 110
568 :
569 : /* YYMAXUTOK -- Last valid token kind. */
570 : #define YYMAXUTOK 282
571 :
572 :
573 : /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
574 : as returned by yylex, with out-of-bounds checking. */
575 : #define YYTRANSLATE(YYX) \
576 : (0 <= (YYX) && (YYX) <= YYMAXUTOK \
577 : ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \
578 : : YYSYMBOL_YYUNDEF)
579 :
580 : /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
581 : as returned by yylex. */
582 : static const yytype_int8 yytranslate[] =
583 : {
584 : 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
585 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
586 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
587 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
588 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
589 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
590 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
591 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
592 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
593 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
594 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
595 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
596 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
597 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
598 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
599 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
600 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
601 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
602 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
603 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
604 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
605 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
606 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
607 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
608 : 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
609 : 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
610 : 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
611 : 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
612 : 25, 26, 27
613 : };
614 :
615 : #if YYDEBUG
616 : /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
617 : static const yytype_int16 yyrline[] =
618 : {
619 : 0, 112, 112, 113, 117, 118, 122, 123, 124, 125,
620 : 126, 127, 128, 129, 133, 142, 152, 162, 151, 249,
621 : 248, 267, 320, 373, 385, 395, 396, 400, 416, 417,
622 : 421, 422, 426, 427, 431, 432, 436, 445, 446, 447,
623 : 451, 455, 456, 457, 461, 463, 468, 469, 470, 471,
624 : 472, 473, 474, 475, 476, 477, 478, 479, 480, 481,
625 : 482, 483, 484, 485, 486, 487
626 : };
627 : #endif
628 :
629 : /** Accessing symbol of state STATE. */
630 : #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
631 :
632 : #if YYDEBUG || 0
633 : /* The user-facing name of the symbol whose (internal) number is
634 : YYSYMBOL. No bounds checking. */
635 : static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED;
636 :
637 : /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
638 : First, the terminals, then, starting at YYNTOKENS, nonterminals. */
639 : static const char *const yytname[] =
640 : {
641 : "\"end of file\"", "error", "\"invalid token\"", "ID", "COMMA",
642 : "EQUALS", "LPAREN", "RPAREN", "NULLVAL", "OPEN", "XCLOSE", "XCREATE",
643 : "INSERT_TUPLE", "XDECLARE", "INDEX", "ON", "USING", "XBUILD", "INDICES",
644 : "UNIQUE", "XTOAST", "OBJ_ID", "XBOOTSTRAP", "XSHARED_RELATION",
645 : "XROWTYPE_OID", "XFORCE", "XNOT", "XNULL", "$accept", "TopLevel",
646 : "Boot_Queries", "Boot_Query", "Boot_OpenStmt", "Boot_CloseStmt",
647 : "Boot_CreateStmt", "$@1", "$@2", "Boot_InsertStmt", "$@3",
648 : "Boot_DeclareIndexStmt", "Boot_DeclareUniqueIndexStmt",
649 : "Boot_DeclareToastStmt", "Boot_BuildIndsStmt", "boot_index_params",
650 : "boot_index_param", "optbootstrap", "optsharedrelation", "optrowtypeoid",
651 : "boot_column_list", "boot_column_def", "boot_column_nullness", "oidspec",
652 : "boot_column_val_list", "boot_column_val", "boot_ident", YY_NULLPTR
653 : };
654 :
655 : static const char *
656 : yysymbol_name (yysymbol_kind_t yysymbol)
657 : {
658 : return yytname[yysymbol];
659 : }
660 : #endif
661 :
662 : #ifdef YYPRINT
663 : /* YYTOKNUM[NUM] -- (External) token number corresponding to the
664 : (internal) symbol number NUM (which must be that of a token). */
665 : static const yytype_int16 yytoknum[] =
666 : {
667 : 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
668 : 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
669 : 275, 276, 277, 278, 279, 280, 281, 282
670 : };
671 : #endif
672 :
673 : #define YYPACT_NINF (-53)
674 :
675 : #define yypact_value_is_default(Yyn) \
676 : ((Yyn) == YYPACT_NINF)
677 :
678 : #define YYTABLE_NINF (-1)
679 :
680 : #define yytable_value_is_error(Yyn) \
681 : 0
682 :
683 : /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
684 : STATE-NUM. */
685 : static const yytype_int16 yypact[] =
686 : {
687 : -4, 142, 142, 142, -53, 2, -14, 25, -4, -53,
688 : -53, -53, -53, -53, -53, -53, -53, -53, -53, -53,
689 : -53, -53, -53, -53, -53, -53, -53, -53, -53, -53,
690 : -53, -53, -53, -53, -53, -53, -53, -53, -53, -53,
691 : 142, 20, 142, 13, 142, -53, -53, -53, 6, -53,
692 : 117, 142, 142, 142, -53, 8, -53, 92, -53, -53,
693 : 14, 142, 17, -53, 9, 117, -53, -53, 142, 19,
694 : 142, 142, 29, -53, 21, 142, -53, -53, -53, 142,
695 : 22, 142, 30, 142, 35, -53, 37, 142, 34, 142,
696 : 36, 142, 10, -53, 142, 142, -53, -53, 23, 142,
697 : -53, -53, 11, -3, -53, -53, -53, 18, -53, -53
698 : };
699 :
700 : /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
701 : Performed when YYTABLE does not specify something else to do. Zero
702 : means the default is an error. */
703 : static const yytype_int8 yydefact[] =
704 : {
705 : 3, 0, 0, 0, 19, 0, 0, 0, 2, 4,
706 : 6, 7, 8, 9, 10, 11, 12, 13, 46, 47,
707 : 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
708 : 58, 59, 60, 61, 62, 63, 64, 65, 14, 15,
709 : 0, 0, 0, 0, 0, 24, 1, 5, 29, 40,
710 : 0, 0, 0, 0, 28, 31, 45, 0, 41, 44,
711 : 0, 0, 0, 30, 33, 0, 20, 42, 0, 0,
712 : 0, 0, 0, 43, 0, 0, 23, 32, 16, 0,
713 : 0, 0, 0, 0, 17, 34, 0, 0, 0, 0,
714 : 0, 0, 0, 26, 0, 0, 35, 18, 39, 0,
715 : 21, 27, 0, 0, 36, 25, 22, 0, 38, 37
716 : };
717 :
718 : /* YYPGOTO[NTERM-NUM]. */
719 : static const yytype_int8 yypgoto[] =
720 : {
721 : -53, -53, -53, 38, -53, -53, -53, -53, -53, -53,
722 : -53, -53, -53, -53, -53, -51, -52, -53, -53, -53,
723 : -53, -39, -53, -41, -53, -46, -1
724 : };
725 :
726 : /* YYDEFGOTO[NTERM-NUM]. */
727 : static const yytype_int8 yydefgoto[] =
728 : {
729 : 0, 7, 8, 9, 10, 11, 12, 81, 90, 13,
730 : 41, 14, 15, 16, 17, 92, 93, 55, 64, 72,
731 : 84, 85, 104, 48, 57, 58, 49
732 : };
733 :
734 : /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
735 : positive, shift that token. If negative, reduce the rule whose
736 : number is the opposite. If YYTABLE_NINF, syntax error. */
737 : static const yytype_int8 yytable[] =
738 : {
739 : 38, 39, 40, 53, 45, 1, 2, 3, 4, 5,
740 : 60, 67, 62, 6, 99, 99, 42, 100, 106, 73,
741 : 69, 43, 44, 107, 108, 46, 50, 52, 54, 68,
742 : 77, 63, 70, 71, 75, 78, 87, 79, 83, 89,
743 : 95, 51, 91, 97, 102, 109, 47, 105, 103, 59,
744 : 96, 61, 0, 0, 0, 0, 59, 0, 0, 0,
745 : 0, 0, 0, 0, 59, 0, 0, 74, 0, 76,
746 : 0, 0, 0, 0, 80, 0, 0, 0, 82, 0,
747 : 86, 0, 88, 0, 0, 0, 94, 0, 86, 0,
748 : 98, 0, 0, 101, 94, 18, 65, 0, 94, 66,
749 : 56, 19, 20, 21, 22, 23, 24, 25, 26, 27,
750 : 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
751 : 18, 0, 0, 0, 0, 56, 19, 20, 21, 22,
752 : 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
753 : 33, 34, 35, 36, 37, 18, 0, 0, 0, 0,
754 : 0, 19, 20, 21, 22, 23, 24, 25, 26, 27,
755 : 28, 29, 30, 31, 32, 33, 34, 35, 36, 37
756 : };
757 :
758 : static const yytype_int8 yycheck[] =
759 : {
760 : 1, 2, 3, 44, 18, 9, 10, 11, 12, 13,
761 : 51, 57, 53, 17, 4, 4, 14, 7, 7, 65,
762 : 61, 19, 20, 26, 27, 0, 6, 14, 22, 15,
763 : 71, 23, 15, 24, 15, 6, 6, 16, 16, 4,
764 : 6, 42, 5, 7, 95, 27, 8, 99, 25, 50,
765 : 89, 52, -1, -1, -1, -1, 57, -1, -1, -1,
766 : -1, -1, -1, -1, 65, -1, -1, 68, -1, 70,
767 : -1, -1, -1, -1, 75, -1, -1, -1, 79, -1,
768 : 81, -1, 83, -1, -1, -1, 87, -1, 89, -1,
769 : 91, -1, -1, 94, 95, 3, 4, -1, 99, 7,
770 : 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
771 : 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
772 : 3, -1, -1, -1, -1, 8, 9, 10, 11, 12,
773 : 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
774 : 23, 24, 25, 26, 27, 3, -1, -1, -1, -1,
775 : -1, 9, 10, 11, 12, 13, 14, 15, 16, 17,
776 : 18, 19, 20, 21, 22, 23, 24, 25, 26, 27
777 : };
778 :
779 : /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
780 : symbol of state STATE-NUM. */
781 : static const yytype_int8 yystos[] =
782 : {
783 : 0, 9, 10, 11, 12, 13, 17, 29, 30, 31,
784 : 32, 33, 34, 37, 39, 40, 41, 42, 3, 9,
785 : 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
786 : 20, 21, 22, 23, 24, 25, 26, 27, 54, 54,
787 : 54, 38, 14, 19, 20, 18, 0, 31, 51, 54,
788 : 6, 54, 14, 51, 22, 45, 8, 52, 53, 54,
789 : 51, 54, 51, 23, 46, 4, 7, 53, 15, 51,
790 : 15, 24, 47, 53, 54, 15, 54, 51, 6, 16,
791 : 54, 35, 54, 16, 48, 49, 54, 6, 54, 4,
792 : 36, 5, 43, 44, 54, 6, 49, 7, 54, 4,
793 : 7, 54, 43, 25, 50, 44, 7, 26, 27, 27
794 : };
795 :
796 : /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
797 : static const yytype_int8 yyr1[] =
798 : {
799 : 0, 28, 29, 29, 30, 30, 31, 31, 31, 31,
800 : 31, 31, 31, 31, 32, 33, 35, 36, 34, 38,
801 : 37, 39, 40, 41, 42, 43, 43, 44, 45, 45,
802 : 46, 46, 47, 47, 48, 48, 49, 50, 50, 50,
803 : 51, 52, 52, 52, 53, 53, 54, 54, 54, 54,
804 : 54, 54, 54, 54, 54, 54, 54, 54, 54, 54,
805 : 54, 54, 54, 54, 54, 54
806 : };
807 :
808 : /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
809 : static const yytype_int8 yyr2[] =
810 : {
811 : 0, 2, 1, 0, 1, 2, 1, 1, 1, 1,
812 : 1, 1, 1, 1, 2, 2, 0, 0, 11, 0,
813 : 5, 11, 12, 6, 2, 3, 1, 2, 1, 0,
814 : 1, 0, 2, 0, 1, 3, 4, 3, 2, 0,
815 : 1, 1, 2, 3, 1, 1, 1, 1, 1, 1,
816 : 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
817 : 1, 1, 1, 1, 1, 1
818 : };
819 :
820 :
821 : enum { YYENOMEM = -2 };
822 :
823 : #define yyerrok (yyerrstatus = 0)
824 : #define yyclearin (yychar = YYEMPTY)
825 :
826 : #define YYACCEPT goto yyacceptlab
827 : #define YYABORT goto yyabortlab
828 : #define YYERROR goto yyerrorlab
829 :
830 :
831 : #define YYRECOVERING() (!!yyerrstatus)
832 :
833 : #define YYBACKUP(Token, Value) \
834 : do \
835 : if (yychar == YYEMPTY) \
836 : { \
837 : yychar = (Token); \
838 : yylval = (Value); \
839 : YYPOPSTACK (yylen); \
840 : yystate = *yyssp; \
841 : goto yybackup; \
842 : } \
843 : else \
844 : { \
845 : yyerror (YY_("syntax error: cannot back up")); \
846 : YYERROR; \
847 : } \
848 : while (0)
849 :
850 : /* Backward compatibility with an undocumented macro.
851 : Use YYerror or YYUNDEF. */
852 : #define YYERRCODE YYUNDEF
853 :
854 :
855 : /* Enable debugging if requested. */
856 : #if YYDEBUG
857 :
858 : # ifndef YYFPRINTF
859 : # include <stdio.h> /* INFRINGES ON USER NAME SPACE */
860 : # define YYFPRINTF fprintf
861 : # endif
862 :
863 : # define YYDPRINTF(Args) \
864 : do { \
865 : if (yydebug) \
866 : YYFPRINTF Args; \
867 : } while (0)
868 :
869 : /* This macro is provided for backward compatibility. */
870 : # ifndef YY_LOCATION_PRINT
871 : # define YY_LOCATION_PRINT(File, Loc) ((void) 0)
872 : # endif
873 :
874 :
875 : # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \
876 : do { \
877 : if (yydebug) \
878 : { \
879 : YYFPRINTF (stderr, "%s ", Title); \
880 : yy_symbol_print (stderr, \
881 : Kind, Value); \
882 : YYFPRINTF (stderr, "\n"); \
883 : } \
884 : } while (0)
885 :
886 :
887 : /*-----------------------------------.
888 : | Print this symbol's value on YYO. |
889 : `-----------------------------------*/
890 :
891 : static void
892 : yy_symbol_value_print (FILE *yyo,
893 : yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
894 : {
895 : FILE *yyoutput = yyo;
896 : YY_USE (yyoutput);
897 : if (!yyvaluep)
898 : return;
899 : # ifdef YYPRINT
900 : if (yykind < YYNTOKENS)
901 : YYPRINT (yyo, yytoknum[yykind], *yyvaluep);
902 : # endif
903 : YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
904 : YY_USE (yykind);
905 : YY_IGNORE_MAYBE_UNINITIALIZED_END
906 : }
907 :
908 :
909 : /*---------------------------.
910 : | Print this symbol on YYO. |
911 : `---------------------------*/
912 :
913 : static void
914 : yy_symbol_print (FILE *yyo,
915 : yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep)
916 : {
917 : YYFPRINTF (yyo, "%s %s (",
918 : yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
919 :
920 : yy_symbol_value_print (yyo, yykind, yyvaluep);
921 : YYFPRINTF (yyo, ")");
922 : }
923 :
924 : /*------------------------------------------------------------------.
925 : | yy_stack_print -- Print the state stack from its BOTTOM up to its |
926 : | TOP (included). |
927 : `------------------------------------------------------------------*/
928 :
929 : static void
930 : yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
931 : {
932 : YYFPRINTF (stderr, "Stack now");
933 : for (; yybottom <= yytop; yybottom++)
934 : {
935 : int yybot = *yybottom;
936 : YYFPRINTF (stderr, " %d", yybot);
937 : }
938 : YYFPRINTF (stderr, "\n");
939 : }
940 :
941 : # define YY_STACK_PRINT(Bottom, Top) \
942 : do { \
943 : if (yydebug) \
944 : yy_stack_print ((Bottom), (Top)); \
945 : } while (0)
946 :
947 :
948 : /*------------------------------------------------.
949 : | Report that the YYRULE is going to be reduced. |
950 : `------------------------------------------------*/
951 :
952 : static void
953 : yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp,
954 : int yyrule)
955 : {
956 : int yylno = yyrline[yyrule];
957 : int yynrhs = yyr2[yyrule];
958 : int yyi;
959 : YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
960 : yyrule - 1, yylno);
961 : /* The symbols being reduced. */
962 : for (yyi = 0; yyi < yynrhs; yyi++)
963 : {
964 : YYFPRINTF (stderr, " $%d = ", yyi + 1);
965 : yy_symbol_print (stderr,
966 : YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]),
967 : &yyvsp[(yyi + 1) - (yynrhs)]);
968 : YYFPRINTF (stderr, "\n");
969 : }
970 : }
971 :
972 : # define YY_REDUCE_PRINT(Rule) \
973 : do { \
974 : if (yydebug) \
975 : yy_reduce_print (yyssp, yyvsp, Rule); \
976 : } while (0)
977 :
978 : /* Nonzero means print parse trace. It is left uninitialized so that
979 : multiple parsers can coexist. */
980 : int yydebug;
981 : #else /* !YYDEBUG */
982 : # define YYDPRINTF(Args) ((void) 0)
983 : # define YY_SYMBOL_PRINT(Title, Kind, Value, Location)
984 : # define YY_STACK_PRINT(Bottom, Top)
985 : # define YY_REDUCE_PRINT(Rule)
986 : #endif /* !YYDEBUG */
987 :
988 :
989 : /* YYINITDEPTH -- initial size of the parser's stacks. */
990 : #ifndef YYINITDEPTH
991 : # define YYINITDEPTH 200
992 : #endif
993 :
994 : /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
995 : if the built-in stack extension method is used).
996 :
997 : Do not make this value too large; the results are undefined if
998 : YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
999 : evaluated with infinite-precision integer arithmetic. */
1000 :
1001 : #ifndef YYMAXDEPTH
1002 : # define YYMAXDEPTH 10000
1003 : #endif
1004 :
1005 :
1006 :
1007 :
1008 :
1009 :
1010 : /*-----------------------------------------------.
1011 : | Release the memory associated to this symbol. |
1012 : `-----------------------------------------------*/
1013 :
1014 : static void
1015 160 : yydestruct (const char *yymsg,
1016 : yysymbol_kind_t yykind, YYSTYPE *yyvaluep)
1017 : {
1018 : YY_USE (yyvaluep);
1019 160 : if (!yymsg)
1020 0 : yymsg = "Deleting";
1021 : YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp);
1022 :
1023 : YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1024 : YY_USE (yykind);
1025 : YY_IGNORE_MAYBE_UNINITIALIZED_END
1026 160 : }
1027 :
1028 :
1029 : /* Lookahead token kind. */
1030 : int yychar;
1031 :
1032 : /* The semantic value of the lookahead symbol. */
1033 : YYSTYPE yylval;
1034 : /* Number of syntax errors so far. */
1035 : int yynerrs;
1036 :
1037 :
1038 :
1039 :
1040 : /*----------.
1041 : | yyparse. |
1042 : `----------*/
1043 :
1044 : int
1045 80 : yyparse (void)
1046 : {
1047 80 : yy_state_fast_t yystate = 0;
1048 : /* Number of tokens to shift before error messages enabled. */
1049 80 : int yyerrstatus = 0;
1050 :
1051 : /* Refer to the stacks through separate pointers, to allow yyoverflow
1052 : to reallocate them elsewhere. */
1053 :
1054 : /* Their size. */
1055 80 : YYPTRDIFF_T yystacksize = YYINITDEPTH;
1056 :
1057 : /* The state stack: array, bottom, top. */
1058 : yy_state_t yyssa[YYINITDEPTH];
1059 80 : yy_state_t *yyss = yyssa;
1060 80 : yy_state_t *yyssp = yyss;
1061 :
1062 : /* The semantic value stack: array, bottom, top. */
1063 : YYSTYPE yyvsa[YYINITDEPTH];
1064 80 : YYSTYPE *yyvs = yyvsa;
1065 80 : YYSTYPE *yyvsp = yyvs;
1066 :
1067 : int yyn;
1068 : /* The return value of yyparse. */
1069 : int yyresult;
1070 : /* Lookahead symbol kind. */
1071 80 : yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY;
1072 : /* The variables used to return semantic value and location from the
1073 : action routines. */
1074 : YYSTYPE yyval;
1075 :
1076 :
1077 :
1078 : #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
1079 :
1080 : /* The number of symbols on the RHS of the reduced rule.
1081 : Keep to zero when no symbol should be popped. */
1082 80 : int yylen = 0;
1083 :
1084 : YYDPRINTF ((stderr, "Starting parse\n"));
1085 :
1086 80 : yychar = YYEMPTY; /* Cause a token to be read. */
1087 80 : goto yysetstate;
1088 :
1089 :
1090 : /*------------------------------------------------------------.
1091 : | yynewstate -- push a new state, which is found in yystate. |
1092 : `------------------------------------------------------------*/
1093 54704658 : yynewstate:
1094 : /* In all cases, when you get here, the value and location stacks
1095 : have just been pushed. So pushing a state here evens the stacks. */
1096 54704658 : yyssp++;
1097 :
1098 :
1099 : /*--------------------------------------------------------------------.
1100 : | yysetstate -- set current state (the top of the stack) to yystate. |
1101 : `--------------------------------------------------------------------*/
1102 54704738 : yysetstate:
1103 : YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1104 : YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
1105 : YY_IGNORE_USELESS_CAST_BEGIN
1106 54704738 : *yyssp = YY_CAST (yy_state_t, yystate);
1107 : YY_IGNORE_USELESS_CAST_END
1108 : YY_STACK_PRINT (yyss, yyssp);
1109 :
1110 54704738 : if (yyss + yystacksize - 1 <= yyssp)
1111 : #if !defined yyoverflow && !defined YYSTACK_RELOCATE
1112 : goto yyexhaustedlab;
1113 : #else
1114 : {
1115 : /* Get the current used size of the three stacks, in elements. */
1116 0 : YYPTRDIFF_T yysize = yyssp - yyss + 1;
1117 :
1118 : # if defined yyoverflow
1119 : {
1120 : /* Give user a chance to reallocate the stack. Use copies of
1121 : these so that the &'s don't force the real ones into
1122 : memory. */
1123 : yy_state_t *yyss1 = yyss;
1124 : YYSTYPE *yyvs1 = yyvs;
1125 :
1126 : /* Each stack pointer address is followed by the size of the
1127 : data in use in that stack, in bytes. This used to be a
1128 : conditional around just the two extra args, but that might
1129 : be undefined if yyoverflow is a macro. */
1130 : yyoverflow (YY_("memory exhausted"),
1131 : &yyss1, yysize * YYSIZEOF (*yyssp),
1132 : &yyvs1, yysize * YYSIZEOF (*yyvsp),
1133 : &yystacksize);
1134 : yyss = yyss1;
1135 : yyvs = yyvs1;
1136 : }
1137 : # else /* defined YYSTACK_RELOCATE */
1138 : /* Extend the stack our own way. */
1139 0 : if (YYMAXDEPTH <= yystacksize)
1140 0 : goto yyexhaustedlab;
1141 0 : yystacksize *= 2;
1142 0 : if (YYMAXDEPTH < yystacksize)
1143 0 : yystacksize = YYMAXDEPTH;
1144 :
1145 : {
1146 0 : yy_state_t *yyss1 = yyss;
1147 : union yyalloc *yyptr =
1148 0 : YY_CAST (union yyalloc *,
1149 : YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
1150 0 : if (! yyptr)
1151 0 : goto yyexhaustedlab;
1152 0 : YYSTACK_RELOCATE (yyss_alloc, yyss);
1153 0 : YYSTACK_RELOCATE (yyvs_alloc, yyvs);
1154 : # undef YYSTACK_RELOCATE
1155 0 : if (yyss1 != yyssa)
1156 0 : YYSTACK_FREE (yyss1);
1157 : }
1158 : # endif
1159 :
1160 0 : yyssp = yyss + yysize - 1;
1161 0 : yyvsp = yyvs + yysize - 1;
1162 :
1163 : YY_IGNORE_USELESS_CAST_BEGIN
1164 : YYDPRINTF ((stderr, "Stack size increased to %ld\n",
1165 : YY_CAST (long, yystacksize)));
1166 : YY_IGNORE_USELESS_CAST_END
1167 :
1168 0 : if (yyss + yystacksize - 1 <= yyssp)
1169 0 : YYABORT;
1170 : }
1171 : #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
1172 :
1173 54704738 : if (yystate == YYFINAL)
1174 80 : YYACCEPT;
1175 :
1176 54704658 : goto yybackup;
1177 :
1178 :
1179 : /*-----------.
1180 : | yybackup. |
1181 : `-----------*/
1182 54704658 : yybackup:
1183 : /* Do appropriate processing given the current state. Read a
1184 : lookahead token if we need one and don't already have one. */
1185 :
1186 : /* First try to decide what to do without reference to lookahead token. */
1187 54704658 : yyn = yypact[yystate];
1188 54704658 : if (yypact_value_is_default (yyn))
1189 39104818 : goto yydefault;
1190 :
1191 : /* Not known => get a lookahead token if don't already have one. */
1192 :
1193 : /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */
1194 15599840 : if (yychar == YYEMPTY)
1195 : {
1196 : YYDPRINTF ((stderr, "Reading a token\n"));
1197 15536320 : yychar = yylex ();
1198 : }
1199 :
1200 15599840 : if (yychar <= YYEOF)
1201 : {
1202 160 : yychar = YYEOF;
1203 160 : yytoken = YYSYMBOL_YYEOF;
1204 : YYDPRINTF ((stderr, "Now at end of input.\n"));
1205 : }
1206 15599680 : else if (yychar == YYerror)
1207 : {
1208 : /* The scanner already issued an error message, process directly
1209 : to error recovery. But do not keep the error token as
1210 : lookahead, it is too special and may lead us to an endless
1211 : loop in error recovery. */
1212 0 : yychar = YYUNDEF;
1213 0 : yytoken = YYSYMBOL_YYerror;
1214 0 : goto yyerrlab1;
1215 : }
1216 : else
1217 : {
1218 15599680 : yytoken = YYTRANSLATE (yychar);
1219 : YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
1220 : }
1221 :
1222 : /* If the proper action on seeing token YYTOKEN is to reduce or to
1223 : detect an error, take that action. */
1224 15599840 : yyn += yytoken;
1225 15599840 : if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1226 63520 : goto yydefault;
1227 15536320 : yyn = yytable[yyn];
1228 15536320 : if (yyn <= 0)
1229 : {
1230 : if (yytable_value_is_error (yyn))
1231 : goto yyerrlab;
1232 0 : yyn = -yyn;
1233 0 : goto yyreduce;
1234 : }
1235 :
1236 : /* Count tokens shifted since error; after three, turn off error
1237 : status. */
1238 15536320 : if (yyerrstatus)
1239 0 : yyerrstatus--;
1240 :
1241 : /* Shift the lookahead token. */
1242 : YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
1243 15536320 : yystate = yyn;
1244 : YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1245 15536320 : *++yyvsp = yylval;
1246 : YY_IGNORE_MAYBE_UNINITIALIZED_END
1247 :
1248 : /* Discard the shifted token. */
1249 15536320 : yychar = YYEMPTY;
1250 15536320 : goto yynewstate;
1251 :
1252 :
1253 : /*-----------------------------------------------------------.
1254 : | yydefault -- do the default action for the current state. |
1255 : `-----------------------------------------------------------*/
1256 39168338 : yydefault:
1257 39168338 : yyn = yydefact[yystate];
1258 39168338 : if (yyn == 0)
1259 0 : goto yyerrlab;
1260 39168338 : goto yyreduce;
1261 :
1262 :
1263 : /*-----------------------------.
1264 : | yyreduce -- do a reduction. |
1265 : `-----------------------------*/
1266 39168338 : yyreduce:
1267 : /* yyn is the number of a rule to reduce with. */
1268 39168338 : yylen = yyr2[yyn];
1269 :
1270 : /* If YYLEN is nonzero, implement the default value of the action:
1271 : '$$ = $1'.
1272 :
1273 : Otherwise, the following line sets YYVAL to garbage.
1274 : This behavior is undocumented and Bison
1275 : users should not rely upon it. Assigning to YYVAL
1276 : unconditionally makes the parser a bit smaller, and it avoids a
1277 : GCC warning that YYVAL may be used uninitialized. */
1278 39168338 : yyval = yyvsp[1-yylen];
1279 :
1280 :
1281 : YY_REDUCE_PRINT (yyn);
1282 39168338 : switch (yyn)
1283 : {
1284 4800 : case 14: /* Boot_OpenStmt: OPEN boot_ident */
1285 : #line 134 "bootparse.y"
1286 : {
1287 : do_start();
1288 : boot_openrel((yyvsp[0].str));
1289 : do_end();
1290 : }
1291 : #line 1292 "bootparse.c"
1292 4800 : break;
1293 :
1294 5120 : case 15: /* Boot_CloseStmt: XCLOSE boot_ident */
1295 : #line 143 "bootparse.y"
1296 : {
1297 : do_start();
1298 : closerel((yyvsp[0].str));
1299 : do_end();
1300 : }
1301 : #line 1302 "bootparse.c"
1302 5120 : break;
1303 :
1304 5120 : case 16: /* $@1: %empty */
1305 : #line 152 "bootparse.y"
1306 : {
1307 : do_start();
1308 : numattr = 0;
1309 : elog(DEBUG4, "creating%s%s relation %s %u",
1310 : (yyvsp[-3].ival) ? " bootstrap" : "",
1311 : (yyvsp[-2].ival) ? " shared" : "",
1312 : (yyvsp[-5].str),
1313 : (yyvsp[-4].oidval));
1314 : }
1315 : #line 1316 "bootparse.c"
1316 5120 : break;
1317 :
1318 5120 : case 17: /* $@2: %empty */
1319 : #line 162 "bootparse.y"
1320 : {
1321 : do_end();
1322 : }
1323 : #line 1324 "bootparse.c"
1324 5120 : break;
1325 :
1326 5120 : case 18: /* Boot_CreateStmt: XCREATE boot_ident oidspec optbootstrap optsharedrelation optrowtypeoid LPAREN $@1 boot_column_list $@2 RPAREN */
1327 : #line 166 "bootparse.y"
1328 : {
1329 : TupleDesc tupdesc;
1330 : bool shared_relation;
1331 : bool mapped_relation;
1332 :
1333 : do_start();
1334 :
1335 : tupdesc = CreateTupleDesc(numattr, attrtypes);
1336 :
1337 : shared_relation = (yyvsp[-6].ival);
1338 :
1339 : /*
1340 : * The catalogs that use the relation mapper are the
1341 : * bootstrap catalogs plus the shared catalogs. If this
1342 : * ever gets more complicated, we should invent a BKI
1343 : * keyword to mark the mapped catalogs, but for now a
1344 : * quick hack seems the most appropriate thing. Note in
1345 : * particular that all "nailed" heap rels (see formrdesc
1346 : * in relcache.c) must be mapped.
1347 : */
1348 : mapped_relation = ((yyvsp[-7].ival) || shared_relation);
1349 :
1350 : if ((yyvsp[-7].ival))
1351 : {
1352 : TransactionId relfrozenxid;
1353 : MultiXactId relminmxid;
1354 :
1355 : if (boot_reldesc)
1356 : {
1357 : elog(DEBUG4, "create bootstrap: warning, open relation exists, closing first");
1358 : closerel(NULL);
1359 : }
1360 :
1361 : boot_reldesc = heap_create((yyvsp[-9].str),
1362 : PG_CATALOG_NAMESPACE,
1363 : shared_relation ? GLOBALTABLESPACE_OID : 0,
1364 : (yyvsp[-8].oidval),
1365 : InvalidOid,
1366 : HEAP_TABLE_AM_OID,
1367 : tupdesc,
1368 : RELKIND_RELATION,
1369 : RELPERSISTENCE_PERMANENT,
1370 : shared_relation,
1371 : mapped_relation,
1372 : true,
1373 : &relfrozenxid,
1374 : &relminmxid,
1375 : true);
1376 : elog(DEBUG4, "bootstrap relation created");
1377 : }
1378 : else
1379 : {
1380 : Oid id;
1381 :
1382 : id = heap_create_with_catalog((yyvsp[-9].str),
1383 : PG_CATALOG_NAMESPACE,
1384 : shared_relation ? GLOBALTABLESPACE_OID : 0,
1385 : (yyvsp[-8].oidval),
1386 : (yyvsp[-5].oidval),
1387 : InvalidOid,
1388 : BOOTSTRAP_SUPERUSERID,
1389 : HEAP_TABLE_AM_OID,
1390 : tupdesc,
1391 : NIL,
1392 : RELKIND_RELATION,
1393 : RELPERSISTENCE_PERMANENT,
1394 : shared_relation,
1395 : mapped_relation,
1396 : ONCOMMIT_NOOP,
1397 : (Datum) 0,
1398 : false,
1399 : true,
1400 : false,
1401 : InvalidOid,
1402 : NULL);
1403 : elog(DEBUG4, "relation created with OID %u", id);
1404 : }
1405 : do_end();
1406 : }
1407 : #line 1408 "bootparse.c"
1408 5120 : break;
1409 :
1410 848240 : case 19: /* $@3: %empty */
1411 : #line 249 "bootparse.y"
1412 : {
1413 : do_start();
1414 : elog(DEBUG4, "inserting row");
1415 : num_columns_read = 0;
1416 : }
1417 : #line 1418 "bootparse.c"
1418 848240 : break;
1419 :
1420 848240 : case 20: /* Boot_InsertStmt: INSERT_TUPLE $@3 LPAREN boot_column_val_list RPAREN */
1421 : #line 255 "bootparse.y"
1422 : {
1423 : if (num_columns_read != numattr)
1424 : elog(ERROR, "incorrect number of columns in row (expected %d, got %d)",
1425 : numattr, num_columns_read);
1426 : if (boot_reldesc == NULL)
1427 : elog(FATAL, "relation not open");
1428 : InsertOneTuple();
1429 : do_end();
1430 : }
1431 : #line 1432 "bootparse.c"
1432 848240 : break;
1433 :
1434 1120 : case 21: /* Boot_DeclareIndexStmt: XDECLARE INDEX boot_ident oidspec ON boot_ident USING boot_ident LPAREN boot_index_params RPAREN */
1435 : #line 268 "bootparse.y"
1436 : {
1437 : IndexStmt *stmt = makeNode(IndexStmt);
1438 : Oid relationId;
1439 :
1440 : elog(DEBUG4, "creating index \"%s\"", (yyvsp[-8].str));
1441 :
1442 : do_start();
1443 :
1444 : stmt->idxname = (yyvsp[-8].str);
1445 : stmt->relation = makeRangeVar(NULL, (yyvsp[-5].str), -1);
1446 : stmt->accessMethod = (yyvsp[-3].str);
1447 : stmt->tableSpace = NULL;
1448 : stmt->indexParams = (yyvsp[-1].list);
1449 : stmt->indexIncludingParams = NIL;
1450 : stmt->options = NIL;
1451 : stmt->whereClause = NULL;
1452 : stmt->excludeOpNames = NIL;
1453 : stmt->idxcomment = NULL;
1454 : stmt->indexOid = InvalidOid;
1455 : stmt->oldNumber = InvalidRelFileNumber;
1456 : stmt->oldCreateSubid = InvalidSubTransactionId;
1457 : stmt->oldFirstRelfilelocatorSubid = InvalidSubTransactionId;
1458 : stmt->unique = false;
1459 : stmt->primary = false;
1460 : stmt->isconstraint = false;
1461 : stmt->deferrable = false;
1462 : stmt->initdeferred = false;
1463 : stmt->transformed = false;
1464 : stmt->concurrent = false;
1465 : stmt->if_not_exists = false;
1466 : stmt->reset_default_tblspc = false;
1467 :
1468 : /* locks and races need not concern us in bootstrap mode */
1469 : relationId = RangeVarGetRelid(stmt->relation, NoLock,
1470 : false);
1471 :
1472 : DefineIndex(relationId,
1473 : stmt,
1474 : (yyvsp[-7].oidval),
1475 : InvalidOid,
1476 : InvalidOid,
1477 : -1,
1478 : false,
1479 : false,
1480 : false,
1481 : true, /* skip_build */
1482 : false);
1483 : do_end();
1484 : }
1485 : #line 1486 "bootparse.c"
1486 1120 : break;
1487 :
1488 8800 : case 22: /* Boot_DeclareUniqueIndexStmt: XDECLARE UNIQUE INDEX boot_ident oidspec ON boot_ident USING boot_ident LPAREN boot_index_params RPAREN */
1489 : #line 321 "bootparse.y"
1490 : {
1491 : IndexStmt *stmt = makeNode(IndexStmt);
1492 : Oid relationId;
1493 :
1494 : elog(DEBUG4, "creating unique index \"%s\"", (yyvsp[-8].str));
1495 :
1496 : do_start();
1497 :
1498 : stmt->idxname = (yyvsp[-8].str);
1499 : stmt->relation = makeRangeVar(NULL, (yyvsp[-5].str), -1);
1500 : stmt->accessMethod = (yyvsp[-3].str);
1501 : stmt->tableSpace = NULL;
1502 : stmt->indexParams = (yyvsp[-1].list);
1503 : stmt->indexIncludingParams = NIL;
1504 : stmt->options = NIL;
1505 : stmt->whereClause = NULL;
1506 : stmt->excludeOpNames = NIL;
1507 : stmt->idxcomment = NULL;
1508 : stmt->indexOid = InvalidOid;
1509 : stmt->oldNumber = InvalidRelFileNumber;
1510 : stmt->oldCreateSubid = InvalidSubTransactionId;
1511 : stmt->oldFirstRelfilelocatorSubid = InvalidSubTransactionId;
1512 : stmt->unique = true;
1513 : stmt->primary = false;
1514 : stmt->isconstraint = false;
1515 : stmt->deferrable = false;
1516 : stmt->initdeferred = false;
1517 : stmt->transformed = false;
1518 : stmt->concurrent = false;
1519 : stmt->if_not_exists = false;
1520 : stmt->reset_default_tblspc = false;
1521 :
1522 : /* locks and races need not concern us in bootstrap mode */
1523 : relationId = RangeVarGetRelid(stmt->relation, NoLock,
1524 : false);
1525 :
1526 : DefineIndex(relationId,
1527 : stmt,
1528 : (yyvsp[-7].oidval),
1529 : InvalidOid,
1530 : InvalidOid,
1531 : -1,
1532 : false,
1533 : false,
1534 : false,
1535 : true, /* skip_build */
1536 : false);
1537 : do_end();
1538 : }
1539 : #line 1540 "bootparse.c"
1540 8800 : break;
1541 :
1542 2880 : case 23: /* Boot_DeclareToastStmt: XDECLARE XTOAST oidspec oidspec ON boot_ident */
1543 : #line 374 "bootparse.y"
1544 : {
1545 : elog(DEBUG4, "creating toast table for table \"%s\"", (yyvsp[0].str));
1546 :
1547 : do_start();
1548 :
1549 : BootstrapToastTable((yyvsp[0].str), (yyvsp[-3].oidval), (yyvsp[-2].oidval));
1550 : do_end();
1551 : }
1552 : #line 1553 "bootparse.c"
1553 2880 : break;
1554 :
1555 80 : case 24: /* Boot_BuildIndsStmt: XBUILD INDICES */
1556 : #line 386 "bootparse.y"
1557 : {
1558 : do_start();
1559 : build_indices();
1560 : do_end();
1561 : }
1562 : #line 1563 "bootparse.c"
1563 80 : break;
1564 :
1565 6480 : case 25: /* boot_index_params: boot_index_params COMMA boot_index_param */
1566 : #line 395 "bootparse.y"
1567 : { (yyval.list) = lappend((yyvsp[-2].list), (yyvsp[0].ielem)); }
1568 : #line 1569 "bootparse.c"
1569 6480 : break;
1570 :
1571 9920 : case 26: /* boot_index_params: boot_index_param */
1572 : #line 396 "bootparse.y"
1573 : { (yyval.list) = list_make1((yyvsp[0].ielem)); }
1574 : #line 1575 "bootparse.c"
1575 9920 : break;
1576 :
1577 16400 : case 27: /* boot_index_param: boot_ident boot_ident */
1578 : #line 401 "bootparse.y"
1579 : {
1580 : IndexElem *n = makeNode(IndexElem);
1581 :
1582 : n->name = (yyvsp[-1].str);
1583 : n->expr = NULL;
1584 : n->indexcolname = NULL;
1585 : n->collation = NIL;
1586 : n->opclass = list_make1(makeString((yyvsp[0].str)));
1587 : n->ordering = SORTBY_DEFAULT;
1588 : n->nulls_ordering = SORTBY_NULLS_DEFAULT;
1589 : (yyval.ielem) = n;
1590 : }
1591 : #line 1592 "bootparse.c"
1592 16400 : break;
1593 :
1594 320 : case 28: /* optbootstrap: XBOOTSTRAP */
1595 : #line 416 "bootparse.y"
1596 : { (yyval.ival) = 1; }
1597 : #line 1598 "bootparse.c"
1598 320 : break;
1599 :
1600 4800 : case 29: /* optbootstrap: %empty */
1601 : #line 417 "bootparse.y"
1602 : { (yyval.ival) = 0; }
1603 : #line 1604 "bootparse.c"
1604 4800 : break;
1605 :
1606 880 : case 30: /* optsharedrelation: XSHARED_RELATION */
1607 : #line 421 "bootparse.y"
1608 : { (yyval.ival) = 1; }
1609 : #line 1610 "bootparse.c"
1610 880 : break;
1611 :
1612 4240 : case 31: /* optsharedrelation: %empty */
1613 : #line 422 "bootparse.y"
1614 : { (yyval.ival) = 0; }
1615 : #line 1616 "bootparse.c"
1616 4240 : break;
1617 :
1618 720 : case 32: /* optrowtypeoid: XROWTYPE_OID oidspec */
1619 : #line 426 "bootparse.y"
1620 : { (yyval.oidval) = (yyvsp[0].oidval); }
1621 : #line 1622 "bootparse.c"
1622 720 : break;
1623 :
1624 4400 : case 33: /* optrowtypeoid: %empty */
1625 : #line 427 "bootparse.y"
1626 : { (yyval.oidval) = InvalidOid; }
1627 : #line 1628 "bootparse.c"
1628 4400 : break;
1629 :
1630 47920 : case 36: /* boot_column_def: boot_ident EQUALS boot_ident boot_column_nullness */
1631 : #line 437 "bootparse.y"
1632 : {
1633 : if (++numattr > MAXATTR)
1634 : elog(FATAL, "too many columns");
1635 : DefineAttr((yyvsp[-3].str), (yyvsp[-1].str), numattr-1, (yyvsp[0].ival));
1636 : }
1637 : #line 1638 "bootparse.c"
1638 47920 : break;
1639 :
1640 2720 : case 37: /* boot_column_nullness: XFORCE XNOT XNULL */
1641 : #line 445 "bootparse.y"
1642 : { (yyval.ival) = BOOTCOL_NULL_FORCE_NOT_NULL; }
1643 : #line 1644 "bootparse.c"
1644 2720 : break;
1645 :
1646 320 : case 38: /* boot_column_nullness: XFORCE XNULL */
1647 : #line 446 "bootparse.y"
1648 : { (yyval.ival) = BOOTCOL_NULL_FORCE_NULL; }
1649 : #line 1650 "bootparse.c"
1650 320 : break;
1651 :
1652 44880 : case 39: /* boot_column_nullness: %empty */
1653 : #line 447 "bootparse.y"
1654 : { (yyval.ival) = BOOTCOL_NULL_AUTO; }
1655 : #line 1656 "bootparse.c"
1656 44880 : break;
1657 :
1658 21520 : case 40: /* oidspec: boot_ident */
1659 : #line 451 "bootparse.y"
1660 : { (yyval.oidval) = atooid((yyvsp[0].str)); }
1661 : #line 1662 "bootparse.c"
1662 21520 : break;
1663 :
1664 10103298 : case 44: /* boot_column_val: boot_ident */
1665 : #line 462 "bootparse.y"
1666 : { InsertOneValue((yyvsp[0].str), num_columns_read++); }
1667 : #line 1668 "bootparse.c"
1668 10103298 : break;
1669 :
1670 2480062 : case 45: /* boot_column_val: NULLVAL */
1671 : #line 464 "bootparse.y"
1672 : { InsertOneNull(num_columns_read++); }
1673 : #line 1674 "bootparse.c"
1674 2480062 : break;
1675 :
1676 10301138 : case 46: /* boot_ident: ID */
1677 : #line 468 "bootparse.y"
1678 : { (yyval.str) = (yyvsp[0].str); }
1679 : #line 1680 "bootparse.c"
1680 10301138 : break;
1681 :
1682 0 : case 47: /* boot_ident: OPEN */
1683 : #line 469 "bootparse.y"
1684 : { (yyval.str) = pstrdup((yyvsp[0].kw)); }
1685 : #line 1686 "bootparse.c"
1686 0 : break;
1687 :
1688 0 : case 48: /* boot_ident: XCLOSE */
1689 : #line 470 "bootparse.y"
1690 : { (yyval.str) = pstrdup((yyvsp[0].kw)); }
1691 : #line 1692 "bootparse.c"
1692 0 : break;
1693 :
1694 0 : case 49: /* boot_ident: XCREATE */
1695 : #line 471 "bootparse.y"
1696 : { (yyval.str) = pstrdup((yyvsp[0].kw)); }
1697 : #line 1698 "bootparse.c"
1698 0 : break;
1699 :
1700 0 : case 50: /* boot_ident: INSERT_TUPLE */
1701 : #line 472 "bootparse.y"
1702 : { (yyval.str) = pstrdup((yyvsp[0].kw)); }
1703 : #line 1704 "bootparse.c"
1704 0 : break;
1705 :
1706 0 : case 51: /* boot_ident: XDECLARE */
1707 : #line 473 "bootparse.y"
1708 : { (yyval.str) = pstrdup((yyvsp[0].kw)); }
1709 : #line 1710 "bootparse.c"
1710 0 : break;
1711 :
1712 0 : case 52: /* boot_ident: INDEX */
1713 : #line 474 "bootparse.y"
1714 : { (yyval.str) = pstrdup((yyvsp[0].kw)); }
1715 : #line 1716 "bootparse.c"
1716 0 : break;
1717 :
1718 0 : case 53: /* boot_ident: ON */
1719 : #line 475 "bootparse.y"
1720 : { (yyval.str) = pstrdup((yyvsp[0].kw)); }
1721 : #line 1722 "bootparse.c"
1722 0 : break;
1723 :
1724 0 : case 54: /* boot_ident: USING */
1725 : #line 476 "bootparse.y"
1726 : { (yyval.str) = pstrdup((yyvsp[0].kw)); }
1727 : #line 1728 "bootparse.c"
1728 0 : break;
1729 :
1730 0 : case 55: /* boot_ident: XBUILD */
1731 : #line 477 "bootparse.y"
1732 : { (yyval.str) = pstrdup((yyvsp[0].kw)); }
1733 : #line 1734 "bootparse.c"
1734 0 : break;
1735 :
1736 0 : case 56: /* boot_ident: INDICES */
1737 : #line 478 "bootparse.y"
1738 : { (yyval.str) = pstrdup((yyvsp[0].kw)); }
1739 : #line 1740 "bootparse.c"
1740 0 : break;
1741 :
1742 0 : case 57: /* boot_ident: UNIQUE */
1743 : #line 479 "bootparse.y"
1744 : { (yyval.str) = pstrdup((yyvsp[0].kw)); }
1745 : #line 1746 "bootparse.c"
1746 0 : break;
1747 :
1748 0 : case 58: /* boot_ident: XTOAST */
1749 : #line 480 "bootparse.y"
1750 : { (yyval.str) = pstrdup((yyvsp[0].kw)); }
1751 : #line 1752 "bootparse.c"
1752 0 : break;
1753 :
1754 0 : case 59: /* boot_ident: OBJ_ID */
1755 : #line 481 "bootparse.y"
1756 : { (yyval.str) = pstrdup((yyvsp[0].kw)); }
1757 : #line 1758 "bootparse.c"
1758 0 : break;
1759 :
1760 0 : case 60: /* boot_ident: XBOOTSTRAP */
1761 : #line 482 "bootparse.y"
1762 : { (yyval.str) = pstrdup((yyvsp[0].kw)); }
1763 : #line 1764 "bootparse.c"
1764 0 : break;
1765 :
1766 0 : case 61: /* boot_ident: XSHARED_RELATION */
1767 : #line 483 "bootparse.y"
1768 : { (yyval.str) = pstrdup((yyvsp[0].kw)); }
1769 : #line 1770 "bootparse.c"
1770 0 : break;
1771 :
1772 0 : case 62: /* boot_ident: XROWTYPE_OID */
1773 : #line 484 "bootparse.y"
1774 : { (yyval.str) = pstrdup((yyvsp[0].kw)); }
1775 : #line 1776 "bootparse.c"
1776 0 : break;
1777 :
1778 0 : case 63: /* boot_ident: XFORCE */
1779 : #line 485 "bootparse.y"
1780 : { (yyval.str) = pstrdup((yyvsp[0].kw)); }
1781 : #line 1782 "bootparse.c"
1782 0 : break;
1783 :
1784 0 : case 64: /* boot_ident: XNOT */
1785 : #line 486 "bootparse.y"
1786 : { (yyval.str) = pstrdup((yyvsp[0].kw)); }
1787 : #line 1788 "bootparse.c"
1788 0 : break;
1789 :
1790 0 : case 65: /* boot_ident: XNULL */
1791 : #line 487 "bootparse.y"
1792 : { (yyval.str) = pstrdup((yyvsp[0].kw)); }
1793 : #line 1794 "bootparse.c"
1794 0 : break;
1795 :
1796 :
1797 : #line 1798 "bootparse.c"
1798 :
1799 14383680 : default: break;
1800 : }
1801 : /* User semantic actions sometimes alter yychar, and that requires
1802 : that yytoken be updated with the new translation. We take the
1803 : approach of translating immediately before every use of yytoken.
1804 : One alternative is translating here after every semantic action,
1805 : but that translation would be missed if the semantic action invokes
1806 : YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
1807 : if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
1808 : incorrect destructor might then be invoked immediately. In the
1809 : case of YYERROR or YYBACKUP, subsequent parser actions might lead
1810 : to an incorrect destructor call or verbose syntax error message
1811 : before the lookahead is translated. */
1812 : YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc);
1813 :
1814 39168338 : YYPOPSTACK (yylen);
1815 39168338 : yylen = 0;
1816 :
1817 39168338 : *++yyvsp = yyval;
1818 :
1819 : /* Now 'shift' the result of the reduction. Determine what state
1820 : that goes to, based on the state we popped back to and the rule
1821 : number reduced by. */
1822 : {
1823 39168338 : const int yylhs = yyr1[yyn] - YYNTOKENS;
1824 39168338 : const int yyi = yypgoto[yylhs] + *yyssp;
1825 23974098 : yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
1826 22970978 : ? yytable[yyi]
1827 63142436 : : yydefgoto[yylhs]);
1828 : }
1829 :
1830 39168338 : goto yynewstate;
1831 :
1832 :
1833 : /*--------------------------------------.
1834 : | yyerrlab -- here on detecting error. |
1835 : `--------------------------------------*/
1836 0 : yyerrlab:
1837 : /* Make sure we have latest lookahead translation. See comments at
1838 : user semantic actions for why this is necessary. */
1839 0 : yytoken = yychar == YYEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar);
1840 : /* If not already recovering from an error, report this error. */
1841 0 : if (!yyerrstatus)
1842 : {
1843 0 : ++yynerrs;
1844 0 : yyerror (YY_("syntax error"));
1845 : }
1846 :
1847 0 : if (yyerrstatus == 3)
1848 : {
1849 : /* If just tried and failed to reuse lookahead token after an
1850 : error, discard it. */
1851 :
1852 0 : if (yychar <= YYEOF)
1853 : {
1854 : /* Return failure if at end of input. */
1855 0 : if (yychar == YYEOF)
1856 0 : YYABORT;
1857 : }
1858 : else
1859 : {
1860 0 : yydestruct ("Error: discarding",
1861 : yytoken, &yylval);
1862 0 : yychar = YYEMPTY;
1863 : }
1864 : }
1865 :
1866 : /* Else will try to reuse lookahead token after shifting the error
1867 : token. */
1868 0 : goto yyerrlab1;
1869 :
1870 :
1871 : /*---------------------------------------------------.
1872 : | yyerrorlab -- error raised explicitly by YYERROR. |
1873 : `---------------------------------------------------*/
1874 : yyerrorlab:
1875 : /* Pacify compilers when the user code never invokes YYERROR and the
1876 : label yyerrorlab therefore never appears in user code. */
1877 : if (0)
1878 : YYERROR;
1879 :
1880 : /* Do not reclaim the symbols of the rule whose action triggered
1881 : this YYERROR. */
1882 : YYPOPSTACK (yylen);
1883 : yylen = 0;
1884 : YY_STACK_PRINT (yyss, yyssp);
1885 : yystate = *yyssp;
1886 : goto yyerrlab1;
1887 :
1888 :
1889 : /*-------------------------------------------------------------.
1890 : | yyerrlab1 -- common code for both syntax error and YYERROR. |
1891 : `-------------------------------------------------------------*/
1892 0 : yyerrlab1:
1893 0 : yyerrstatus = 3; /* Each real token shifted decrements this. */
1894 :
1895 : /* Pop stack until we find a state that shifts the error token. */
1896 : for (;;)
1897 : {
1898 0 : yyn = yypact[yystate];
1899 0 : if (!yypact_value_is_default (yyn))
1900 : {
1901 0 : yyn += YYSYMBOL_YYerror;
1902 0 : if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror)
1903 : {
1904 0 : yyn = yytable[yyn];
1905 0 : if (0 < yyn)
1906 0 : break;
1907 : }
1908 : }
1909 :
1910 : /* Pop the current state because it cannot handle the error token. */
1911 0 : if (yyssp == yyss)
1912 0 : YYABORT;
1913 :
1914 :
1915 0 : yydestruct ("Error: popping",
1916 0 : YY_ACCESSING_SYMBOL (yystate), yyvsp);
1917 0 : YYPOPSTACK (1);
1918 0 : yystate = *yyssp;
1919 : YY_STACK_PRINT (yyss, yyssp);
1920 : }
1921 :
1922 : YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
1923 0 : *++yyvsp = yylval;
1924 : YY_IGNORE_MAYBE_UNINITIALIZED_END
1925 :
1926 :
1927 : /* Shift the error token. */
1928 : YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp);
1929 :
1930 0 : yystate = yyn;
1931 0 : goto yynewstate;
1932 :
1933 :
1934 : /*-------------------------------------.
1935 : | yyacceptlab -- YYACCEPT comes here. |
1936 : `-------------------------------------*/
1937 80 : yyacceptlab:
1938 80 : yyresult = 0;
1939 80 : goto yyreturn;
1940 :
1941 :
1942 : /*-----------------------------------.
1943 : | yyabortlab -- YYABORT comes here. |
1944 : `-----------------------------------*/
1945 0 : yyabortlab:
1946 0 : yyresult = 1;
1947 0 : goto yyreturn;
1948 :
1949 :
1950 : #if !defined yyoverflow
1951 : /*-------------------------------------------------.
1952 : | yyexhaustedlab -- memory exhaustion comes here. |
1953 : `-------------------------------------------------*/
1954 0 : yyexhaustedlab:
1955 0 : yyerror (YY_("memory exhausted"));
1956 : yyresult = 2;
1957 : goto yyreturn;
1958 : #endif
1959 :
1960 :
1961 : /*-------------------------------------------------------.
1962 : | yyreturn -- parsing is finished, clean up and return. |
1963 : `-------------------------------------------------------*/
1964 80 : yyreturn:
1965 80 : if (yychar != YYEMPTY)
1966 : {
1967 : /* Make sure we have latest lookahead translation. See comments at
1968 : user semantic actions for why this is necessary. */
1969 0 : yytoken = YYTRANSLATE (yychar);
1970 0 : yydestruct ("Cleanup: discarding lookahead",
1971 : yytoken, &yylval);
1972 : }
1973 : /* Do not reclaim the symbols of the rule whose action triggered
1974 : this YYABORT or YYACCEPT. */
1975 80 : YYPOPSTACK (yylen);
1976 : YY_STACK_PRINT (yyss, yyssp);
1977 240 : while (yyssp != yyss)
1978 : {
1979 160 : yydestruct ("Cleanup: popping",
1980 160 : YY_ACCESSING_SYMBOL (+*yyssp), yyvsp);
1981 160 : YYPOPSTACK (1);
1982 : }
1983 : #ifndef yyoverflow
1984 80 : if (yyss != yyssa)
1985 0 : YYSTACK_FREE (yyss);
1986 : #endif
1987 :
1988 80 : return yyresult;
1989 : }
1990 :
1991 : #line 489 "bootparse.y"
1992 :
|