pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Gierth <andrew@tao11.riddles.org.uk>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@postgresql.org
Subject: Re: A really subtle lexer bug
Date: Thu, 23 Aug 2018 16:29:23 +0100
Message-ID: <871sap1658.fsf@news-spur.riddles.org.uk> (raw)
In-Reply-To: <18470.1535036115@sss.pgh.pa.us>
References: <87va851ppl.fsf@news-spur.riddles.org.uk>
	<87ftz90yma.fsf@news-spur.riddles.org.uk>
	<18470.1535036115@sss.pgh.pa.us>

>>>>> "Tom" == Tom Lane <tgl@sss.pgh.pa.us> writes:

 >> Patch attached.
 >> This fixes two bugs: first the mis-lexing of two-char ops as mentioned
 >> originally; second, the O(N^3) lexing time of strings of - or +
 >> characters is reduced to O(N^2) (in practice it's better than O(N^2)
 >> once N gets large because the bison stack gets blown out, ending the
 >> loop early).

 Tom> Looks reasonable offhand (didn't test).  A couple of thoughts:

 Tom> * Some regression tests exercising these code paths might be a
 Tom> good thing.

Agreed. Any preferences where they should go?

 Tom> * There should likely be a comment near where EQUALS_GREATER and
 Tom> friends are defined, pointing out that if we add any more
 Tom> multi-character operators with special precedences, this code has
 Tom> to be taught about them.

Agreed; will do this.

-- 
Andrew (irc:RhodiumToad)




view thread (8+ messages)  latest in thread

Message-ID: <871sap1658.fsf@news-spur.riddles.org.uk>
Permalink:  ../871sap1658.fsf@news-spur.riddles.org.uk/
Also on:    postgresql.org/message-id/871sap1658.fsf@news-spur.riddles.org.uk

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: andrew@tao11.riddles.org.uk, tgl@sss.pgh.pa.us
  Subject: Re: A really subtle lexer bug
  In-Reply-To: <871sap1658.fsf@news-spur.riddles.org.uk>

* 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