Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
123 commits
Select commit Hold shift + click to select a range
747152a
Fixes #1684: Support CREATE MATERIALIZED VIEW with AUTO REFRESH
zaza Dec 11, 2022
9e09005
Merge branch 'master' into 1684-create-mv-auto-refresh
zaza Dec 22, 2022
ea4477b
Reduce cyclomatic complexity in CreateView.toString
zaza Jan 8, 2023
b5321d6
Enhanced Keywords
manticore-projects Oct 18, 2021
5fae2f5
Fix incorrect tests
manticore-projects Oct 18, 2021
f49e828
Define Reserved Keywords explicitly
manticore-projects Oct 24, 2021
86f337d
Fix test resources
manticore-projects Oct 24, 2021
2d51a82
Adjust Gradle to JUnit 5
manticore-projects Nov 22, 2021
232aff6
Do not mark SpeedTest for concurrent execution
manticore-projects Nov 24, 2021
3ba5410
Remove unused imports
manticore-projects Nov 28, 2021
e960a35
Adjust Gradle to JUnit 5
manticore-projects Nov 22, 2021
67f7951
Do not mark SpeedTest for concurrent execution
manticore-projects Nov 24, 2021
a016be0
Remove unused imports
manticore-projects Nov 28, 2021
2ef6637
Sphinx Documentation
manticore-projects Sep 2, 2022
57193b8
doc: request for `Conventional Commit` messages
manticore-projects Sep 6, 2022
b94b2cc
feat: make important Classes Serializable
manticore-projects Sep 15, 2022
02202c5
chore: Make Serializable
manticore-projects Oct 14, 2022
a3ca325
doc: Better integration of the RR diagrams
manticore-projects Jan 7, 2023
fcb5ab1
Merge
manticore-projects Jan 7, 2023
c57c427
feat: Oracle Alternative Quoting
manticore-projects Jan 29, 2023
2aec1f6
style: Appease PMD/Codacy
manticore-projects Jan 29, 2023
1c8d8da
feat: CREATE VIEW ... REFRESH AUTO...
manticore-projects Jan 30, 2023
b707b23
doc: fix the issue template
manticore-projects Feb 1, 2023
46314c4
Update issue templates
manticore-projects Feb 1, 2023
4aeafbc
Update issue templates
manticore-projects Feb 1, 2023
b081484
feat: Support more Statement Separators
manticore-projects Feb 2, 2023
5885e1c
Merge remote-tracking branch 'origin/master'
manticore-projects Feb 13, 2023
581d97a
Merge branch 'master' of https://github.com/JSQLParser/JSqlParser
manticore-projects Feb 24, 2023
0979b2e
feat: FETCH uses EXPRESSION
manticore-projects Mar 7, 2023
ed17f87
style: apply Spotless
manticore-projects Mar 7, 2023
96808d2
test: commit missing test
manticore-projects Mar 7, 2023
21c4550
Merge branch 'master' of https://github.com/JSQLParser/JSqlParser
manticore-projects Mar 12, 2023
e8a29de
Merge branch 'master' of https://github.com/JSQLParser/JSqlParser
manticore-projects Apr 29, 2023
8a1bdec
feat: Lateral View
manticore-projects Apr 29, 2023
4efb99f
feat: Oracle `HAVING` before `GROUP BY`
manticore-projects Apr 29, 2023
9da7a06
feat: Multi-Part Names for Variables and Parameters
manticore-projects Apr 29, 2023
4b7f21c
feat: ClickHouse `Select...` ``FINAL` modifier
manticore-projects Apr 29, 2023
6281b07
feat: Test if a JOIN is an INNER JOIN according to the SQL:2016
manticore-projects Apr 30, 2023
b6ea8b1
feat: Switch off contradicting `JOIN` qualifiers, when setting a qual…
manticore-projects Apr 30, 2023
3a27a9d
feat: implement SQL:2016 Convert() and Trim()
manticore-projects Apr 30, 2023
4d5e26d
feat: ClickHouse `LIMIT ... BY ...` clause
manticore-projects Apr 30, 2023
f0a6f37
test: add specific tests for closed issues
manticore-projects Apr 30, 2023
ff16faf
test: add specific tests for closed issues
manticore-projects Apr 30, 2023
b9057d2
refactor: remove `SelectExpressionItem` in favor of `SelectItem`
manticore-projects Apr 30, 2023
286834d
doc: Update examples
manticore-projects Apr 30, 2023
0be65a4
build: Add missing import
manticore-projects Apr 30, 2023
4ddc835
doc: Update the README.md
manticore-projects May 1, 2023
fc577ca
fix: assign Enum case insensitive
manticore-projects May 2, 2023
86d0ace
fix: assign Enum case insensitive
manticore-projects May 2, 2023
a5140c7
Revert "fix: assign Enum case insensitive"
manticore-projects May 2, 2023
288b177
feat: Consolidate the `ExpressionList`, removing many redundant List …
manticore-projects May 3, 2023
905ef65
fix: Remove tests for `()`, since `ParenthesedExpressionList` will ca…
manticore-projects May 3, 2023
85b3bc4
refactor: UpdateSets for `Update` and `InsertConflictTarget`
manticore-projects May 3, 2023
e16ba5d
build: Increase TimeOut for the GitHub CI
manticore-projects May 3, 2023
2eb8c80
style: Appease Codacy
manticore-projects May 3, 2023
f449263
style: Checkstyle
manticore-projects May 3, 2023
141708e
refactor: Remove `ItemsList`, `MultiExpressionList`, `Replace`
manticore-projects May 4, 2023
67b3804
style: Appease Codacy
manticore-projects May 4, 2023
f89df27
style: Rework all the ENUMs
manticore-projects May 5, 2023
a590036
doc: Better Sphinx Tabs
manticore-projects May 6, 2023
c81d60a
doc: RR chart colors cater for Dark Mode
manticore-projects May 6, 2023
3903a80
refactor: remove SimpleFunction
manticore-projects May 6, 2023
2d200b0
build: improve Gradle Build
manticore-projects May 7, 2023
89600d4
refactor: `Insert` uses `ExpressionList` and `UpdateSet`
manticore-projects May 7, 2023
a11febb
test: Disable API Sanitation for the moment
manticore-projects May 7, 2023
399e1d7
style: Appease Checkstyle
manticore-projects May 7, 2023
f5d35d0
style: Appease PMD
manticore-projects May 7, 2023
21389b7
fix: find the correct position when field belongs to an internal class
manticore-projects May 9, 2023
52df291
style: replace all List<Expression> with ExpressionList<> and enforce…
manticore-projects May 9, 2023
9fbdaae
refactor: generify `SelectItem` and remove `FunctionItem` and `Expres…
manticore-projects May 9, 2023
7cecd29
fix: Java Version 8
manticore-projects May 9, 2023
c07a43b
feat: JdbcNamedParameter allows "&" (instead of ":")
manticore-projects May 11, 2023
09a70a4
feat: access Elements of Array Columns
manticore-projects May 11, 2023
6e7a78d
feat: `MEMBER OF` condition as shown at https://dev.mysql.com/doc/ref…
manticore-projects May 11, 2023
8a75aa7
style: appease PMD/Codacy
manticore-projects May 11, 2023
ce2b18a
style: appease PMD/Codacy
manticore-projects May 11, 2023
c9dce62
Merge remote-tracking branch 'manticore/Lateral_View' into Lateral_View
manticore-projects May 11, 2023
decf662
test: add unit test for issue #1778
manticore-projects May 11, 2023
c53667f
feat: Write API documentation to the WebSite via XMLDoclet
manticore-projects May 14, 2023
1132338
Update sphinx.yml
manticore-projects May 14, 2023
f3e8952
build: Sphinx build fixes
manticore-projects May 14, 2023
f515cda
Merge branch 'master' of https://github.com/manticore-projects/JSqlPa…
manticore-projects May 14, 2023
11b563c
build: Sphinx build fixes
manticore-projects May 14, 2023
961378d
build: Sphinx build fixes
manticore-projects May 14, 2023
48d5340
Merge branch 'master' of https://github.com/manticore-projects/JSqlPa…
manticore-projects May 14, 2023
8fb9110
build: improve the GIT Snapshot detection
manticore-projects May 15, 2023
88d1b62
fix: issue #1791
manticore-projects May 15, 2023
d20c8e9
fix: issue #1789
manticore-projects May 16, 2023
32ec561
fix: issue #1789
manticore-projects May 16, 2023
9fa0f4b
Merge remote-tracking branch 'manticore/Lateral_View' into Lateral_View
manticore-projects May 16, 2023
01a5fb7
refactor: simplify production `CreateParameter()`
manticore-projects May 16, 2023
daa56ed
refactor: SHOW statement, supporting any RDBMS specific implementation
manticore-projects May 16, 2023
4fb1cfb
refactor: RETURNING clause
manticore-projects May 16, 2023
da32442
refactor: CREATE and ALTER productions
manticore-projects May 16, 2023
4f0488c
fix: Complex Parsing Approach
manticore-projects May 17, 2023
3ff9774
style: Quieten the logger
manticore-projects May 17, 2023
a7dfb94
style: Cosmetic improvements
manticore-projects May 17, 2023
6ef5e0b
feat: chaining JSON Expressions
manticore-projects May 17, 2023
4f91746
style: remove unused imports
manticore-projects May 17, 2023
9dafae8
refact: Statements extends List<Statement>
manticore-projects May 17, 2023
4bdabed
build: try to work around the Maven/JDK8 issue on GitHub
manticore-projects May 17, 2023
64b0331
feat: parse CREATE TRIGGER as UnsupportedStatement
manticore-projects May 17, 2023
e19dc0e
feat: functions blocks, parenthesed JSON Expressions
manticore-projects May 18, 2023
5263b91
feat: functions blocks, parenthesed JSON Expressions
manticore-projects May 18, 2023
be7fc53
Create gradle.yml
manticore-projects May 18, 2023
73c55fd
feat: Quoted Identifiers can contain double-quotes (PostgreSQL)
manticore-projects May 18, 2023
a558871
build: improve Upload task
manticore-projects May 19, 2023
5e7732c
doc: Website improvements
manticore-projects May 22, 2023
68ce27c
doc: Website, fix tabs
manticore-projects May 24, 2023
cb960a3
fix: throw the specific exception
manticore-projects May 29, 2023
2b4a929
doc: write migration guide
manticore-projects May 29, 2023
54b4303
Merge branch 'master' of https://github.com/manticore-projects/JSqlPa…
manticore-projects May 29, 2023
b6fab2a
fix: expose IntervalExpression attributes and use DeParser
manticore-projects Jun 1, 2023
6d2b421
doc: migration guide
manticore-projects Jun 2, 2023
8027dbf
feat: T-SQL `FOR ...` clause
manticore-projects Jun 2, 2023
94d00f0
Merge remote-tracking branch 'origin/master'
manticore-projects Jun 2, 2023
6f27765
fix: SPHINX modules and themes
manticore-projects Jun 2, 2023
f5e9f53
docs: write migration guide
manticore-projects Jun 11, 2023
996ebd9
Merge branch 'master' of github.com:manticore-projects/JSqlParser
manticore-projects Jun 11, 2023
75e4d30
feat: `QUALIFY` clause
manticore-projects Jun 15, 2023
386dc7a
feat: Postgres `NOTNULL` support
manticore-projects Jun 15, 2023
f132547
feat: MySQL `NOT RLIKE`, `NOT REGEXP` expressions
manticore-projects Jun 15, 2023
420d7d8
fix: `INSERT` must use simple Column Names only
manticore-projects Jun 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: Consolidate the ExpressionList, removing many redundant List …
…alike Classes and Productions

