File tree Expand file tree Collapse file tree 1 file changed +20
-3
lines changed
src/main/javacc/net/sf/jsqlparser/parser Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -311,12 +311,27 @@ Update Update():
311
311
Expression value = null;
312
312
FromItem fromItem = null;
313
313
List<Join> joins = null;
314
+ Select select = null;
315
+ boolean useColumnsBrackets = false;
314
316
}
315
317
{
316
318
<K_UPDATE> table=TableWithAlias() { tables.add(table); }
317
319
("," table=TableWithAlias() { tables.add(table); } )*
318
- <K_SET> tableColumn=Column() "=" value=SimpleExpression() { columns.add(tableColumn); expList.add(value); }
319
- ("," tableColumn=Column() "=" value=SimpleExpression() { columns.add(tableColumn); expList.add(value); } )*
320
+ <K_SET>
321
+ (
322
+ tableColumn=Column() "=" value=SimpleExpression() { columns.add(tableColumn); expList.add(value); }
323
+ ("," tableColumn=Column() "=" value=SimpleExpression() { columns.add(tableColumn); expList.add(value); } )*
324
+
325
+ |
326
+
327
+ [LOOKAHEAD(2) "(" { useColumnsBrackets = true; }] tableColumn=Column() { columns.add(tableColumn); } ("," tableColumn=Column() { columns.add(tableColumn); } )* [ ")" ] "="
328
+ "("
329
+ (
330
+ { update.setUseSelect(true); }
331
+ select = Select()
332
+ )
333
+ ")"
334
+ )
320
335
321
336
[ <K_FROM>
322
337
fromItem=FromItem()
@@ -329,6 +344,8 @@ Update Update():
329
344
update.setTables(tables);
330
345
update.setFromItem(fromItem);
331
346
update.setJoins(joins);
347
+ update.setSelect(select);
348
+ update.setUseColumnsBrackets(useColumnsBrackets);
332
349
return update;
333
350
}
334
351
}
@@ -2369,4 +2386,4 @@ Alter Alter():
2369
2386
alter.setDataType(dataType);
2370
2387
return alter;
2371
2388
}
2372
- }
2389
+ }
You can’t perform that action at this time.
0 commit comments