LCOV - code coverage report
Current view: top level - src/backend/bootstrap - bootparse.c (source / functions) Hit Total Coverage
Test: PostgreSQL Lines: 94 155 60.6 %
Date: 2017-09-29 15:12:54 Functions: 2 2 100.0 %
Legend: Lines: hit not hit

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

Generated by: LCOV version 1.11