| Bug #30372 | STRAIGHT JOIN somehow loses table/column references in SELECT list | ||
|---|---|---|---|
| Submitted: | 11 Aug 2007 16:02 | Modified: | 11 Aug 2007 23:14 |
| Reporter: | Tobias Asplund | Email Updates: | |
| Status: | Not a Bug | Impact on me: | |
| Category: | MySQL Server: Parser | Severity: | S3 (Non-critical) |
| Version: | 5.0.45/4.1/5.1 | OS: | Linux |
| Assigned to: | Igor Babaev | CPU Architecture: | Any |
[11 Aug 2007 16:02]
Tobias Asplund
[11 Aug 2007 18:04]
MySQL Verification Team
Thank you for the bug report. Verified as described.
[11 Aug 2007 23:14]
Igor Babaev
MySQL allows you to use only the 'STRAIGHT_JOIN' hint for a join operation (but no 'STRAIGHT JOIN').
Thus in the query
SELECT bug1.b FROM bug1 STRAIGHT JOIN bug2 ON a = c;
'STRAIGHT' is considered as an alias for table 'bug1' hiding the name
of the table.
So the above query is equiavalent to the query
SELECT bug1.b FROM bug1 s JOIN bug2 ON a = c;
for which the returned error message looks quite natural:
mysql> SELECT bug1.b FROM bug1 S JOIN bug2 ON a = c;
ERROR 1054 (42S22): Unknown column 'bug1.b' in 'field list'
Use 'STRAIGHT_JOIN' and you'll get the expected output:
ysql> SELECT bug1.b FROM bug1 STRAIGHT_JOIN bug2 ON a = c;
------+
b |
------+
1 |
------+
