Skip to content

Commit 28d5912

Browse files
committed
Merge origin/master
2 parents 732e840 + d321848 commit 28d5912

File tree

5 files changed

+30
-11
lines changed

5 files changed

+30
-11
lines changed

src/main/java/net/sf/jsqlparser/parser/feature/Feature.java

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,11 @@ public enum Feature {
327327
updateUseSelect,
328328
updateOrderBy,
329329
updateLimit,
330+
/**
331+
* "RETURNING expr(, expr)*"
332+
*
333+
* @see SelectExpressionItem
334+
*/
330335
updateReturning,
331336
/**
332337
* SQL "DELETE" statement is allowed
@@ -350,6 +355,12 @@ public enum Feature {
350355
* "ORDER BY ..."
351356
*/
352357
deleteOrderBy,
358+
/**
359+
* "RETURNING expr(, expr)*"
360+
*
361+
* @see SelectExpressionItem
362+
*/
363+
deleteReturningExpressionList,
353364

354365
/**
355366
* SQL "UPSERT" statement is allowed
@@ -501,7 +512,7 @@ public enum Feature {
501512
*/
502513
createTableRowMovement,
503514
/**
504-
* "CREATE TABLE (colspec) SELECT ...
515+
* "CREATE TABLE (colspec) SELECT ...
505516
*/
506517
createTableFromSelect,
507518
/**
@@ -615,7 +626,7 @@ public enum Feature {
615626
set,
616627
/**
617628
* @see ResetStatement
618-
*/
629+
*/
619630
reset,
620631
/**
621632
* @see Pivot
@@ -724,17 +735,18 @@ public enum Feature {
724735
allowSquareBracketQuotation(false),
725736

726737
/**
727-
allow parsing of RDBMS specific syntax by switching off SQL Standard Compliant Syntax
728-
*/
738+
* allow parsing of RDBMS specific syntax by switching off SQL Standard
739+
* Compliant Syntax
740+
*/
729741
allowPostgresSpecificSyntax(false),
730742

731743
// PERFORMANCE
732-
744+
733745
/**
734746
* allows complex expression parameters or named parameters for functions
735747
* will be switched off, when deep nesting of functions is detected
736748
*/
737-
allowComplexParsing(true),
749+
allowComplexParsing(true),
738750

739751
/**
740752
* allows passing through Unsupported Statements as a plain List of Tokens

src/main/java/net/sf/jsqlparser/util/validation/feature/FeaturesAllowed.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ public class FeaturesAllowed implements FeatureSetValidation, ModifyableFeatureS
110110
* all {@link Feature}' for SQL UPDATE including {@link #SELECT}
111111
*/
112112
public static final FeaturesAllowed DELETE = new FeaturesAllowed("DELETE", Feature.delete, Feature.deleteJoin,
113-
Feature.deleteLimit, Feature.deleteOrderBy, Feature.deleteTables, Feature.truncate)
113+
Feature.deleteLimit, Feature.deleteOrderBy, Feature.deleteTables, Feature.deleteReturningExpressionList,
114+
Feature.truncate)
114115
.add(SELECT).unmodifyable();
115116

116117
/**

src/main/java/net/sf/jsqlparser/util/validation/feature/OracleVersion.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ public enum OracleVersion implements Version {
100100

101101
// https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/DELETE.html
102102
Feature.delete,
103+
Feature.deleteReturningExpressionList,
103104

104105
// https://www.oracletutorial.com/oracle-basics/oracle-truncate-table/
105106
Feature.truncate,

src/main/java/net/sf/jsqlparser/util/validation/feature/PostgresqlVersion.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public enum PostgresqlVersion implements Version {
9898
// https://www.postgresql.org/docs/current/sql-createindex.html
9999
Feature.createIndex,
100100
// https://www.postgresql.org/docs/current/sql-createtable.html
101-
Feature.createTable, Feature.createTableUnlogged,
101+
Feature.createTable, Feature.createTableUnlogged,
102102
Feature.createTableCreateOptionStrings, Feature.createTableTableOptionStrings,
103103
Feature.createTableFromSelect, Feature.createTableIfNotExists,
104104
// https://www.postgresql.org/docs/current/sql-createview.html
@@ -111,12 +111,14 @@ public enum PostgresqlVersion implements Version {
111111
Feature.insertValues,
112112
Feature.values,
113113
Feature.insertFromSelect,
114-
Feature.insertReturningAll, Feature.insertReturningExpressionList,
114+
Feature.insertReturningAll,
115+
Feature.insertReturningExpressionList,
115116
// https://www.postgresql.org/docs/current/sql-update.html
116117
Feature.update,
117118
Feature.updateReturning,
118119
// https://www.postgresql.org/docs/current/sql-delete.html
119120
Feature.delete,
121+
Feature.deleteReturningExpressionList,
120122
// https://www.postgresql.org/docs/current/sql-truncate.html
121123
Feature.truncate,
122124

@@ -150,7 +152,10 @@ public enum PostgresqlVersion implements Version {
150152
// https://www.postgresql.org/docs/current/sql-commit.html
151153
Feature.commit
152154
)),
153-
V11("11", V10.copy().getFeatures()), V12("12", V11.copy().getFeatures());
155+
V11("11", V10.copy().getFeatures()),
156+
V12("12", V11.copy().getFeatures()),
157+
V13("13", V12.copy().getFeatures()),
158+
V14("14", V13.copy().getFeatures());
154159

155160
private Set<Feature> features;
156161
private String versionString;

src/main/java/net/sf/jsqlparser/util/validation/validator/DeleteValidator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public void validate(Delete delete) {
2828
validateOptionalFeature(c, delete.getJoins(), Feature.deleteJoin);
2929
validateOptionalFeature(c, delete.getLimit(), Feature.deleteLimit);
3030
validateOptionalFeature(c, delete.getOrderByElements(), Feature.deleteOrderBy);
31-
validateOptionalFeature(c, delete.getReturningExpressionList(), Feature.insertReturningExpressionList);
31+
validateOptionalFeature(c, delete.getReturningExpressionList(), Feature.deleteReturningExpressionList);
3232
}
3333

3434
SelectValidator v = getValidator(SelectValidator.class);

0 commit comments

Comments
 (0)