summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Components/JoinKeyword.php8
-rw-r--r--src/Parser.php2
2 files changed, 7 insertions, 3 deletions
diff --git a/src/Components/JoinKeyword.php b/src/Components/JoinKeyword.php
index 865246c..7062783 100644
--- a/src/Components/JoinKeyword.php
+++ b/src/Components/JoinKeyword.php
@@ -146,6 +146,9 @@ class JoinKeyword extends Component
$state = 3;
} elseif ($token->value === 'USING') {
$state = 4;
+ } else {
+ /* Next clause is starting */
+ break;
}
}
} elseif ($state === 3) {
@@ -182,8 +185,9 @@ class JoinKeyword extends Component
foreach ($component as $c) {
$ret[] = array_search($c->type, static::$JOINS) . ' ' . $c->expr
. (!empty($c->on)
- ? ' ON ' . Condition::build($c->on)
- : ' USING ' . ArrayObj::build($c->using));
+ ? ' ON ' . Condition::build($c->on) : '')
+ . (!empty($c->using)
+ ? ' USING ' . ArrayObj::build($c->using) : '');
}
return implode(' ', $ret);
}
diff --git a/src/Parser.php b/src/Parser.php
index c9fe0f0..21e1b39 100644
--- a/src/Parser.php
+++ b/src/Parser.php
@@ -162,7 +162,7 @@ class Parser
'FROM' => array(
'class' => 'SqlParser\\Components\\ExpressionArray',
'field' => 'from',
- 'options' => array('parseField' => 'table'),
+ 'options' => array('field' => 'table'),
),
'GROUP BY' => array(
'class' => 'SqlParser\\Components\\OrderKeyword',