Skip to content

Commit 4f15f1d

Browse files
committed
Added STRAIGHT_JOIN as a known type of join.
1 parent 4e5c7d2 commit 4f15f1d

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

src/Components/JoinKeyword.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class JoinKeyword extends Component
3838
'LEFT OUTER JOIN' => 'LEFT',
3939
'RIGHT JOIN' => 'RIGHT',
4040
'RIGHT OUTER JOIN' => 'RIGHT',
41+
'STRAIGHT_JOIN' => 'STRAIGHT',
4142
);
4243

4344
/**
@@ -160,7 +161,7 @@ public static function build($component, array $options = array())
160161
{
161162
$ret = array();
162163
foreach ($component as $c) {
163-
$ret[] = (($c->type === 'JOIN') ? 'JOIN ' : ($c->type . ' JOIN '))
164+
$ret[] = array_search($c->type, static::$JOINS) . ' '
164165
. $c->expr . ' ON ' . Condition::build($c->on);
165166
}
166167
return implode(' ', $ret);

src/Parser.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,10 @@ class Parser
196196
'class' => 'SqlParser\\Components\\JoinKeyword',
197197
'field' => 'join',
198198
),
199+
'STRAIGHT_JOIN' => array(
200+
'class' => 'SqlParser\\Components\\JoinKeyword',
201+
'field' => 'join',
202+
),
199203
'LIMIT' => array(
200204
'class' => 'SqlParser\\Components\\Limit',
201205
'field' => 'limit',

0 commit comments

Comments
 (0)