Yes, MySQL disallows straight join with USING. The syntax rules in http://dev.mysql.com/doc/refman/5.6/en/join.html show this:
join_table:
table_reference [INNER | CROSS] JOIN table_factor [join_condition]
| table_reference STRAIGHT_JOIN table_factor
| table_reference STRAIGHT_JOIN table_factor ON conditional_expr
| table_reference {LEFT|RIGHT} [OUTER] JOIN table_reference join_condition
| table_reference NATURAL [{LEFT|RIGHT} [OUTER]] JOIN table_factor
join_condition:
ON conditional_expr
| USING (column_list)
You can see that the syntax with STRAIGHT_JOIN
allows only no condition, or an ON
clause. Other joins types allow [join_condition]
which is another syntax rule that expands to either ON
clause or aUSING
expression.
I don't know if there's a good reason for this different treatment of STRAIGHT_JOIN
. Perhaps it was simply an oversight. For what it's worth, this was reported as a bug back in 2008: http://bugs.mysql.com/bug.php?id=35268
But there's no explanation for the difference, and no sign that it has any priority to get fixed.
As a workaround, you could apply the STRAIGHT_JOIN query modifier to the whole query, and then use standard JOIN operators:
SELECT STRAIGHT_JOIN COUNT(*) FROM x AS t1 INNER JOIN x AS t2 USING (id)