Skip to content

Commit 204d34a

Browse files
committed
Fix #260 - implement support for LEFT JOIN, JOIN,INNER JOIN on UpdateStatement
Signed-off-by: William Desportes <[email protected]>
1 parent 4ad634b commit 204d34a

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

src/Statements/UpdateStatement.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use PhpMyAdmin\SqlParser\Components\Condition;
88
use PhpMyAdmin\SqlParser\Components\Expression;
9+
use PhpMyAdmin\SqlParser\Components\JoinKeyword;
910
use PhpMyAdmin\SqlParser\Components\Limit;
1011
use PhpMyAdmin\SqlParser\Components\OrderKeyword;
1112
use PhpMyAdmin\SqlParser\Components\SetOperation;
@@ -15,6 +16,7 @@
1516
* `UPDATE` statement.
1617
*
1718
* UPDATE [LOW_PRIORITY] [IGNORE] table_reference
19+
* [INNER JOIN | LEFT JOIN | JOIN] T1 ON T1.C1 = T2.C1
1820
* SET col_name1={expr1|DEFAULT} [, col_name2={expr2|DEFAULT}] ...
1921
* [WHERE where_condition]
2022
* [ORDER BY ...]
@@ -62,6 +64,18 @@ class UpdateStatement extends Statement
6264
'UPDATE',
6365
1,
6466
],
67+
'JOIN' => [
68+
'JOIN',
69+
1,
70+
],
71+
'LEFT JOIN' => [
72+
'LEFT JOIN',
73+
1,
74+
],
75+
'INNER JOIN' => [
76+
'INNER JOIN',
77+
1,
78+
],
6579
'SET' => [
6680
'SET',
6781
3,
@@ -114,4 +128,11 @@ class UpdateStatement extends Statement
114128
* @var Limit|null
115129
*/
116130
public $limit;
131+
132+
/**
133+
* Joins.
134+
*
135+
* @var JoinKeyword[]|null
136+
*/
137+
public $join;
117138
}

0 commit comments

Comments
 (0)