File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
src/test/java/net/sf/jsqlparser/test/select Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 1919
2020import java .io .IOException ;
2121import java .io .StringReader ;
22+ import static junit .framework .Assert .assertEquals ;
2223
2324import static net .sf .jsqlparser .test .TestUtils .*;
2425
@@ -895,6 +896,13 @@ public void testExtractFrom4() throws JSQLParserException {
895896 public void testProblemFunction () throws JSQLParserException {
896897 String stmt = "SELECT test() FROM testtable" ;
897898 assertSqlCanBeParsedAndDeparsed (stmt );
899+ Statement parsed = CCJSqlParserUtil .parse (stmt );
900+ Select select = (Select ) parsed ;
901+ PlainSelect plainSelect = (PlainSelect ) select .getSelectBody ();
902+ SelectItem get = plainSelect .getSelectItems ().get (0 );
903+ SelectExpressionItem item = (SelectExpressionItem )get ;
904+ assertTrue (item .getExpression () instanceof Function );
905+ assertEquals ("test" , ((Function )item .getExpression ()).getName ());
898906 }
899907
900908 public void testProblemFunction2 () throws JSQLParserException {
You can’t perform that action at this time.
0 commit comments