pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Pg Hackers <pgsql-hackers@postgresql.org>
Subject: remove floats from bootstrap scanner/parser
Date: Tue, 10 Jan 2017 02:11:19 -0300
Message-ID: <20170110051119.b5h7i3z5qagy35rb@alvherre.pgsql> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

I happened to notice that we have dead code to parse floating point
numbers in the boostrap scanner/parser.  This seems unused since forever
-- or, more precisely, I couldn't find any floats in 8.2's postgres.bki
(the oldest I have around).  I would just rip it out, per the attached.

-- 
Álvaro Herrera

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Attachments:

parseboot.patch (text/plain, 1.7K) download diff --git a/src/backend/bootstrap/bootparse.y b/src/backend/bootstrap/bootparse.y index d28af23..33d9f0b 100644 --- a/src/backend/bootstrap/bootparse.y +++ b/src/backend/bootstrap/bootparse.y @@ -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; } ; diff --git a/src/backend/bootstrap/bootscanner.l b/src/backend/bootstrap/bootscanner.l index 9cfd19c..6467882 100644 --- a/src/backend/bootstrap/bootscanner.l +++ b/src/backend/bootstrap/bootscanner.l @@ -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); }

view thread (2+ messages)  latest in thread

Message-ID: <20170110051119.b5h7i3z5qagy35rb@alvherre.pgsql>
Permalink:  ../20170110051119.b5h7i3z5qagy35rb@alvherre.pgsql/
Also on:    postgresql.org/message-id/20170110051119.b5h7i3z5qagy35rb@alvherre.pgsql

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: alvherre@2ndquadrant.com
  Subject: Re: remove floats from bootstrap scanner/parser
  In-Reply-To: <20170110051119.b5h7i3z5qagy35rb@alvherre.pgsql>
  References: <20170110051119.b5h7i3z5qagy35rb@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox