Bug #291 | bug in NATURAL LEFT JOIN, MySQL 4.0 and 4.1. | ||
---|---|---|---|
Submitted: | 15 Apr 2003 9:37 | Modified: | 16 May 2003 1:53 |
Reporter: | Jani Tolonen | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S2 (Serious) |
Version: | 4.0, 4.1 | OS: | Any (All) |
Assigned to: | CPU Architecture: | Any |
[15 Apr 2003 9:37]
Jani Tolonen
[15 Apr 2003 12:20]
MySQL Verification Team
This was a bug in the parser. This is a patch: ===== sql/sql_yacc.yy 1.203 vs edited ===== *** /tmp/sql_yacc.yy-1.203-31362 Fri Mar 28 15:36:40 2003 --- edited/sql/sql_yacc.yy Tue Apr 15 22:10:25 2003 *************** *** 495,502 **** /* These don't actually affect the way the query is really evaluated, but they silence a few warnings for shift/reduce conflicts. */ %left ',' ! %left STRAIGHT_JOIN JOIN_SYM ! %nonassoc CROSS INNER_SYM NATURAL LEFT RIGHT %type <lex_str> IDENT TEXT_STRING REAL_NUM FLOAT_NUM NUM LONG_NUM HEX_NUM LEX_HOSTNAME --- 495,502 ---- /* These don't actually affect the way the query is really evaluated, but they silence a few warnings for shift/reduce conflicts. */ %left ',' ! %left STRAIGHT_JOIN JOIN_SYM NATURAL ! %nonassoc CROSS INNER_SYM LEFT RIGHT %type <lex_str> IDENT TEXT_STRING REAL_NUM FLOAT_NUM NUM LONG_NUM HEX_NUM LEX_HOSTNAME [/mnt/work/mysql-4.0]$
[16 May 2003 1:53]
Michael Widenius
Some extra information about this bug: It was not a bug in the parser but rather a logical error in how chained LEFT JOIN / RIGHT JOINS was handled. This is now fixed and will be in the 4.0.13 and 4.1.1 releases