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() {
198198 case START_WITH :
199199 return prefix ("START WITH" );
200200 case RESTART_WITH :
201- return prefix ("RESTART WITH" );
201+ if (value != null ){
202+ return prefix ("RESTART WITH" );
203+ } else {
204+ return "RESTART" ;
205+ }
202206 case MAXVALUE :
203207 case MINVALUE :
204208 case CACHE :
Original file line number Diff line number Diff line change @@ -6093,10 +6093,12 @@ List<Sequence.Parameter> SequenceParameters():
60936093 }
60946094 )
60956095 |
6096- (<K_RESTART> <K_WITH> token=<S_LONG>
6096+ (<K_RESTART> [ <K_WITH> token=<S_LONG>]
60976097 {
60986098 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+ }
61006102 sequenceParameters.add(parameter);
61016103 }
61026104 )
Original file line number Diff line number Diff line change @@ -116,4 +116,8 @@ public void testAlterSequence_restartIssue1405() throws JSQLParserException {
116116 assertSqlCanBeParsedAndDeparsed ("ALTER SEQUENCE my_seq RESTART WITH 1" );
117117 }
118118
119+ @ Test
120+ public void testAlterSequence_restartIssue1405WithoutValue () throws JSQLParserException {
121+ assertSqlCanBeParsedAndDeparsed ("ALTER SEQUENCE my_seq RESTART" );
122+ }
119123}
You can’t perform that action at this time.
0 commit comments