File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
main/java/net/sf/jsqlparser/util
test/java/net/sf/jsqlparser/util Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -706,7 +706,7 @@ public void visit(Drop drop) {
706
706
707
707
@ Override
708
708
public void visit (Truncate truncate ) {
709
- throw new UnsupportedOperationException ( NOT_SUPPORTED_YET );
709
+ visit ( truncate . getTable () );
710
710
}
711
711
712
712
@ Override
Original file line number Diff line number Diff line change @@ -197,6 +197,14 @@ public void testGetTableListFromDelete2() throws Exception {
197
197
assertTrue (tableList .contains ("MY_TABLE1" ));
198
198
}
199
199
200
+ @ Test
201
+ public void testGetTableListFromTruncate () throws Exception {
202
+ String sql = "TRUNCATE TABLE MY_TABLE1" ;
203
+ List <String > tables = new TablesNamesFinder ().getTableList (pm .parse (new StringReader (sql )));
204
+ assertEquals (1 , tables .size ());
205
+ assertTrue (tables .contains ("MY_TABLE1" ));
206
+ }
207
+
200
208
@ Test
201
209
public void testGetTableListFromDeleteWithJoin () throws Exception {
202
210
String sql = "DELETE t1, t2 FROM MY_TABLE1 t1 JOIN MY_TABLE2 t2 ON t1.id = t2.id" ;
You can’t perform that action at this time.
0 commit comments