1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Fix for BUG#12943.

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.
This commit is contained in:
unknown
2005-09-10 15:01:54 +03:00
parent 9ed942fe2c
commit 0dec682f39
4 changed files with 54 additions and 2 deletions

View File

@ -6354,7 +6354,7 @@ void st_select_lex::set_lock_for_tables(thr_lock_type lock_type)
SYNOPSIS
make_join_on_context()
thd pointer to current thread
left_op lefto operand of the JOIN
left_op left operand of the JOIN
right_op rigth operand of the JOIN
DESCRIPTION