File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
src/test/java/net/sf/jsqlparser/util Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 1111import java .util .List ;
1212import java .util .StringTokenizer ;
1313import static junit .framework .Assert .assertEquals ;
14+ import static junit .framework .Assert .assertTrue ;
1415
1516import junit .framework .TestCase ;
1617import net .sf .jsqlparser .parser .CCJSqlParserManager ;
@@ -147,6 +148,18 @@ public void testGetTableListWithStmt() throws Exception {
147148 assertEquals (1 , tableList .size ());
148149 assertEquals ("MY_TABLE1" , (String ) tableList .get (0 ));
149150 }
151+
152+ public void testGetTableListWithLateral () throws Exception {
153+ String sql = "SELECT * FROM MY_TABLE1, LATERAL(select a from MY_TABLE2) as AL" ;
154+ net .sf .jsqlparser .statement .Statement statement = pm .parse (new StringReader (sql ));
155+
156+ Select selectStatement = (Select ) statement ;
157+ TablesNamesFinder tablesNamesFinder = new TablesNamesFinder ();
158+ List <String > tableList = tablesNamesFinder .getTableList (selectStatement );
159+ assertEquals (2 , tableList .size ());
160+ assertTrue (tableList .contains ("MY_TABLE1" ));
161+ assertTrue (tableList .contains ("MY_TABLE2" ));
162+ }
150163
151164 private String getLine (BufferedReader in ) throws Exception {
152165 return CCJSqlParserManagerTest .getLine (in );
You can’t perform that action at this time.
0 commit comments