Skip to content

Commit

Permalink
fix: Postgres NextVal() function
Browse files Browse the repository at this point in the history
- allow `NEXTVAL` token for function names
- fixes #1863
- add test case
  • Loading branch information
manticore-projects committed Sep 13, 2023
1 parent 7bd42ed commit e3afa5f
Show file tree
Hide file tree
Showing 4 changed files with 133 additions and 79 deletions.
198 changes: 122 additions & 76 deletions src/main/java/net/sf/jsqlparser/parser/ParserKeywordsUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,78 +45,130 @@ public class ParserKeywordsUtils {

// Classification follows http://www.h2database.com/html/advanced.html#keywords
public final static Object[][] ALL_RESERVED_KEYWORDS = {
{"ABSENT", RESTRICTED_JSQLPARSER}, {"ALL", RESTRICTED_SQL2016},
{"AND", RESTRICTED_SQL2016}, {"ANY", RESTRICTED_JSQLPARSER}, {"AS", RESTRICTED_SQL2016},
{"BETWEEN", RESTRICTED_SQL2016}, {"BOTH", RESTRICTED_SQL2016},
{"CASEWHEN", RESTRICTED_ALIAS}, {"CHECK", RESTRICTED_SQL2016},
{"CONNECT", RESTRICTED_ALIAS}, {"CONNECT_BY_ROOT", RESTRICTED_JSQLPARSER},
{"CONSTRAINT", RESTRICTED_SQL2016}, {"CREATE", RESTRICTED_ALIAS},
{"CROSS", RESTRICTED_SQL2016}, {"CURRENT", RESTRICTED_JSQLPARSER},
{"DISTINCT", RESTRICTED_SQL2016}, {"DOUBLE", RESTRICTED_ALIAS},
{"ELSE", RESTRICTED_JSQLPARSER}, {"EXCEPT", RESTRICTED_SQL2016},
{"EXISTS", RESTRICTED_SQL2016}, {"FETCH", RESTRICTED_SQL2016},
{"FINAL", RESTRICTED_JSQLPARSER}, {"FOR", RESTRICTED_SQL2016},
{"FORCE", RESTRICTED_SQL2016}, {"FOREIGN", RESTRICTED_SQL2016},
{"FROM", RESTRICTED_SQL2016}, {"FULL", RESTRICTED_SQL2016},
{"GROUP", RESTRICTED_SQL2016}, {"GROUPING", RESTRICTED_ALIAS},
{"ABSENT", RESTRICTED_JSQLPARSER},
{"ALL", RESTRICTED_SQL2016},
{"AND", RESTRICTED_SQL2016},
{"ANY", RESTRICTED_JSQLPARSER},
{"AS", RESTRICTED_SQL2016},
{"BETWEEN", RESTRICTED_SQL2016},
{"BOTH", RESTRICTED_SQL2016},
{"CASEWHEN", RESTRICTED_ALIAS},
{"CHECK", RESTRICTED_SQL2016},
{"CONNECT", RESTRICTED_ALIAS},
{"CONNECT_BY_ROOT", RESTRICTED_JSQLPARSER},
{"CONSTRAINT", RESTRICTED_SQL2016},
{"CREATE", RESTRICTED_ALIAS},
{"CROSS", RESTRICTED_SQL2016},
{"CURRENT", RESTRICTED_JSQLPARSER},
{"DISTINCT", RESTRICTED_SQL2016},
{"DOUBLE", RESTRICTED_ALIAS},
{"ELSE", RESTRICTED_JSQLPARSER},
{"EXCEPT", RESTRICTED_SQL2016},
{"EXISTS", RESTRICTED_SQL2016},
{"FETCH", RESTRICTED_SQL2016},
{"FINAL", RESTRICTED_JSQLPARSER},
{"FOR", RESTRICTED_SQL2016},
{"FORCE", RESTRICTED_SQL2016},
{"FOREIGN", RESTRICTED_SQL2016},
{"FROM", RESTRICTED_SQL2016},
{"FULL", RESTRICTED_SQL2016},
{"GROUP", RESTRICTED_SQL2016},
{"GROUPING", RESTRICTED_ALIAS},
{"QUALIFY", RESTRICTED_ALIAS},
{"HAVING", RESTRICTED_SQL2016}, {"IF", RESTRICTED_SQL2016}, {"IIF", RESTRICTED_ALIAS},
{"IGNORE", RESTRICTED_ALIAS}, {"ILIKE", RESTRICTED_SQL2016}, {"IN", RESTRICTED_SQL2016},
{"INNER", RESTRICTED_SQL2016}, {"INTERSECT", RESTRICTED_SQL2016},
{"INTERVAL", RESTRICTED_SQL2016}, {"INTO", RESTRICTED_JSQLPARSER},
{"IS", RESTRICTED_SQL2016}, {"JOIN", RESTRICTED_JSQLPARSER},
{"LATERAL", RESTRICTED_SQL2016}, {"LEFT", RESTRICTED_SQL2016},
{"LIKE", RESTRICTED_SQL2016}, {"LIMIT", RESTRICTED_SQL2016},
{"MINUS", RESTRICTED_SQL2016}, {"NATURAL", RESTRICTED_SQL2016},
{"NOCYCLE", RESTRICTED_JSQLPARSER}, {"NOT", RESTRICTED_SQL2016},
{"NULL", RESTRICTED_SQL2016}, {"OFFSET", RESTRICTED_SQL2016},
{"ON", RESTRICTED_SQL2016}, {"ONLY", RESTRICTED_JSQLPARSER},
{"OPTIMIZE", RESTRICTED_ALIAS}, {"OR", RESTRICTED_SQL2016},
{"ORDER", RESTRICTED_SQL2016}, {"OUTER", RESTRICTED_JSQLPARSER},
{"OUTPUT", RESTRICTED_JSQLPARSER}, {"OPTIMIZE ", RESTRICTED_JSQLPARSER},
{"PIVOT", RESTRICTED_JSQLPARSER}, {"PROCEDURE", RESTRICTED_ALIAS},
{"PUBLIC", RESTRICTED_ALIAS}, {"RECURSIVE", RESTRICTED_SQL2016},
{"REGEXP", RESTRICTED_SQL2016}, {"RETURNING", RESTRICTED_JSQLPARSER},
{"RIGHT", RESTRICTED_SQL2016}, {"SAMPLE", RESTRICTED_ALIAS}, {"SEL", RESTRICTED_ALIAS},
{"HAVING", RESTRICTED_SQL2016},
{"IF", RESTRICTED_SQL2016},
{"IIF", RESTRICTED_ALIAS},
{"IGNORE", RESTRICTED_ALIAS},
{"ILIKE", RESTRICTED_SQL2016},
{"IN", RESTRICTED_SQL2016},
{"INNER", RESTRICTED_SQL2016},
{"INTERSECT", RESTRICTED_SQL2016},
{"INTERVAL", RESTRICTED_SQL2016},
{"INTO", RESTRICTED_JSQLPARSER},
{"IS", RESTRICTED_SQL2016},
{"JOIN", RESTRICTED_JSQLPARSER},
{"LATERAL", RESTRICTED_SQL2016},
{"LEFT", RESTRICTED_SQL2016},
{"LIKE", RESTRICTED_SQL2016},
{"LIMIT", RESTRICTED_SQL2016},
{"MINUS", RESTRICTED_SQL2016},
{"NATURAL", RESTRICTED_SQL2016},
{"NOCYCLE", RESTRICTED_JSQLPARSER},
{"NOT", RESTRICTED_SQL2016},
{"NULL", RESTRICTED_SQL2016},
{"OFFSET", RESTRICTED_SQL2016},
{"ON", RESTRICTED_SQL2016},
{"ONLY", RESTRICTED_JSQLPARSER},
{"OPTIMIZE", RESTRICTED_ALIAS},
{"OR", RESTRICTED_SQL2016},
{"ORDER", RESTRICTED_SQL2016},
{"OUTER", RESTRICTED_JSQLPARSER},
{"OUTPUT", RESTRICTED_JSQLPARSER},
{"OPTIMIZE ", RESTRICTED_JSQLPARSER},
{"PIVOT", RESTRICTED_JSQLPARSER},
{"PROCEDURE", RESTRICTED_ALIAS},
{"PUBLIC", RESTRICTED_ALIAS},
{"RECURSIVE", RESTRICTED_SQL2016},
{"REGEXP", RESTRICTED_SQL2016},
{"RETURNING", RESTRICTED_JSQLPARSER},
{"RIGHT", RESTRICTED_SQL2016},
{"SAMPLE", RESTRICTED_ALIAS},
{"SEL", RESTRICTED_ALIAS},
{"SELECT", RESTRICTED_ALIAS},
{"SEMI", RESTRICTED_JSQLPARSER}, {"SET", RESTRICTED_JSQLPARSER},
{"SOME", RESTRICTED_JSQLPARSER}, {"START", RESTRICTED_JSQLPARSER},
{"TABLES", RESTRICTED_ALIAS}, {"TOP", RESTRICTED_SQL2016},
{"TRAILING", RESTRICTED_SQL2016}, {"UNBOUNDED", RESTRICTED_JSQLPARSER},
{"UNION", RESTRICTED_SQL2016}, {"UNIQUE", RESTRICTED_SQL2016},
{"UNPIVOT", RESTRICTED_JSQLPARSER}, {"USE", RESTRICTED_JSQLPARSER},
{"USING", RESTRICTED_SQL2016}, {"SQL_CACHE", RESTRICTED_JSQLPARSER},
{"SQL_CALC_FOUND_ROWS", RESTRICTED_JSQLPARSER}, {"SQL_NO_CACHE", RESTRICTED_JSQLPARSER},
{"STRAIGHT_JOIN", RESTRICTED_JSQLPARSER}, {"TABLESAMPLE", RESTRICTED_ALIAS},
{"SEMI", RESTRICTED_JSQLPARSER},
{"SET", RESTRICTED_JSQLPARSER},
{"SOME", RESTRICTED_JSQLPARSER},
{"START", RESTRICTED_JSQLPARSER},
{"TABLES", RESTRICTED_ALIAS},
{"TOP", RESTRICTED_SQL2016},
{"TRAILING", RESTRICTED_SQL2016},
{"UNBOUNDED", RESTRICTED_JSQLPARSER},
{"UNION", RESTRICTED_SQL2016},
{"UNIQUE", RESTRICTED_SQL2016},
{"UNPIVOT", RESTRICTED_JSQLPARSER},
{"USE", RESTRICTED_JSQLPARSER},
{"USING", RESTRICTED_SQL2016},
{"SQL_CACHE", RESTRICTED_JSQLPARSER},
{"SQL_CALC_FOUND_ROWS", RESTRICTED_JSQLPARSER},
{"SQL_NO_CACHE", RESTRICTED_JSQLPARSER},
{"STRAIGHT_JOIN", RESTRICTED_JSQLPARSER},
{"TABLESAMPLE", RESTRICTED_ALIAS},
{"VALUE", RESTRICTED_JSQLPARSER},
{"VALUES", RESTRICTED_SQL2016}, {"VARYING", RESTRICTED_JSQLPARSER},
{"WHEN", RESTRICTED_SQL2016}, {"WHERE", RESTRICTED_SQL2016},
{"WINDOW", RESTRICTED_SQL2016}, {"WITH", RESTRICTED_SQL2016},
{"XOR", RESTRICTED_JSQLPARSER}, {"XMLSERIALIZE", RESTRICTED_JSQLPARSER}
{"VALUES", RESTRICTED_SQL2016},
{"VARYING", RESTRICTED_JSQLPARSER},
{"WHEN", RESTRICTED_SQL2016},
{"WHERE", RESTRICTED_SQL2016},
{"WINDOW", RESTRICTED_SQL2016},
{"WITH", RESTRICTED_SQL2016},
{"XOR", RESTRICTED_JSQLPARSER},
{"XMLSERIALIZE", RESTRICTED_JSQLPARSER},

// add keywords from the composite token definitions:
// tk=<K_DATE_LITERAL> | tk=<K_DATETIMELITERAL> | tk=<K_STRING_FUNCTION_NAME>
// we will use the composite tokens instead, which are always hit first before the
// simple keywords
// @todo: figure out a way to remove these composite tokens, as they do more harm than
// good
, {"SEL", RESTRICTED_JSQLPARSER}, {"SELECT", RESTRICTED_JSQLPARSER}

, {"DATE", RESTRICTED_JSQLPARSER}, {"TIME", RESTRICTED_JSQLPARSER},
{"TIMESTAMP", RESTRICTED_JSQLPARSER}

, {"YEAR", RESTRICTED_JSQLPARSER}, {"MONTH", RESTRICTED_JSQLPARSER},
{"DAY", RESTRICTED_JSQLPARSER}, {"HOUR", RESTRICTED_JSQLPARSER},
{"MINUTE", RESTRICTED_JSQLPARSER}, {"SECOND", RESTRICTED_JSQLPARSER}

, {"SUBSTR", RESTRICTED_JSQLPARSER}, {"SUBSTRING", RESTRICTED_JSQLPARSER},
{"TRIM", RESTRICTED_JSQLPARSER}, {"POSITION", RESTRICTED_JSQLPARSER},
{"OVERLAY", RESTRICTED_JSQLPARSER}

, {"NEXTVAL", RESTRICTED_JSQLPARSER}
{"SEL", RESTRICTED_JSQLPARSER},
{"SELECT", RESTRICTED_JSQLPARSER},
{"DATE", RESTRICTED_JSQLPARSER},
{"TIME", RESTRICTED_JSQLPARSER},
{"TIMESTAMP", RESTRICTED_JSQLPARSER},
{"YEAR", RESTRICTED_JSQLPARSER},
{"MONTH", RESTRICTED_JSQLPARSER},
{"DAY", RESTRICTED_JSQLPARSER},
{"HOUR", RESTRICTED_JSQLPARSER},
{"MINUTE", RESTRICTED_JSQLPARSER},
{"SECOND", RESTRICTED_JSQLPARSER},
{"SUBSTR", RESTRICTED_JSQLPARSER},
{"SUBSTRING", RESTRICTED_JSQLPARSER},
{"TRIM", RESTRICTED_JSQLPARSER},
{"POSITION", RESTRICTED_JSQLPARSER},
{"OVERLAY", RESTRICTED_JSQLPARSER},
{"NEXTVAL", RESTRICTED_COLUMN},

// @todo: Object Names should not start with Hex-Prefix, we shall not find that Token
, {"0x", RESTRICTED_JSQLPARSER}
{"0x", RESTRICTED_JSQLPARSER}
};

@SuppressWarnings({"PMD.ExcessiveMethodLength"})
Expand All @@ -126,8 +178,7 @@ public static List<String> getReservedKeywords(int restriction) {
int value = (int) data[1];

// test if bit is not set
if ((value & restriction) == restriction
|| (restriction & value) == value) {
if ((value & restriction) == restriction || (restriction & value) == value) {
keywords.add((String) data[0]);
}
}
Expand All @@ -136,7 +187,6 @@ public static List<String> getReservedKeywords(int restriction) {
}

/**
*
* @param args with: Grammar File, Keyword Documentation File
* @throws Exception
*/
Expand Down Expand Up @@ -213,9 +263,7 @@ public static void buildGrammarForRelObjectNameWithoutValue(File file) throws Ex
builder.append(" | tk=\"").append(keyword).append("\"");
}

builder.append(" )\n"
+ " { return tk.image; }\n"
+ "}");
builder.append(" )\n" + " { return tk.image; }\n" + "}");

replaceInFile(file, methodBlockPattern, builder.toString());
}
Expand Down Expand Up @@ -244,9 +292,7 @@ public static void buildGrammarForRelObjectName(File file) throws Exception {
builder.append(" | tk=\"").append(keyword).append("\"");
}