- `ExpressionList` extends a `List<Expression>` directly and implements `Expression`
- `ExpressionList` has no Brackets
- introduce `ParenthesedExpressionList` which extends `ExpressionList` and has Brackets
- refactor `MultiExpressionList` to extend `List<ExpressionList>`
- replace any occurrence of `List<Expression>` with `ExpressionList` and remove lots of redundant Productions
- `RowConstructor` extends `ExpressionList`
- remove redundant `ValueExpressionList` (it was just an `ExpressionList`
- get rid of any `useBrackets` flags
- consolidate the `Cast` Functions
- use `ExpressionListDeparser` as much as possible

BREAKING-CHANGE: All `List<Expression>` and `List<Column>` related methods have changed. No `useBrackets` flags, instead use `ParenthesedExpressionList` when brackets are needed.
  • Loading branch information
manticore-projects committed May 3, 2023
commit 288b177fe9c8a4c0469e8e30c0901a949d0a826a
42 changes: 24 additions & 18 deletions src/main/java/net/sf/jsqlparser/expression/AnalyticExpression.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,19 @@
*/
package net.sf.jsqlparser.expression;

import java.util.List;
import static java.util.stream.Collectors.joining;
import net.sf.jsqlparser.expression.operators.relational.ExpressionList;
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
import net.sf.jsqlparser.statement.select.OrderByElement;

import java.util.List;

import static java.util.stream.Collectors.joining;

/**
* Analytic function. The name of the function is variable but the parameters following the special analytic function
* path. e.g. row_number() over (order by test). Additional there can be an expression for an analytical aggregate like
* sum(col) or the "all collumns" wildcard like count(*).
* Analytic function. The name of the function is variable but the parameters following the special
* analytic function path. e.g. row_number() over (order by test). Additional there can be an
* expression for an analytical aggregate like sum(col) or the "all collumns" wildcard like
* count(*).
*
* @author tw
*/
Expand All @@ -33,15 +36,15 @@ public class AnalyticExpression extends ASTNodeAccessImpl implements Expression
private AnalyticType type = AnalyticType.OVER;
private boolean distinct = false;
private boolean unique = false;
private boolean ignoreNulls = false; //IGNORE NULLS inside function parameters
private boolean ignoreNullsOutside = false; //IGNORE NULLS outside function parameters
private boolean ignoreNulls = false; // IGNORE NULLS inside function parameters
private boolean ignoreNullsOutside = false; // IGNORE NULLS outside function parameters
private Expression filterExpression = null;
private List<OrderByElement> funcOrderBy = null;
private String windowName = null; // refers to an external window definition (paritionBy, orderBy, windowElement)
private String windowName = null; // refers to an external window definition (paritionBy,
// orderBy, windowElement)
private WindowDefinition windowDef = new WindowDefinition();

public AnalyticExpression() {
}
public AnalyticExpression() {}

public AnalyticExpression(Function function) {
name = function.getName();
Expand All @@ -50,18 +53,19 @@ public AnalyticExpression(Function function) {
unique = function.isUnique();
funcOrderBy = function.getOrderByElements();

ExpressionList list = function.getParameters();
ExpressionList<Expression> list = function.getParameters();
if (list != null) {
if (list.getExpressions().size() > 3) {
throw new IllegalArgumentException("function object not valid to initialize analytic expression");
throw new IllegalArgumentException(
"function object not valid to initialize analytic expression");
}

expression = list.getExpressions().get(0);
expression = list.get(0);
if (list.getExpressions().size() > 1) {
offset = list.getExpressions().get(1);
offset = list.get(1);
}
if (list.getExpressions().size() > 2) {
defaultValue = list.getExpressions().get(2);
defaultValue = list.get(2);
}
}
ignoreNulls = function.isIgnoreNulls();
Expand Down Expand Up @@ -97,7 +101,8 @@ public void setPartitionExpressionList(ExpressionList partitionExpressionList) {
setPartitionExpressionList(partitionExpressionList, false);
}

public void setPartitionExpressionList(ExpressionList partitionExpressionList, boolean brackets) {
public void setPartitionExpressionList(ExpressionList partitionExpressionList,
boolean brackets) {
windowDef.partitionBy.setPartitionExpressionList(partitionExpressionList, brackets);
}

Expand Down Expand Up @@ -202,7 +207,8 @@ public void setWindowDefinition(WindowDefinition windowDef) {
}

@Override
@SuppressWarnings({"PMD.CyclomaticComplexity", "PMD.NPathComplexity", "PMD.MissingBreakInSwitch"})
@SuppressWarnings({"PMD.CyclomaticComplexity", "PMD.NPathComplexity",
"PMD.MissingBreakInSwitch"})
public String toString() {
StringBuilder b = new StringBuilder();

Expand Down Expand Up @@ -266,7 +272,7 @@ public String toString() {

if (windowName != null) {
b.append(" ").append(windowName);
} else if (type!=AnalyticType.WITHIN_GROUP_OVER) {
} else if (type != AnalyticType.WITHIN_GROUP_OVER) {
b.append(" ");
b.append(windowDef.toString());
}
Expand Down
57 changes: 32 additions & 25 deletions src/main/java/net/sf/jsqlparser/expression/CastExpression.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,41 @@

import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
import net.sf.jsqlparser.statement.create.table.ColDataType;
import net.sf.jsqlparser.statement.create.table.ColumnDefinition;
import net.sf.jsqlparser.statement.select.Select;

import java.util.ArrayList;

public class CastExpression extends ASTNodeAccessImpl implements Expression {
public String keyword;

private Expression leftExpression;
private ColDataType type;
private RowConstructor rowConstructor;
private ColDataType colDataType = null;
private ArrayList<ColumnDefinition> columnDefinitions = new ArrayList<>();
private boolean useCastKeyword = true;

public RowConstructor getRowConstructor() {
return rowConstructor;
}

public void setRowConstructor(RowConstructor rowConstructor) {
this.rowConstructor = rowConstructor;
this.type = null;
}

public CastExpression withRowConstructor(RowConstructor rowConstructor) {
setRowConstructor(rowConstructor);
return this;

public CastExpression(String keyword) {
this.keyword = keyword;
}

public CastExpression() {
this("CAST");
}

public ColDataType getColDataType() {
return colDataType;
}

public ArrayList<ColumnDefinition> getColumnDefinitions() {
return columnDefinitions;
}

public ColDataType getType() {
return type;
public void setColDataType(ColDataType colDataType) {
this.colDataType = colDataType;
}

public void setType(ColDataType type) {
this.type = type;
this.rowConstructor = null;
public void addColumnDefinition(ColumnDefinition columnDefinition) {
this.columnDefinitions.add(columnDefinition);
}

public Expression getLeftExpression() {
Expand All @@ -66,16 +72,17 @@ public void setUseCastKeyword(boolean useCastKeyword) {
@Override
public String toString() {
if (useCastKeyword) {
return rowConstructor!=null
? "CAST(" + leftExpression + " AS " + rowConstructor.toString() + ")"
: "CAST(" + leftExpression + " AS " + type.toString() + ")";
return columnDefinitions.size() > 1
? keyword + "(" + leftExpression + " AS ROW("
+ Select.getStringList(columnDefinitions) + "))"
: keyword + "(" + leftExpression + " AS " + colDataType.toString() + ")";
} else {
return leftExpression + "::" + type.toString();
return leftExpression + "::" + colDataType.toString();
}
}

public CastExpression withType(ColDataType type) {
this.setType(type);
this.setColDataType(type);
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,7 @@ public DateTimeLiteralExpression withType(DateTime type) {
}

public enum DateTime {
DATE("DATE")
, TIME("TIME")
, TIMESTAMP("TIMESTAMP")
, TIMESTAMPTZ("TIMESTAMPTZ");
DATE("DATE"), TIME("TIME"), TIMESTAMP("TIMESTAMP"), TIMESTAMPTZ("TIMESTAMPTZ");

public String getDateTime() {
return dateTime;
Expand All @@ -68,7 +65,7 @@ public String getDateTime() {
this.dateTime = dateTime;
}

private final DateTime from(String dateTimeStr) {
public static DateTime from(String dateTimeStr) {
return Enum.valueOf(DateTime.class, dateTimeStr.toUpperCase());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import net.sf.jsqlparser.expression.operators.relational.Between;
import net.sf.jsqlparser.expression.operators.relational.EqualsTo;
import net.sf.jsqlparser.expression.operators.relational.ExistsExpression;
import net.sf.jsqlparser.expression.operators.relational.ExpressionList;
import net.sf.jsqlparser.expression.operators.relational.FullTextSearch;
import net.sf.jsqlparser.expression.operators.relational.GeometryDistance;
import net.sf.jsqlparser.expression.operators.relational.GreaterThan;
Expand Down Expand Up @@ -148,10 +149,6 @@ public interface ExpressionVisitor {

void visit(CastExpression cast);

void visit(TryCastExpression cast);

void visit(SafeCastExpression cast);

void visit(Modulo modulo);

void visit(AnalyticExpression aexpr);
Expand All @@ -178,9 +175,9 @@ public interface ExpressionVisitor {

void visit(MySQLGroupConcat groupConcat);

void visit(ValueListExpression valueList);
void visit(ExpressionList<?> expressionList);

void visit(RowConstructor rowConstructor);
void visit(RowConstructor<?> rowConstructor);

void visit(RowGetExpression rowGetExpression);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
import net.sf.jsqlparser.expression.operators.relational.RegExpMySQLOperator;
import net.sf.jsqlparser.expression.operators.relational.SimilarToExpression;
import net.sf.jsqlparser.schema.Column;
import net.sf.jsqlparser.statement.create.table.ColumnDefinition;
import net.sf.jsqlparser.statement.select.AllColumns;
import net.sf.jsqlparser.statement.select.AllTableColumns;
import net.sf.jsqlparser.statement.select.ExpressionListItem;
Expand Down Expand Up @@ -88,7 +87,7 @@ public void visit(NullValue value) {
@Override
public void visit(Function function) {
if (function.getParameters() != null) {
function.getParameters().accept(this);
function.getParameters().accept((ItemsListVisitor) this);
}
if (function.getKeep() != null) {
function.getKeep().accept(this);
Expand Down Expand Up @@ -198,8 +197,8 @@ public void visit(Between expr) {
}

public void visit(OverlapsCondition overlapsCondition) {
overlapsCondition.getLeft().accept(this);
overlapsCondition.getRight().accept(this);
overlapsCondition.getLeft().accept((ItemsListVisitor) this);
overlapsCondition.getRight().accept((ItemsListVisitor) this);
}


Expand Down Expand Up @@ -346,16 +345,6 @@ public void visit(CastExpression expr) {
expr.getLeftExpression().accept(this);
}

@Override
public void visit(TryCastExpression expr) {
expr.getLeftExpression().accept(this);
}

@Override
public void visit(SafeCastExpression expr) {
expr.getLeftExpression().accept(this);
}

@Override
public void visit(Modulo expr) {
visitBinaryExpression(expr);
Expand Down Expand Up @@ -406,8 +395,15 @@ public void visit(RegExpMatchOperator expr) {
}

@Override
public void visit(ExpressionList expressionList) {
for (Expression expr : expressionList.getExpressions()) {
public void visit(ExpressionList<?> expressionList) {
for (Expression expr : expressionList) {
expr.accept(this);
}
}

@Override
public void visit(RowConstructor<?> rowConstructor) {
for (Expression expr : rowConstructor) {
expr.accept(this);
}
}
Expand All @@ -420,8 +416,8 @@ public void visit(NamedExpressionList namedExpressionList) {
}

@Override
public void visit(MultiExpressionList multiExprList) {
for (ExpressionList list : multiExprList.getExprList()) {
public void visit(MultiExpressionList<?> multiExprList) {
for (ExpressionList<?> list : multiExprList.getExprList()) {
visit(list);
}
}
Expand Down Expand Up @@ -490,13 +486,6 @@ public void visit(MySQLGroupConcat groupConcat) {
}
}

@Override
public void visit(ValueListExpression valueListExpression) {
for (Expression expr : valueListExpression.getExpressionList().getExpressions()) {
expr.accept(this);
}
}

@Override
public void visit(Pivot pivot) {
for (FunctionItem item : pivot.getFunctionItems()) {
Expand All @@ -513,7 +502,7 @@ public void visit(Pivot pivot) {

if (pivot.getMultiInItems() != null) {
for (ExpressionListItem item : pivot.getMultiInItems()) {
item.getExpressionList().accept(this);
item.getExpressionList().accept((ItemsListVisitor) this);
}
}
}
Expand Down Expand Up @@ -555,19 +544,6 @@ public void visit(SelectItem selectExpressionItem) {
selectExpressionItem.getExpression().accept(this);
}

@Override
public void visit(RowConstructor rowConstructor) {
if (rowConstructor.getColumnDefinitions().isEmpty()) {
for (Expression expression : rowConstructor.getExprList().getExpressions()) {
expression.accept(this);
}
} else {
for (ColumnDefinition columnDefinition : rowConstructor.getColumnDefinitions()) {
columnDefinition.accept(this);
}
}
}

@Override
public void visit(RowGetExpression rowGetExpression) {
rowGetExpression.getExpression().accept(this);
Expand Down Expand Up @@ -693,8 +669,4 @@ public void visit(TranscodingFunction transcodingFunction) {
public void visit(TrimFunction trimFunction) {

}

public void visit(ColumnDefinition columnDefinition) {
columnDefinition.accept(this);
}
}
7 changes: 2 additions & 5 deletions src/main/java/net/sf/jsqlparser/expression/Function.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import net.sf.jsqlparser.parser.ASTNodeAccessImpl;
import net.sf.jsqlparser.schema.Column;
import net.sf.jsqlparser.statement.select.OrderByElement;
import net.sf.jsqlparser.statement.select.PlainSelect;

import java.util.Arrays;
import java.util.List;
Expand Down Expand Up @@ -206,7 +205,7 @@ public String toString() {
if (isAllColumns()) {
b.append("ALL ");
}
b.append(PlainSelect.getStringList(parameters.getExpressions(), true, false));
b.append(parameters);
if (orderByElements != null) {
b.append(" ORDER BY ");
boolean comma = false;
Expand Down Expand Up @@ -274,9 +273,7 @@ public Function withParameters(ExpressionList parameters) {
}

public Function withParameters(Expression... parameters) {
ExpressionList expressionList = new ExpressionList(parameters).withUsingBrackets(false);
this.setParameters(expressionList);
return this;
return withParameters(new ExpressionList(parameters));
}

public Function withNamedParameters(NamedExpressionList namedParameters) {
Expand Down
Loading