diff options
author | Michael Widenius <monty@askmonty.org> | 2013-03-17 14:36:20 +0200 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2013-03-17 14:36:20 +0200 |
commit | 8b047ac5c4b7d326742fd8b7a165a17089a9d83b (patch) | |
tree | 04387528ba7b255c3c15b95989e1ee854c502dc8 /storage | |
parent | deeed04137908c0a30ef93f12bbdda0ed06e9c0a (diff) | |
download | mariadb-git-8b047ac5c4b7d326742fd8b7a165a17089a9d83b.tar.gz |
Patch by Hartmut Holzgraefe
STRAIGHT_JOIN couldn't be combined with NATURAL or USING(),
INNER JOIN not with NATURAL (MDEV-4271, MySQL Bug #35268)
Separate rules existed for "natural" (non-outer) joins and
for STRAIGHT_JOIN, with the only difference code wise being
that with STRAIGHT_JOIN the "straight" property of the right
side table was set before calling the appropriate add_...()
function.
The "natural_join" parser rule has now been extended to also
accept STRAIGHT_JOIN, and the rule result value is set to
1 for straight joins, 0 otherwise, so acting as a "straight"
flag that can directly be assigned to the "straight" property
of the right side table.
The rule parsing NATURAL JOIN was hard coded to accept just
this keyword combination, without support for either
STRAIGHT_JOIN or the optional INNER.
The "natural_join" rule has now been split up in an inner
"inner_join" rule that matches the JOIN, INNER JOIN and
STRAIGHT_JOIN cases while "natural_join" also matches
CROSS JOIN.
The NATURAL rule has been changed to accept "inner_join"
instead of just JOIN, so now NATURAL STRAIGHT_JOIN and
NATURAL INNER JOIN also work as expected.
As a side effect the removal of the duplciated rules
for STRAIGHT_JOIN handling has reduced the shift/reduce
conflict count by one.
mysql-test/r/join.result:
Added new test cases
mysql-test/t/join.test:
Added new test cases
sql/sql_yacc.yy:
The "natural_join" parser rule was extended to also accept STRAIGHT_JOIN
NATURAL STRAIGHT_JOIN and NATURAL INNER JOIN also now work as expected
Diffstat (limited to 'storage')
0 files changed, 0 insertions, 0 deletions