diff --git a/src/Components/JoinKeyword.php b/src/Components/JoinKeyword.php index 3bbb37cb5..9ec681b1b 100644 --- a/src/Components/JoinKeyword.php +++ b/src/Components/JoinKeyword.php @@ -62,6 +62,11 @@ class JoinKeyword extends Component * @var Condition[] */ public $on; + /** + * Columns in Using clause + * + * @var ArrayObj + */ public $using; /** @@ -86,7 +91,8 @@ public static function parse(Parser $parser, TokensList $list, array $options = * * 1 -----------------------[ expr ]----------------------> 2 * - * 2 ---------------------[ ON|USING ]--------------------> 3/4 + * 2 ------------------------[ ON ]-----------------------> 3 + * 2 -----------------------[ USING ]---------------------> 4 * * 3 --------------------[ conditions ]-------------------> 0 * @@ -134,8 +140,12 @@ public static function parse(Parser $parser, TokensList $list, array $options = $expr->expr = Expression::parse($parser, $list, array('field' => 'table')); $state = 2; } elseif ($state === 2) { - if (($token->type === Token::TYPE_KEYWORD) && ($token->value === 'ON' || $token->value === 'USING')) { - $state = $token->value === 'ON' ? 3 : 4; + if ($token->type === Token::TYPE_KEYWORD) { + if ($token->value === 'ON') { + $state = 3; + } elseif ($token->value === 'USING') { + $state = 4; + } } } elseif ($state === 3) { $expr->on = Condition::parse($parser, $list);