File tree Expand file tree Collapse file tree 3 files changed +13
-3
lines changed
java/net/sf/jsqlparser/schema
jjtree/net/sf/jsqlparser/parser
test/java/net/sf/jsqlparser/statement/alter Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -198,7 +198,11 @@ public String formatParameter() {
198
198
case START_WITH :
199
199
return prefix ("START WITH" );
200
200
case RESTART_WITH :
201
- return prefix ("RESTART WITH" );
201
+ if (value != null ){
202
+ return prefix ("RESTART WITH" );
203
+ } else {
204
+ return "RESTART" ;
205
+ }
202
206
case MAXVALUE :
203
207
case MINVALUE :
204
208
case CACHE :
Original file line number Diff line number Diff line change @@ -6093,10 +6093,12 @@ List<Sequence.Parameter> SequenceParameters():
6093
6093
}
6094
6094
)
6095
6095
|
6096
- (<K_RESTART> <K_WITH> token=<S_LONG>
6096
+ (<K_RESTART> [ <K_WITH> token=<S_LONG>]
6097
6097
{
6098
6098
parameter = new Sequence.Parameter(Sequence.ParameterType.RESTART_WITH);
6099
- parameter.setValue(Long.parseLong(token.image));
6099
+ if(token != null){
6100
+ parameter.setValue(Long.parseLong(token.image));
6101
+ }
6100
6102
sequenceParameters.add(parameter);
6101
6103
}
6102
6104
)
Original file line number Diff line number Diff line change @@ -116,4 +116,8 @@ public void testAlterSequence_restartIssue1405() throws JSQLParserException {
116
116
assertSqlCanBeParsedAndDeparsed ("ALTER SEQUENCE my_seq RESTART WITH 1" );
117
117
}
118
118
119
+ @ Test
120
+ public void testAlterSequence_restartIssue1405WithoutValue () throws JSQLParserException {
121
+ assertSqlCanBeParsedAndDeparsed ("ALTER SEQUENCE my_seq RESTART" );
122
+ }
119
123
}
You can’t perform that action at this time.
0 commit comments