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) {
706706
707707 @ Override
708708 public void visit (Truncate truncate ) {
709- throw new UnsupportedOperationException ( NOT_SUPPORTED_YET );
709+ visit ( truncate . getTable () );
710710 }
711711
712712 @ Override
Original file line number Diff line number Diff line change @@ -197,6 +197,14 @@ public void testGetTableListFromDelete2() throws Exception {
197197 assertTrue (tableList .contains ("MY_TABLE1" ));
198198 }
199199
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+
200208 @ Test
201209 public void testGetTableListFromDeleteWithJoin () throws Exception {
202210 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