pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
remove floats from bootstrap scanner/parser
2+ messages / 2 participants
[nested] [flat]

Commits from this thread:
  2017-01-17 193a7d791e  Remove dead code in bootstrap
* remove floats from bootstrap scanner/parser
@ 2017-01-10 05:11  Alvaro Herrera <alvherre@2ndquadrant.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Alvaro Herrera @ 2017-01-10 05:11 UTC (permalink / raw)
  To: pgsql-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); }
^ permalink raw reply [nested|flat] 2+ messages in thread

* Re: remove floats from bootstrap scanner/parser
@ 2017-01-12 19:52  Jim Nasby <Jim.Nasby@BlueTreble.com>
  parent: Alvaro Herrera <alvherre@2ndquadrant.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Jim Nasby @ 2017-01-12 19:52 UTC (permalink / raw)
  To: Alvaro Herrera <alvherre@2ndquadrant.com>; pgsql-hackers

On 1/9/17 9:11 PM, Alvaro Herrera wrote:
> 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.

Verified this works for make check. Looks sane to me.
-- 
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com
855-TREBLE2 (855-873-2532)


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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2017-01-12 19:52 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-01-10 05:11 remove floats from bootstrap scanner/parser Alvaro Herrera <alvherre@2ndquadrant.com>
2017-01-12 19:52 ` Jim Nasby <Jim.Nasby@BlueTreble.com>

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