• Sergei Golubchik's avatar
    MDEV-30151 parse error 1=2 not between/in · eba09918
    Sergei Golubchik authored
    the parser couldn't parse `1=2 not between 3 and 5`
    after `2` it expected only NOT2_SYM, but not NOT_SYM
    (visible from the sql_yacc.output file), which resulted in
    Syntax error ... near 'not between 3 and 4'
    
    The parser was confused by a rather low NOT_SYM precedence and
    %prec BETWEEN_SYM didn't resolve this confusion.
    
    As a fix, let's remove any %precedence from NOT_SYM and
    specify %prec explicitly in the only place where it matters for NOT_SYM.
    
    In other places, such as for NOT BETWEEN, NOT_SYM won't have a
    precedence, so bison won't be confused about it.
    eba09918
parser.test 46.2 KB