Re: A really subtle lexer bug - Mailing list pgsql-hackers

From Andrew Gierth
Subject Re: A really subtle lexer bug
Date
Msg-id 871sap1658.fsf@news-spur.riddles.org.uk
Whole thread Raw
In response to Re: A really subtle lexer bug  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: A really subtle lexer bug
List pgsql-hackers
>>>>> "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)


pgsql-hackers by date:

Previous
From: "Finnerty, Jim"
Date:
Subject: Re: Removing useless DISTINCT clauses
Next
From: "Jonathan S. Katz"
Date:
Subject: Re: Memory leak with CALL to Procedure with COMMIT.