builder.append(" )\n"
+ " { return tk!=null ? tk.image : result; }\n"
+ "}");
builder.append(" )\n" + " { return tk!=null ? tk.image : result; }\n" + "}");

// @todo: Needs fine-tuning, we are not replacing this part yet
// replaceInFile(file, pattern, builder.toString());
Expand All @@ -267,9 +313,7 @@ private static void replaceInFile(File file, Pattern pattern, String replacement
}

public static String rightPadding(String input, char ch, int length) {
return String
.format("%" + (-length) + "s", input)
.replace(' ', ch);
return String.format("%" + (-length) + "s", input).replace(' ', ch);
}

public static void writeKeywordsDocumentationFile(File file) throws IOException {
Expand All @@ -293,13 +337,15 @@ public static void writeKeywordsDocumentationFile(File file) throws IOException

int value = (int) keywordDefinition[1];
int restriction = RESTRICTED_JSQLPARSER;
String s =
(value & restriction) == restriction || (restriction & value) == value ? "Yes"
: "";
String s = (value & restriction) == restriction || (restriction & value) == value
? "Yes"
: "";
builder.append(rightPadding(s, ' ', 11)).append(" | ");

restriction = RESTRICTED_SQL2016;
s = (value & restriction) == restriction || (restriction & value) == value ? "Yes" : "";
s = (value & restriction) == restriction || (restriction & value) == value
? "Yes"
: "";
builder.append(rightPadding(s, ' ', 9)).append(" | ");

builder.append("\n");
Expand Down
6 changes: 4 additions & 2 deletions src/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjt
Original file line number Diff line number Diff line change
Expand Up @@ -1752,7 +1752,7 @@ The following tokens are allowed as Names for Schema, Table, Column and Aliases
String RelObjectNameWithoutValue() :
{ Token tk = null; }
{
( tk=<S_IDENTIFIER> | tk=<S_QUOTED_IDENTIFIER> | tk=<K_DATE_LITERAL> | tk=<K_DATETIMELITERAL> | tk=<K_STRING_FUNCTION_NAME> | tk=<K_ISOLATION> | tk=<K_TIME_KEY_EXPR>
( tk=<S_IDENTIFIER> | tk=<S_QUOTED_IDENTIFIER> | tk=<K_DATE_LITERAL> | tk=<K_DATETIMELITERAL> | tk=<K_STRING_FUNCTION_NAME> | tk=<K_ISOLATION> | tk=<K_TIME_KEY_EXPR>
| tk="ACTION" | tk="ACTIVE" | tk="ADD" | tk="ADVANCE" | tk="ADVISE" | tk="AGAINST" | tk="ALGORITHM" | tk="ALTER" | tk="ANALYZE" | tk="APPLY" | tk="ARCHIVE" | tk="ARRAY" | tk="ASC" | tk="AT" | tk="AUTHORIZATION" | tk="AUTO" | tk="BEGIN" | tk="BERNOULLI" | tk="BINARY" | tk="BIT" | tk="BLOCK" | tk="BROWSE" | tk="BUFFERS" | tk="BY" | tk="BYTE" | tk="BYTES" | tk="CACHE" | tk="CALL" | tk="CASCADE" | tk="CASE" | tk="CAST" | tk="CHANGE" | tk="CHANGES" | tk="CHAR" | tk="CHARACTER" | tk="CHECKPOINT" | tk="CLOSE" | tk="COLLATE" | tk="COLUMN" | tk="COLUMNS" | tk="COMMENT" | tk="COMMIT" | tk="CONFLICT" | tk="CONVERT" | tk="COSTS" | tk="CS" | tk="CYCLE" | tk="DATABASE" | tk="DDL" | tk="DECLARE" | tk="DEFAULT" | tk="DEFERRABLE" | tk="DELAYED" | tk="DELETE" | tk="DESC" | tk="DESCRIBE" | tk="DISABLE" | tk="DISCONNECT" | tk="DIV" | tk="DML" | tk="DO" | tk="DOMAIN" | tk="DROP" | tk="DUMP" | tk="DUPLICATE" | tk="ELEMENTS" | tk="EMIT" | tk="ENABLE" | tk="END" | tk="ESCAPE" | tk="EXCLUDE" | tk="EXEC" | tk="EXECUTE" | tk="EXPLAIN" | tk="EXPLICIT" | tk="EXTENDED" | tk="EXTRACT" | tk="FALSE" | tk="FILTER" | tk="FIRST" | tk="FLUSH" | tk="FN" | tk="FOLLOWING" | tk="FORMAT" | tk="FULLTEXT" | tk="FUNCTION" | tk="GLOBAL" | tk="GRANT" | tk="GUARD" | tk="HISTORY" | tk="HOPPING" | tk="INCLUDE" | tk="INCREMENT" | tk="INDEX" | tk="INSERT" | tk="INTERLEAVE" | tk="INTERPRET" | tk="ISNULL" | tk="JSON" | tk="KEEP" | tk="KEY" | tk="KEYS" | tk="LAST" | tk="LEADING" | tk="LINK" | tk="LOCAL" | tk="LOCKED" | tk="LOG" | tk="MATCH" | tk="MATCHED" | tk="MATERIALIZED" | tk="MAXVALUE" | tk="MEMBER" | tk="MERGE" | tk="MINVALUE" | tk="MODIFY" | tk="MOVEMENT" | tk="NEXT" | tk="NO" | tk="NOCACHE" | tk="NOKEEP" | tk="NOLOCK" | tk="NOMAXVALUE" | tk="NOMINVALUE" | tk="NOORDER" | tk="NOTHING" | tk="NOTNULL" | tk="NOVALIDATE" | tk="NOWAIT" | tk="NULLS" | tk="OF" | tk="OFF" | tk="OPEN" | tk="OVER" | tk="OVERLAPS" | tk="PARALLEL" | tk="PARENT" | tk="PARTITION" | tk="PATH" | tk="PERCENT" | tk="PLACING" | tk="PRECEDING" | tk="PRECISION" | tk="PRIMARY" | tk="PRIOR" | tk="PURGE" | tk="QUERY" | tk="QUICK" | tk="QUIESCE" | tk="RANGE" | tk="RAW" | tk="READ" | tk="RECYCLEBIN" | tk="REFERENCES" | tk="REFRESH" | tk="REGISTER" | tk="RENAME" | tk="REPEATABLE" | tk="REPLACE" | tk="RESET" | tk="RESTART" | tk="RESTRICT" | tk="RESTRICTED" | tk="RESUMABLE" | tk="RESUME" | tk="RLIKE" | tk="ROLLBACK" | tk="ROOT" | tk="ROW" | tk="ROWS" | tk="RR" | tk="RS" | tk="SAVEPOINT" | tk="SCHEMA" | tk="SEED" | tk="SEPARATOR" | tk="SEQUENCE" | tk="SESSION" | tk="SETS" | tk="SHOW" | tk="SHUTDOWN" | tk="SIBLINGS" | tk="SIGNED" | tk="SIMILAR" | tk="SIZE" | tk="SKIP" | tk="STORED" | tk="STRING" | tk="SUSPEND" | tk="SWITCH" | tk="SYNONYM" | tk="SYSTEM" | tk="TABLE" | tk="TABLESPACE" | tk="TEMP" | tk="TEMPORARY" | tk="THEN" | tk="TIMEOUT" | tk="TIMESTAMPTZ" | tk="TO" | tk="TRIGGER" | tk="TRUE" | tk="TRUNCATE" | tk="TUMBLING" | tk="TYPE" | tk="UNLOGGED" | tk="UNQIESCE" | tk="UNSIGNED" | tk="UPDATE" | tk="UPSERT" | tk="UR" | tk="USER" | tk="VALIDATE" | tk="VERBOSE" | tk="VIEW" | tk="WAIT" | tk="WITHIN" | tk="WITHOUT" | tk="WORK" | tk="XML" | tk="XMLAGG" | tk="XMLDATA" | tk="XMLSCHEMA" | tk="XMLTEXT" | tk="XSINIL" | tk="YAML" | tk="YES" | tk="ZONE" )
{ return tk.image; }
}
Expand Down Expand Up @@ -1797,7 +1797,9 @@ String RelObjectNameExt():
( result=RelObjectName() | tk=<K_ALL> | tk=<K_ANY> | tk=<K_SOME> | tk=<K_LEFT> | tk=<K_RIGHT> | tk=<K_SET>
| tk=<K_DOUBLE> | tk=<K_IF> | tk=<K_IIF> | tk=<K_OPTIMIZE> | tk=<K_LIMIT>
| tk=<K_OFFSET> | tk=<K_PROCEDURE> | tk=<K_PUBLIC>
| tk=<K_CASEWHEN> | tk=<K_IN> | tk=<K_GROUPING> | tk=<K_ORDER> )
| tk=<K_CASEWHEN> | tk=<K_IN> | tk=<K_GROUPING> | tk=<K_ORDER>
| tk=<K_NEXTVAL>
)
{ return tk!=null ? tk.image : result; }
}

Expand Down
2 changes: 1 addition & 1 deletion src/site/sphinx/keywords.rst
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ The following Keywords are **restricted** in JSQLParser-|JSQLPARSER_VERSION| and
+----------------------+-------------+-----------+
| OVERLAY | Yes | Yes |
+----------------------+-------------+-----------+
| NEXTVAL | Yes | Yes |
| NEXTVAL | Yes | |
+----------------------+-------------+-----------+
| 0x | Yes | Yes |
+----------------------+-------------+-----------+
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,10 @@ void testPostgresQuotingIssue1335() throws JSQLParserException {
"\"column\"\"with\"\"quotes\"",
selectItems.get(0).getExpression(Column.class).getColumnName());
}

@Test
void testNextValueIssue1863() throws JSQLParserException {
String sqlStr = "SELECT nextval('client_id_seq')";
assertSqlCanBeParsedAndDeparsed(sqlStr);
}
}

0 comments on commit e3afa5f

Please sign in to comment.