• unknown's avatar
    Fix for BUG#12943. · 0dec682f
    unknown authored
    The problem was that in the first production in rule 'join_table', that
    processes simple cross joins, the parser was processing the second join operand
    before the first one due to unspecified priorities of JOINs. As a result in the
    case of cross joins the parser constructed a tree with incorrect nesting:
    the expression "t1 join t2 join t3 on some_cond" was interpreted as
    "t1 join (t2 join t3 on some_cond)" instead of
    "(t1 join t2) join t3 on some_cond".
    Because of this incorrect nesting the method make_join_on_context picked an
    incorrect table as the first table of the name resolution context.
    
    The solution assignes correct priorities to the related production.
    
    
    mysql-test/r/select.result:
      Added test for BUG#12943.
    mysql-test/t/select.test:
      Added test for BUG#12943.
    sql/sql_parse.cc:
      Fixed typo.
    sql/sql_yacc.yy:
      Provide explicit priorities of the JOIN operator and the 'table_ref' rule,
      to enforce left-associativity of [INNER | CROSS] JOIN.
    0dec682f
sql_parse.cc 212 KB