List:Commits« Previous MessageNext Message »
From:Sergei Golubchik Date:December 10 2007 5:21pm
Subject:Re: bk commit into 5.1 tree (davi:1.2680) BUG#28317
View as plain text  
Hi!

On Dec 10, Davi Arnaut wrote:
> Sergei Golubchik wrote:
> > On Dec 10, Davi Arnaut wrote:
> >> ChangeSet@stripped, 2007-12-10 11:34:12-02:00, davi@stripped +7 -0
> >>   Bug#28317 Left Outer Join with {oj outer-join}
> >>   
> >>   Parser rejects ODBC's escape sequences for outer joins other than
> >>   left outer join, yet the escape sequence BNF specifies that this
> >>   syntax can be used for left, right, and full outer join syntax.
> > 
> > Why not to do it in the parser ? Lexer's task, conceptually, is to
> > split the input stream of characters into a stream of lexems. And
> > parser is supposed to apply grammar rules to the that.
> 
> Practically speaking, because it introduces complexity and conflicts
> to the parser for something that in the first place shouldn't be
> handled by the server parser.

What complexity and conflicts ? '{' isn't used anywhere in SQL, there
could be no ambiguity.
 
> Conceptually speaking, a Lexer task is to do lexical analysis which is
> a "tokenization" process, but it doesn't me it must convert all
> characters into tokens. If the "lexeme" doesn't have any meaning,
> there is no point in passing it to the parser. This is quite common,
> you don't see parsers taking whitespace and comments into account.

Whitespace and comments - yes. But here there're three tokens: '{' 'oj'
... '}' separated by other meaningful tokens. You cannot match and
remove them in a lexer, only a parser can do that. You can pretend that
lexer does it, but in fact it does it by embedding a simple parser,
that's all.

To prove the point - your patch doesn't work, it doesn't handle nested
escapes, as far as I can see:

SELECT ... FROM {oj t1 LEFT JOIN {oj t2 LEFT JOIN t3}}
SELECT ... FROM {oj t1 LEFT JOIN (SELECT * FROM {oj t2 LEFT JOIN t3})}

Regards / Mit vielen Grüssen,
Sergei

-- 
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /   Sergei Golubchik <serg@stripped>
 / /|_/ / // /\ \/ /_/ / /__  Principal Software Developer
/_/  /_/\_, /___/\___\_\___/  MySQL GmbH, Dachauer Str. 37, D-80335 München
       <___/                  Geschäftsführer: Kaj Arnö - HRB
München 162140
Thread
bk commit into 5.1 tree (davi:1.2680) BUG#28317Davi Arnaut10 Dec
  • Re: bk commit into 5.1 tree (davi:1.2680) BUG#28317Sergei Golubchik10 Dec
    • Re: bk commit into 5.1 tree (davi:1.2680) BUG#28317Davi Arnaut10 Dec
      • Re: bk commit into 5.1 tree (davi:1.2680) BUG#28317Sergei Golubchik10 Dec
        • Re: bk commit into 5.1 tree (davi:1.2680) BUG#28317Davi Arnaut10 Dec
          • Re: bk commit into 5.1 tree (davi:1.2680) BUG#28317Davi Arnaut10 Dec