Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cQoiZ-00083q-L9 for pgsql-hackers@arkaria.postgresql.org; Tue, 10 Jan 2017 05:11:31 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1cQoiZ-0007IN-87 for pgsql-hackers@arkaria.postgresql.org; Tue, 10 Jan 2017 05:11:31 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1cQoiX-0007Gm-7Y for pgsql-hackers@postgresql.org; Tue, 10 Jan 2017 05:11:29 +0000 Received: from mail-qt0-x22d.google.com ([2607:f8b0:400d:c0d::22d]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1cQoiU-00011W-7t for pgsql-hackers@postgresql.org; Tue, 10 Jan 2017 05:11:28 +0000 Received: by mail-qt0-x22d.google.com with SMTP id k15so385753908qtg.3 for ; Mon, 09 Jan 2017 21:11:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:subject:message-id:mime-version:content-disposition :content-transfer-encoding:user-agent; bh=426k9tgBa/prhaM5P/+iU+H1SZYAoBC9Gy56lir2+fI=; b=u+FMe3/EqC/I5fhR5LQgtWs2SHRXJuZ3QDz5PnVn9EfvsWZPkpYBG+IzvX3I5MwClk XDyAi2AdXrm8htmPPyJjSB+oIkING+D0NWcloLLdFTAtC3rwSdEhqjjzZay/CthNxM0k YQQ/SvcVhj/sBGBX/fIS0DU2pb6iDYeI/C0hLHvX86ayFHoXJgDUqhet25zKHFhvHzHQ zFLQyNrJnFSdacGEWunIpO+14DmeUAx3Xs9yXLWTdZqKnhaHpSK+n3GUiQJ/1s5hRyuC +k5EljsUKrhqy/ODK9HlZ14EPgqXFJmZ1q2mbrIj0gNhDWzXBRJhMHh5OnGYZSfHX+LF Y2Ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:content-transfer-encoding:user-agent; bh=426k9tgBa/prhaM5P/+iU+H1SZYAoBC9Gy56lir2+fI=; b=gpGUAipsSKWt9XJANy6GWqL7Wdnym8MZgQyZl6BZIThsS9SBzcpQ4N5BIVLAhLuoGn 3nrMYuiLU4Xuj2jOA5F8MS45LpPVlGw6dV/BG0AKOPwgtvEUGZxn4jdKCxmIt0rxSBfM rLDF2KHrDYQrnm1blRDti60e7fKl46BucKm5+truP4AQsS2bquaB52F3zmHdwe5HrlsE D/3ivdVApBvSpNT7aqSd20Z6pORz/OBMwVLp76pyRvTeyVRa7kp7edFgse+rK4SONDo2 Lugm41lzzqUdgEkPU3uJsEPO1rITYI7i9mJGNLdPkzESEXgZtW0Wxasdk3/2Wph6/EFp XwIw== X-Gm-Message-State: AIkVDXKszDOVOwxFJYQXW4IQksqiHReEW1uy8+3MuDZXjIh6V0fJMiuie1SdqrFST55RAUATBrnec+iGx4I+JaAiqnqhU74a/Jk8mb+Yv3veJDgs0K7arxgt1bvprODHlVXSbRxW0z2ROsRhathqMgll6ZqDwguno8WaHcsxEPASfAFImsbmJDoe3WkWGLHVMjUmV+4= X-Received: by 10.200.42.19 with SMTP id k19mr1034547qtk.236.1484025084127; Mon, 09 Jan 2017 21:11:24 -0800 (PST) Received: from alvin.alvh.no-ip.org ([181.42.144.42]) by smtp.gmail.com with ESMTPSA id z189sm550103qkb.42.2017.01.09.21.11.23 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Jan 2017 21:11:23 -0800 (PST) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id D34C51590; Tue, 10 Jan 2017 02:11:19 -0300 (CLST) Date: Tue, 10 Jan 2017 02:11:19 -0300 From: Alvaro Herrera To: Pg Hackers Subject: remove floats from bootstrap scanner/parser Message-ID: <20170110051119.b5h7i3z5qagy35rb@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="its6mfrabvoccego" Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: NeoMutt/20161104 (1.7.1) X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org --its6mfrabvoccego Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit 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 --its6mfrabvoccego Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="parseboot.patch" 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 boot_index_params %type boot_index_param -%type boot_const boot_ident +%type boot_ident %type optbootstrap optsharedrelation optwithoutoids boot_column_nullness %type oidspec optoideq optrowtypeoid -%token CONST_P ID +%token 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); } --its6mfrabvoccego Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --its6mfrabvoccego--