Skip to content

Commit c9ecfc6

Browse files
fix: AllTableColumns, DuckDB specific EXCLUDE
Signed-off-by: Andreas Reichel <andreas@manticore-projects.com>
1 parent 2ace74d commit c9ecfc6

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

src/main/java/net/sf/jsqlparser/statement/select/AllTableColumns.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,23 @@ public class AllTableColumns extends AllColumns {
2121
private Table table;
2222

2323
public AllTableColumns(Table table, ExpressionList<Column> exceptColumns,
24-
List<SelectItem<Column>> replaceExpressions) {
25-
super(exceptColumns, replaceExpressions);
24+
List<SelectItem<Column>> replaceExpressions, String exceptKeyword) {
25+
super(exceptColumns, replaceExpressions, exceptKeyword);
2626
this.table = table;
2727
}
2828

29+
public AllTableColumns(Table table, ExpressionList<Column> exceptColumns,
30+
List<SelectItem<Column>> replaceExpressions) {
31+
this(table, exceptColumns, replaceExpressions, "EXCEPT");
32+
}
33+
2934
public AllTableColumns(Table table) {
3035
this(table, null, null);
3136
}
3237

3338
public AllTableColumns(Table table, AllColumns allColumns) {
34-
this(table, allColumns.exceptColumns, allColumns.replaceExpressions);
39+
this(table, allColumns.exceptColumns, allColumns.replaceExpressions,
40+
allColumns.getExceptKeyword());
3541
}
3642

3743
public Table getTable() {

src/test/java/net/sf/jsqlparser/statement/select/AllTableColumnsTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,12 @@ void testBigQuerySyntax() throws JSQLParserException {
2222
+ "FROM orders";
2323
TestUtils.assertSqlCanBeParsedAndDeparsed(sqlStr, true);
2424
}
25+
26+
@Test
27+
void testDuckDBSyntax() throws JSQLParserException {
28+
String sqlStr =
29+
"SELECT orders.* EXCLUDE (order_id)\n"
30+
+ "FROM orders";
31+
TestUtils.assertSqlCanBeParsedAndDeparsed(sqlStr, true);
32+
}
2533
}

0 commit comments

Comments
 (0)