]> granicus.if.org Git - postgresql/commitdiff
Remove dead code in bootstrap
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Tue, 17 Jan 2017 19:54:40 +0000 (16:54 -0300)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Tue, 17 Jan 2017 19:54:40 +0000 (16:54 -0300)
The bootstrap scanner/parser contains code to parse floating point
values, but this is not exercised anywhere, so remove it.

Reviewed-by: Jim Nasby
Discussion: https://postgr.es/m/20170110051119.b5h7i3z5qagy35rb@alvherre.pgsql

src/backend/bootstrap/bootparse.y
src/backend/bootstrap/bootscanner.l

index d28af23c944a02a0ec5d3546a03ebfc5a16885ba..33d9f0b3c672e2a83dd6c0b802c7b7a956a28733 100644 (file)
@@ -105,11 +105,11 @@ static int num_columns_read = 0;
 
 %type <list>  boot_index_params
 %type <ielem> boot_index_param
-%type <str>   boot_const boot_ident
+%type <str>   boot_ident
 %type <ival>  optbootstrap optsharedrelation optwithoutoids boot_column_nullness
 %type <oidval> oidspec optoideq optrowtypeoid
 
-%token <str> CONST_P ID
+%token <str> ID
 %token OPEN XCLOSE XCREATE INSERT_TUPLE
 %token XDECLARE INDEX ON USING XBUILD INDICES UNIQUE XTOAST
 %token COMMA EQUALS LPAREN RPAREN
@@ -464,16 +464,10 @@ boot_column_val_list:
 boot_column_val:
                  boot_ident
                        { InsertOneValue($1, num_columns_read++); }
-               | boot_const
-                       { InsertOneValue($1, num_columns_read++); }
                | NULLVAL
                        { InsertOneNull(num_columns_read++); }
                ;
 
-boot_const :
-                 CONST_P { $$ = yylval.str; }
-               ;
-
 boot_ident :
                  ID    { $$ = yylval.str; }
                ;
index 9cfd19c0c36529dc7ef8673051f529ce37face60..6467882fa37e199f88bbca28727eaea86f740a6d 100644 (file)
@@ -66,7 +66,6 @@ static int    yyline = 1;                     /* line number for error reporting */
 
 D              [0-9]
 oct            \\{D}{D}{D}
-Exp            [Ee][-+]?{D}+
 id             ([A-Za-z0-9_]|{oct}|\-)+
 sid            \"([^\"])*\"
 arrayid [A-Za-z0-9_]+\[{D}*\]
@@ -127,13 +126,6 @@ insert                     { return(INSERT_TUPLE); }
                                        return(ID);
                                }
 
-(-)?{D}+"."{D}*({Exp})? |
-(-)?{D}*"."{D}+({Exp})? |
-(-)?{D}+{Exp}                  {
-                                                       yylval.str = pstrdup(yytext);
-                                                       return(CONST_P);
-                                               }
-
 .                              {
                                        elog(ERROR, "syntax error at line %d: unexpected character \"%s\"", yyline, yytext);
                                }